SEC Financial Statement Time Series Analysis

170 views
Skip to first unread message

Bill Colak

unread,
May 12, 2021, 1:53:17 AM5/12/21
to Arelle-users
How would one go about to merge annual financial statements on a company using arelle just like on SEC's inline viewer but in a longer time frame. I want something like the picture presented below for income, balance sheet and cash flow statements for last 5 years presented in a pandas data frame.

chrome_B6j1PkWp4j.png

I have been working on this for months and I have to say arelle's documentation is not very friendly. I have been trying to reverse engineer the source code but haven't been very successful. Any help would be very welcome.

M G

unread,
May 12, 2021, 8:11:32 AM5/12/21
to Arelle-users
Hi, Bill

I was trying to do something similar to what you want to do.  I am sure there are lots of different ways to do it, but the way I went about it was to:

1) Install PostgreSQL
2) Install Arelle
3) Install XBRL-US Public Database schema on PostgreSQL (see https://arelle.org/arelle/documentation/xbrl-database/  for more details)
4) Use Arelle command line to load individual companies' 10-Q/10-K into the DB schema.
5) Create SQL views on top of the tables in the schema to reproduce Balance Sheet/Income Statement/Cash Flow Statement for a given quarter for a given company

Once you have the information in a view, it should be an easier exercise to get the result sets of the views into a pandas dataframe for further analysis.

I found learning about all this to be a tough slog as well.  I started to write an on-line tutorial for how to do this, but didn't get that far yet.  To see what I have so far, go to http://crosskeystechnologies.com/edgar/edgar_intro.html and navigate from there.

If the tutorial is headed in the right direction for what you want to do, let me know, and I will try to add to it in the coming weeks. 

Good luck - Regards from Mike G.
Reply all
Reply to author
Forward
0 new messages