dgunning / edgartools

Navigate SEC Edgar data in Python
MIT License
478 stars 97 forks source link

XBRL- TER QUARTERLY FILING (same issue as NOW) & when pulling through TENQ the Cash Flow statement is not exporting to excel for TER and NOW. Possible Bug? #139

Open david08-08 opened 3 days ago

david08-08 commented 3 days ago

Hi Dwight,

I just noticed the same thing as well with ticker symbol TER. Not all the statements are being exported to excel when using the XBRL library for the most recent quarterly statement which was issued this past week. I listed the statements below. In addition when pulling the quarterly filing using the TENQ library the cash flow statement is not exporting to excel.

Please advise. Thank you.

Screenshot when pulling through TENQ:

Screenshot 2024-10-27 at 2 15 17 PM

XBRL statements missing from most recent quarterly filing:

  | Condensed Consolidated Statements of Operations for the Three and Six Months ended June 30, 2024 and July 2, 2023 | 2

  | Condensed Consolidated Statements of Comprehensive Income for the Three and Six Months ended June 30, 2024, and July 2, 2023

david08-08 commented 3 days ago

Here is the code I am using

import pandas as pd from rich import print from edgar import Company, set_identity from edgar.company_reports import TenK, TenQ, TwentyF, EightK from edgar.htmltools import ChunkedDocument

set_identity("david@gmail.com")

pd.options.display.max_colwidth = 40

Pull financial data for NOW Stock

tenq = Company("NOW").get_filings(form="10-Q")[0].obj() financials = tenq.financials

Extract financial statements as DataFrames using the get_dataframe() method

balance_sheet_df = financials.get_balance_sheet().get_dataframe() cash_flow_df = financials.get_cash_flow_statement().get_dataframe() income_statement_df = financials.get_income_statement().get_dataframe()

Inspect the structure of the DataFrames to ensure labels and numbers are included

print(balance_sheet_df.head()) # For checking the first few rows print(cash_flow_df.head()) print(income_statement_df.head())

Set file path to your Documents folder

output_file = "/Users/david/Documents/NOW_10Q_Financials_with_labels.xlsx"

Write data to Excel with separate sheets

with pd.ExcelWriter(output_file, engine='xlsxwriter') as writer: balance_sheet_df.to_excel(writer, sheet_name='Balance Sheet', index=True) # Include index if labels are part of it cash_flow_df.to_excel(writer, sheet_name='Cash Flow Statement', index=True) income_statement_df.to_excel(writer, sheet_name='Income Statement', index=True)

print(f"NOW 10-Q Financials with labels have been saved to {output_file}"

If there is another code I should be using or if you can provide an enhancement so I can get this fixed I would greatly appreciate it. @pierotofy @dgunning

dgunning commented 3 days ago

I see the issue. Investigating

david08-08 commented 2 days ago

Hi Dwight, thank you. Please let me know as soon as you can. I appreciate your help. @dgunning