Replies: 4 comments 6 replies
-
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply! That helps. I updated my code & it can handle dimensions on the same fact reasonably well - it can differentiate For a more concrete, consider this 10-Q from AMD. There are 26 results for the fact |
Beta Was this translation helpful? Give feedback.
-
Hi Sam
A short intro - used to help companies build XBRL processors and reporting
solutions as an external consultant: did so for some 20 years almost. In
the last couple of years I drifted away from pure XBRL work to do work in
AI/Deep Learning in Earth Observation, Satellite image processing and
Climate change work with possible connections to ESG reporting. The market
for XBRL was drying up for one-man shops in this space So decided to look
into something new.
If you want I can try to help you out a bit here… I’m a bit rusty on the
material but if you want to connect I’m at raynierx at gmail.com
Take care - René
Raynier van Egmond
XBRL Consulting Partners LLC
— I’m on LinkedIn too—
…On Fri, Mar 17, 2023 at 7:03 AM Sam Kerr ***@***.***> wrote:
Thanks for the reply! That helps.
I updated my code & it can handle dimensions on the same fact reasonably
well - it can differentiate Revenue (Total) from Revenue
(Hardware/Software/etc). What I'm stuck at with that approach though is
that the same fact name may be present multiple times & used in different
parts of the statement, such as in the cash flow statement and then later
in a footnote. I'm not sure how to differentiate which version to use,
which means that I will be returning the wrong one & looking at a context
that is for a footnote-only and not a cash flow statement.
For a more concrete, consider this 10-Q
<https://www.sec.gov/ix?doc=/Archives/edgar/data/2488/000000248822000170/amd-20220924.htm>
from AMD. There are 26 results for the fact net income (loss)
attributable to parent. 4 of them are used in the income statement, 2 are
used in the cash flow statement, and others are used in the footnotes. When
rendering the cash flow statement, if I look at all the available contexts
for this fact, it would appear there are 4 valid ones, but only 2 of them
are actually used in the cash flow statement.
—
Reply to this email directly, view it on GitHub
<#109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKYVRLR72AW7SGNGPJVDUKLW4RVMPANCNFSM6AAAAAAVYJNRYA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi -
just a quick reminder from what would have been mentioned in the
publications you have mentioned above about the structure of "XBRL
filings". Each filing consists of multiple files;
* Firstly there is the taxonomy which is a set of files that consists of a *XML
schema file* and a number of *linkbase files* (XLink files) (one for
presentation, one for calculation and one for the multidimensional aspects
of the reported data.
* Then there is the* instance document* (a regular XML document that
references its associated taxonomy XML schema file) which reports the facts
for the filing.
There is really no way around using ALL THESE FILES to process an XBRL or
iXBRL filing. This is why "XBRL processors" like the Py-xbrl ithat Manual
has created are so important; they take care of all the parsing and
stitching together of the various physical files that make up the "XBRL
document". It simply requires a good deal of understanding of the
structure and role of all the pieces of the XBRL spec. The XBRL filings
that are reported to say the SEC or some other regulator are not a single
XML file as a plain vanilla XML-instance/XML Schema scario would be --- its
much more complex (though not complicated ;-) than that.
Wrt to the roles of these various file: the XBRL Taxonomy *schema file* is
a required document because it functions as the data dictionary for all the
accounting elements that are used in a filing (e.g. 10-K). If one simply
processes just the presentation linkbase file none of the data
dictionary "concept definitions" are there and the process becomes
nonsensical in XBRL terms.
You must process the s*chema file + linkbase files* and if the reported
facts have to presented also then *the instance document must also be
provided!*
If you want some more guidance sent me an email at raynierx at gmail.com
take care
René
…On Sun, Apr 30, 2023 at 10:42 AM pnatusch ***@***.***> wrote:
While I'm an experienced programmer, I'm new to XBRL and I've been
struggling trying to get a handle on it. I've read XBRL for dummies and The
XBRL book by Ghislain Fourny. Based on Chapter 5 (Presentation) in "The
XBRL book", I got the understanding that from the presentation linkbase
that I could get the correct ordering and then get the facts from the
instance. Does that make sense?
As my first "project", I'm just trying to parse the xbrl documents and
print out a balance sheet in the correct order.
Randomly, I chose to parse the IBM presentation linkbase, however, after
parsing, the linkbase object was empty. What am I doing wrong? If this is a
bug, I'm happy to help debug, but my assumption is that I'm just doing
something stupid, so I didn't want to go down that path
linkbase_url: str = '
https://www.sec.gov/Archives/edgar/data/51143/000155837023002376/ibm-20221231_pre.xml
'
linkbase: Linkbase = parse_linkbase_url(linkbase_url, LinkbaseType.LABEL,
cache)
(Pdb) linkbase.type
<LinkbaseType.LABEL: 4>
(Pdb) linkbase.linkbase_uri
'
https://www.sec.gov/Archives/edgar/data/51143/000155837023002376/ibm-20221231_pre.xml
'
(Pdb) linkbase.type
<LinkbaseType.LABEL: 4>
(Pdb) linkbase.linkbase_uri
'
https://www.sec.gov/Archives/edgar/data/51143/000155837023002376/ibm-20221231_pre.xml
'
(Pdb) linkbase.to_dict()
{'standardExtendedLinkElements': []}
(Pdb) linkbase.to_simple_dict()
{'standardExtendedLinkElements': []}
(Pdb) linkbase.extended_links
[]
(Pdb)
First couple lines from presentation linkbase file
<link:linkbase xsi:schemaLocation="http://www.xbrl.org/2003/instance
http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd">
<roleRef xlink:type="simple"
xlink:href="ibm-20221231.xsd#StatementConsolidatedStatementOfComprehensiveIncome"
roleURI="http://www.ibm.com
—
Reply to this email directly, view it on GitHub
<#109 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKYVRLRV57MCY6ZTU4L2YADXD2QAXANCNFSM6AAAAAAVYJNRYA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi! Really enjoying py-xbrl so far!
I am trying to separate out which facts correspond to which presentation linkbases in the instance and having some trouble. My first approach was to search for a fact (e.g. "Revenue") and use the first one found. This works fine for some cases but not most. I also tried to find all facts for a given presentation linkbase, look at which contexts had the most facts in common and use that. This got closer, but still doesn't work in enough cases.
Then I thought that the fact list may be sorted by the order it was consumed. So I tried iterating over each presentation linkbase along with the list of facts and "chomping" the front of the fact list as the presentation dictionary called for various facts. However, it appears that the facts are not strictly ordered by how the presentation dictionary uses them.
Do you have any guidance on how the facts are ordered in the instance or how I can determine which facts are used for a given presentation linkbase?
Beta Was this translation helpful? Give feedback.
All reactions