-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pulling 10-K filings from XBRL for multiple years not just one year #100
Labels
question
Further information is requested
Comments
Can you post the error here? Thanks |
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
-->Hey Dwight, How are you? I hope you are doing well. So I am just following up with you. I was wondering if you could give me some guidance on the below code. I am trying to pull multiple years using the below but I keep getting a blank excel file. Please let me know your thoughts as soon as you can. Thank you. # Example usage:if __name__ == '__main__': output_path = Path('/Users/name/Documents/Apple_Financials_2013_2023.xlsx') with output_path.open('wb') as f: with ExcelWriter(f, engine='xlsxwriter') as writer: for year in range(2013, 2023 + 1): try: # Retrieve the 10-K filing for the given year filings = Company("AAPL").get_filings(form="10-K") filing_for_year = next(filing for filing in filings if filing.filing_date.year == year) # Process the XBRL data for the filing xbrl = filing_for_year.xbrl() # Write the statements to the Excel workbook write_statements(xbrl, writer, year) except StopIteration: print(f"No 10-K filing found for year {year}") except Exception as e: print(f"Error processing year {year} for AAPL: {str(e)}") From: Dwight Gunning ***@***.***>Date: Wednesday, September 4, 2024 at 8:02 PMTo: dgunning/edgartools ***@***.***>Cc: david08-08 ***@***.***>, Author ***@***.***>Subject: Re: [dgunning/edgartools] Pulling 10-K filings from XBRL for multiple years not just one year (Issue #100)Can you post the error here? Thanks—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Example usage:if name == 'main':
|
This is implemented in the latest version from edgar import *
company = Company("MSFT")
filings = company.get_filings(form="10-K").latest(9)
financials = MultiFinancials(filings)
financials.get_balance_sheet()
financials.get_cash_flow_statement()
financials.get_income_statement() |
filings represents multiple filings. You need a single one. Use filings[0] or filings.latest(1)On Oct 5, 2024, at 8:19 PM, unparadise ***@***.***> wrote:
I am testing pulling financial data from XBRL. But the following code is giving me grief.
'''
from edgar import *
set_identity("Frank Chen ***@***.***")
filings = Company("AAPL").get_filings(form="10-K")
print(filings.xbrl())
'''
Error message
Traceback (most recent call last):
File "/path_to_file/edgar_xbrl_test.py", line 6, in
print(filings.xbrl())
^^^^^^^^^^^^
AttributeError: 'EntityFilings' object has no attribute 'xbrl'
What's the right way to access the xbrl object?
Thank you very much!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Dgunning, thank you for your reply. I was able to figure out the problem myself. I opened another issue regarding some data missing from the return of the XBRL get_statement function. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to pull 10-K for multiple years but I keep getting an error in the output. Can someone please give me some guidance on how to put the code together for this task. Below is what I put together but I keep getting an error. Thank you.
if name == 'main':
output_path = Path('/Users/name/Documents/Apple_Financials_2013_2023.xlsx')
The text was updated successfully, but these errors were encountered: