Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1824.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**Quarterly financials can read untagged 6-K income tables.** A bounded recent-filing search skips monthly notices; TSM's earnings release supplies TWD 763,064 million net income. (GH #1824)
16 changes: 11 additions & 5 deletions docs/api/company.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,19 +393,25 @@ if financials:

### get_quarterly_financials()

Get financial statements from the latest 10-Q filing.
Read the latest 10-Q or search recent unamended 6-Ks for quarterly results.

```python
def get_quarterly_financials(self) -> Optional[Financials]
def get_quarterly_financials(self, *, max_6k_filings: int = 10) -> Financials | QuarterlyIncome | None
```

**Returns:** `Financials` object from latest quarterly report
XBRL returns `Financials`. An eligible HTML earnings exhibit returns
`QuarterlyIncome`, with income getters and an income table. The search
examines at most `max_6k_filings` filings from the last 183 days and returns
`None` if no supported quarterly result is available.

**Example:**
```python
from edgar import QuarterlyIncome

quarterly = company.get_quarterly_financials()
if quarterly:
q_income = quarterly.income_statement().to_dataframe()
if quarterly is not None:
income = quarterly if isinstance(quarterly, QuarterlyIncome) else quarterly.income_statement()
q_income = income.to_dataframe()
quarterly_revenue = quarterly.get_revenue()
```

Expand Down
31 changes: 26 additions & 5 deletions docs/guides/financial-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,37 @@ income = quarterly.income_statement()

### Foreign private issuers (6-K)

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.
When a company has no 10-Q, `get_quarterly_financials()` checks up to 10
unamended 6-Ks filed in the last 183 days, newest first. Each filing's XBRL
takes priority. An HTML earnings exhibit with identifiable quarterly columns
and explicit units can supply a `QuarterlyIncome` result. A monthly notice
alone cannot. The search limit can be set with `max_6k_filings`.

To get the quarter's figures, read the press release tables with `EarningsRelease`:
```python
from edgar import Company, Financials, QuarterlyIncome

quarterly = Company("TSM").get_quarterly_financials()
if isinstance(quarterly, QuarterlyIncome):
print(quarterly.get_net_income()) # Actual currency units
print(quarterly.to_dataframe(include_unit=True))
print(quarterly.source_url, quarterly.notes)
elif isinstance(quarterly, Financials):
print(quarterly.balance_sheet())
```

The income table preserves the exhibit's period labels. A `period_offset`
of 1 selects the next reported comparison column, which can be a year earlier.
`to_dataframe()` scales monetary amounts to currency units and leaves per-share
values as reported. Generic EPS has no inferred basic or diluted classification.
When no supported filing is found, the method returns `None`.

To inspect a particular historical release and read the amounts in their
original printed scale, use its accession:

```python
from edgar import Company, find
from edgar import find
from edgar.earnings import EarningsRelease

Company("TSM").get_quarterly_financials() # None: TSMC's 6-Ks carry no XBRL

filing = find("0001046179-26-000726") # TSMC's 3Q26 earnings release, filed 2026-10-15
release = EarningsRelease.from_filing(filing)
release.income_statement.dataframe
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/sixk-data-object-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ if six_k.financials:
financials.cash_flow_statement
```

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.
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.

---

Expand Down
15 changes: 15 additions & 0 deletions docs/upgrade/6.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ see [Getting help](6.0.md#getting-help).
| `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) |
| `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) |
| `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) |

### Quarterly financials

| Call | 6.4.0 | Now | Filing |
|---|---|---|---|
| `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) |
| `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) |

`QuarterlyIncome` holds only the income statement. Call `result.to_dataframe()`
to read it. Code that also needs a balance sheet or cash flow statement should
check `isinstance(result, Financials)` first. The method now looks at 6-Ks filed
in the last 183 days, at most `max_6k_filings` of them (10 by default), newest
first, and XBRL wins over HTML. To read an older 6-K, call
`edgar.earnings.EarningsRelease.from_filing(filing)` or `Financials.extract(filing)`
on it directly. See the [6-K example](../guides/financial-data.md#foreign-private-issuers-6-k).
3 changes: 2 additions & 1 deletion edgar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"get_entity", "get_icon_from_ticker",
),
"edgar.filesystem": ("is_cloud_storage_enabled", "sync_to_cloud", "use_cloud_storage"),
"edgar._html_financials": ("QuarterlyIncome",),
"edgar.financials": ("Financials", "MultiFinancials"),
"edgar.funds": ("Fund", "FundClass", "FundCompany", "FundSeries", "find_fund", "find_funds"),
"edgar.funds.ncen": ("NCEN_FORMS", "FundCensus"),
Expand Down Expand Up @@ -165,7 +166,7 @@
"ValidationError",

# -- Financial statements ------------------------------------------------
"Financials", "MultiFinancials", "XBRL",
"Financials", "MultiFinancials", "QuarterlyIncome", "XBRL",

# -- Funds ---------------------------------------------------------------
"Fund", "FundCompany", "FundClass", "FundSeries",
Expand Down
Loading