You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b3911ee
Browse filesBrowse the repository at this point in the historyBrowse files
* feat: add bounded HTML income fallback for quarterly 6-Ks
Reuse EX-99 earnings tables when recent 6-Ks have no XBRL. Keep quarterly amounts separate from change columns and retain reporting currency, scale, source and caveats.
Verify TSM 0001046179-26-000726: net income TWD 763,064 million and reported EPS NT$29.43. Preserve the 10-Q and XBRL paths.
Fixes#1824
* fix(financials): align HTML DataFrame fields and parameters
* refactor(financials): simplify 6-K income extraction
* fix(6-K): add include_metadata to QuarterlyIncome; move upgrade note to 6.5
#2035 added include_metadata to Statement.to_dataframe(), so the
signature-parity test failed once main was merged. QuarterlyIncome now
takes it and drops the same five columns Statement does.
6.4.0 has shipped, so the upgrade note moves from 6.1.md to the current
6.5 guide. It now also records the 183-day cutoff: a 6-K filer whose latest
XBRL 6-K is older than that got Financials in 6.4 and gets None now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Dwight Gunning <dgunning@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/guides/financial-data.md
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,16 +141,37 @@ income = quarterly.income_statement()
141
141
142
142
### Foreign private issuers (6-K)
143
143
144
-
A foreign private issuer such as TSMC files its annual report on Form 20-F with XBRL, so `get_financials()` works as usual. Its quarterly results arrive on Form 6-K, where the numbers sit in an HTML press release (an EX-99 exhibit) with no XBRL behind it. For those companies `get_quarterly_financials()` returns `None`, because there are no statements to read.
144
+
When a company has no 10-Q, `get_quarterly_financials()` checks up to 10
145
+
unamended 6-Ks filed in the last 183 days, newest first. Each filing's XBRL
146
+
takes priority. An HTML earnings exhibit with identifiable quarterly columns
147
+
and explicit units can supply a `QuarterlyIncome` result. A monthly notice
148
+
alone cannot. The search limit can be set with `max_6k_filings`.
145
149
146
-
To get the quarter's figures, read the press release tables with `EarningsRelease`:
150
+
```python
151
+
from edgar import Company, Financials, QuarterlyIncome
Copy file name to clipboardExpand all lines: docs/guides/sixk-data-object-guide.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,7 +151,7 @@ if six_k.financials:
151
151
financials.cash_flow_statement
152
152
```
153
153
154
-
Most earnings data in 6-K filings is in HTML tables inside EX-99.x exhibits, not in XBRL. To read those tables, use `EarningsRelease.from_filing(filing)` from `edgar.earnings`, which returns the press release's income statement and other tables as DataFrames. This is also why `Company.get_quarterly_financials()`returns `None`for most foreign private issuers.
154
+
Most earnings data in 6-K filings is in HTML tables inside EX-99.x exhibits, not in XBRL. To read those tables, use `EarningsRelease.from_filing(filing)` from `edgar.earnings`, which returns the press release's income statement and other tables as DataFrames. For the latest quarterly result, `Company.get_quarterly_financials()`also checks recent 6-K earnings exhibits for an income table. See [Financial data](financial-data.md#foreign-private-issuers-6-k) for its return types.
Copy file name to clipboardExpand all lines: docs/upgrade/6.5.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,3 +17,18 @@ see [Getting help](6.0.md#getting-help).
17
17
|`xbrl.current_period.statement_of_equity()`| filtered to the period-end instant: the opening balance showed the closing one, and no flow rows (net income, dividends, buybacks) | the fiscal year's duration (the quarter in a 10-Q), with the opening balance from the prior period end | Apple FY2023 10-K 0000320193-23-000106: opening equity $62,146M → $50,672M; 8 rows → 24 (GH #429) |
18
18
|`xbrl.current_period.cash_flow_statement()` on a 10-Q | the three-month duration | the year-to-date duration, as the 10-Q files it | Tesla Q2 2024 10-Q 0001628280-24-032662: 2 rows → 36 (GH #429) |
19
19
|`current_period` statements' `get_dataframe()` and `as_statement=False`: an instant balance row under a duration | left out | the balance the rendered table shows: the opening or closing instant | Apple FY2023 10-K 0000320193-23-000106: cash flow gains beginning cash $24,977M and ending cash $30,737M (GH #429) |
20
+
21
+
### Quarterly financials
22
+
23
+
| Call | 6.4.0 | Now | Filing |
24
+
|---|---|---|---|
25
+
|`Company(...).get_quarterly_financials()` for a 6-K filer whose recent 6-Ks carry no XBRL |`None`|`QuarterlyIncome`, the income table from the earnings exhibit | TSMC 6-K 0001046179-26-000726: `None` → net income NT$763,064 million (GH #1824) |
26
+
|`Company(...).get_quarterly_financials()` for a 6-K filer whose latest XBRL 6-K is more than 183 days old |`Financials` from that 6-K, however old |`None`| (GH #1824) |
27
+
28
+
`QuarterlyIncome` holds only the income statement. Call `result.to_dataframe()`
29
+
to read it. Code that also needs a balance sheet or cash flow statement should
30
+
check `isinstance(result, Financials)` first. The method now looks at 6-Ks filed
31
+
in the last 183 days, at most `max_6k_filings` of them (10 by default), newest
32
+
first, and XBRL wins over HTML. To read an older 6-K, call
33
+
`edgar.earnings.EarningsRelease.from_filing(filing)` or `Financials.extract(filing)`
34
+
on it directly. See the [6-K example](../guides/financial-data.md#foreign-private-issuers-6-k).
0 commit comments