manusimidt / py-xbrl

Python-based parser for parsing XBRL and iXBRL files
https://py-xbrl.readthedocs.io/en/latest/
GNU General Public License v3.0
111 stars 40 forks source link

Is there a way to show the complete tags? #37

Closed hakube closed 3 years ago

hakube commented 3 years ago

Awesome library. I have a question btw if you don't mind?

Is there a way to show the complete tags for each facts?

ex.

I'm looking to separate the standard and non-standar tag in the SEC filings

manusimidt commented 3 years ago

Thanks a lot! The tag name of each fact is discarded because it is only needed for connecting the fact with the concept from the taxonomy. The filer could theoretically also use a completely different prefix for us-gaap and then the xml-tag would change i.e: us-gaap-2020:AssetsCurrent instead of us-gaap:AssetsCurrent.

Moreover, the xml tags are only present in XBRL filings and not in the newer iXBRL filings. For example: Here is a fact in XBRL:

 <us-gaap:Assets contextRef="FI2018Q4" unitRef="usd" decimals="-6">365725000000</us-gaap:Assets> 

And here is the same fact in iXBRL

<ix:nonFraction contextRef="FI2018Q4" unitRef="usd" decimals="-6" format="ixt:numdotdecimal" name="us-gaap:Assets" scale="6">365,725</ix:nonFraction>

I would recommmend to seperate standard and non-stantard facts by looking either at the "xml_id" of the concept (first letters) or by looking at the "schema_url" of the taxonomy in which the concept is defined.

image