Skip to content

How can I interact with the facts stored in inst? #4

Answered by manusimidt
cjs365 asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the late answer. Got no notification about your question for some reason...

Thank you!
I would just loop over the facts array of the instance object i.e:

# code for downloading and parsing the submission
cache: HttpCache = HttpCache('./../cache/', delay=500)
instance_url = 'https://www.sec.gov/Archives/edgar/data/320193/000032019320000096/aapl-20200926.htm'
inst: XbrlInstance = parse_ixbrl_url(instance_url, cache)
print(inst)

# now extracting some selected facts
extracted_data: [dict] = []
selected_facts: [str] = ['Assets', 'Liabilities', 'StockholdersEquity']
for fact in inst.facts:
    # use some kind of filter, otherwise your dataframe will have maaaaannnyyy columns (one for…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by manusimidt
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
3 participants