Skip to content

Is it possible to parse the GAAP standards taxonomy? #111

Answered by scottcarlson
scottcarlson asked this question in Q&A
Discussion options

You must be logged in to vote

I was finally able to find time to return to this project and I realized I completely missed the TaxonomySchema functionality. With that I was able to create what I needed.

Here's a sample code snippet in case anyone else comes across this:

from xbrl.cache import HttpCache
from xbrl.taxonomy import TaxonomySchema, parse_taxonomy_url
from xbrl.linkbase import PresentationArc

cache: HttpCache = HttpCache('./.cache')

schema_paths = [
  # TODO: Dynamically fetch all root XSD files from `stm` and `dis` directories
  # at https://xbrl.fasb.org/us-gaap/2022/ and other years of choice
  "https://xbrl.fasb.org/us-gaap/2022/stm/us-gaap-stm-soc-2022.xsd",
  "https://xbrl.fasb.org/us-gaap/2022/dis/…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by scottcarlson
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants