dgunning / edgartools

Python library for working with SEC Edgar
MIT License
324 stars 70 forks source link

Display multiple financial statements #40

Closed RonakDoshi007 closed 2 months ago

RonakDoshi007 commented 2 months ago

I am trying to print financial statements of quarterly or annual reports. However, the API allows ti print only one at a time. Is there a way to dump the information of last say 3 statements in single table?

For example Company("AAPL").get_filings(form="10-K", date="2021-01-01:").latest(1).obj()

The above one prints only one statement. Can the API consolidate all the requested filings and dump in a table format?

dgunning commented 2 months ago

Thanks for this feedback .. I'll take a look

RonakDoshi007 commented 2 months ago

Thanks. Something like below should be good to read financial documents of a set of years together for comparison.

BalanceSheet Label 2024-02-08 2023-02-10 2022-02-03 2021-02-05 2020-02-06 2019-02-07 0 Cash and Cash Equivalents 9,081 7,776 5,197 4,794 7,349 7,575
1 Short-term Investments 4,979 3,092 4,303 8,289 3,412 1,534
3 Current Assets 62,569 57,517 52,574 50,995 38,495 32,963
....

dgunning commented 2 months ago

Currently working on this, will take a few more days but should go into the next release

dgunning commented 2 months ago

Finished the data selection code, now working on the display code

dgunning commented 2 months ago

Close to completion, currently testing

dgunning commented 2 months ago

Implemented multiple statement display in 2.20.0

ilias-ant commented 2 months ago

hello!

I was just tinkering with version 2.20.0 and i noticed the following:

from edgar import Company, set_identity

if __name__ == "__main__":
    set_identity("Ilias Antonopoulos (xxxxxxxxxxx@gmail.com)")

    filings = Company("AAPL").get_filings(form="10-K", filing_date="2023-01-01:2023-12-31")

    filing = filings.get(0).obj()

    print(filing.financials.balance_sheet)

image

Given that a user utilizes filing_date date range filtering to restrict filings retrieval to those that are of interest, isn't it a bit weird to always get 3 consecutive filings based on his filing_date, even though some of them might reside outside the filing_date date range?

dgunning commented 2 months ago

This feature was to allow the ability to display multiple periods on the financial statement, mimicking what is in the actual statement on a 10-K. The Apple 10-K has the current year and previous year information in the Balance Sheet. The previous year's information give context on how things have changed

balance-sheet
RonakDoshi007 commented 2 months ago

Btw, the 3rd year of balance sheet is always empty or incomplete. In above image, Balance sheet has 2023 and 2022 updated but not 2021. I observed similar case for other tickers.

dgunning commented 2 months ago

Will fix that in the next release

dgunning commented 2 months ago

This is fixed in 2.21.0 onwards