edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

Clarify and bridge XBRL-only Notes and disclosure role routing

Open synfonia-llc opened this issue 3 months ago • 1 comments

Feature Category

  • [ ] New API functionality
  • [ ] Performance improvement
  • [x] Developer experience improvement
  • [ ] Documentation enhancement
  • [ ] Tool/utility addition

Problem Statement

Is your feature request related to a problem? Please describe.

EdgarTools 5.53.0 exposes two intentionally separate statement categories through XBRL.notes() and XBRL.disclosures(). The distinction is not obvious to a caller looking for financial-statement note narrative:

  • xbrl.notes() filters statements whose statement category is note;
  • xbrl.disclosures() filters statements whose category is disclosure; and
  • Statement.is_note is a separate content signal indicating that the statement's raw data contains a TextBlock. It is not the statement-category classifier.

Notes.from_xbrl(xbrl) uses the XBRL Notes-category route when no FilingSummary hierarchy is supplied. A caller can therefore receive a small Notes collection even though many disclosure-category statements on the same XBRL object contain note narrative and report is_note=True.

The result is an easy-to-miss retrieval gap for XBRL-only workflows. An empty or narrow Notes collection can be misread as a filing-content absence unless the caller already knows to inventory both categories.

Who would benefit from this feature?

  • [x] Beginner Python users working with SEC filings
  • [x] Financial analysts and researchers
  • [x] Advanced developers building financial applications
  • [x] Data scientists working with financial datasets

Proposed Solution

Describe the solution you'd like

Please make the category boundary explicit and provide an opt-in unified retrieval route. For example:

notes = Notes.from_xbrl(xbrl, include_disclosures=True)

or:

statements = xbrl.statements.note_content(
    categories=("note", "disclosure"),
    require_text_block=True,
)

The exact API name is less important than these behaviors:

  • document note and disclosure as statement categories;
  • document Statement.is_note as a TextBlock/content test rather than category identity;
  • preserve each returned statement's original category and role;
  • let XBRL-only callers deliberately include narrative-bearing disclosure roles; and
  • keep the existing narrow methods unchanged for backwards compatibility.

Describe alternatives you've considered

Documentation alone could tell callers to concatenate and de-duplicate xbrl.notes() and selected xbrl.disclosures() results. A small opt-in helper would be harder to misuse and would give Notes.from_xbrl() an explicit way to include disclosure-category narrative without changing its default behavior.

Use Case Example

How would you use this feature?

from pathlib import Path

from edgar.xbrl import XBRL
from edgar.xbrl.notes import Notes

# Run from a directory containing the unpacked accession package.
xbrl = XBRL.from_directory(
    Path("0000950170-23-047713") / "xbrl"
)

notes = xbrl.notes()
disclosures = xbrl.disclosures()
collection = Notes.from_xbrl(xbrl)
income_tax = xbrl.get_table("income taxes")

print("Notes-category statements:", len(notes))
print("Disclosure-category statements:", len(disclosures))
print(
    "Disclosure statements containing TextBlocks:",
    sum(statement.is_note for statement in disclosures),
)
print("XBRL-only Notes collection:", len(collection))
print("Notes search for tax:", len(collection.search("tax")))
print(
    "Income-tax role:",
    income_tax.role_or_type.rsplit("/", 1)[-1],
)
print("Income-tax text length:", len(income_tax.text() or ""))

Observed output for Oracle accession 0000950170-23-047713:

Notes-category statements: 4
Disclosure-category statements: 45
Disclosure statements containing TextBlocks: 21
XBRL-only Notes collection: 4
Notes search for tax: 0
Income-tax role: Role_DisclosureINCOMETAXES
Income-tax text length: 3945

An opt-in unified route would let the caller search that narrative without conflating the two underlying statement categories.

Implementation Considerations

Complexity Level:

  • [ ] Simple (minor API addition)
  • [x] Moderate (new functionality with existing patterns)
  • [ ] Complex (significant architectural changes)

Backwards Compatibility:

  • [x] This feature maintains backwards compatibility
  • [ ] This feature might break existing code (please explain below)
  • [ ] Unsure about compatibility impact

The current narrow methods can remain unchanged. The new behavior can be additive and can reuse the existing statement inventory and TextBlock test.

The pinned implementation shows the distinct category filters in the statement collection, the notes() accessor, and the TextBlock-based Statement.is_note property.

Additional Context

This was reproduced with EdgarTools 5.53.0, CPython 3.14.4, and a locally cached Oracle 10-Q, accession 0000950170-23-047713.

The 4 Notes-category roles and 45 disclosure-category roles were disjoint in this filing. Of the 45 disclosures, 20 returned non-null narrative text. The same object directly retrieved Income Taxes, Acquisitions, Intangible Assets and Goodwill, Restructuring Activities, and Segment Information narrative.

This request is deliberately limited to XBRL-only retrieval. It does not test CompanyReport.notes, which can use a FilingSummary, and it does not claim that Oracle omitted any disclosure. It asks for a clearer and more discoverable bridge between two existing public categories.

Related Issues/Features:

  • #635 reports missing values in disclosure DataFrames. This request concerns discoverability and routing between Notes and disclosure categories while the content remains retrievable.
  • #1169 concerns XBRL fact-footnote locator resolution. Financial-statement Notes and fact footnotes are different systems.

A bounded search of open and closed issues for XBRL.notes disclosures on August 31, 2026 did not identify an exact match. Please recheck before submission.


Feature requests are evaluated based on EdgarTools' core principles: Simple yet powerful, accurate financials, beginner-friendly, and joyful UX.

synfonia-llc avatar Aug 31 '26 15:08 synfonia-llc

The distinction you're drawing is real, and your example shows it clearly: 4 Notes-category statements vs. 45 disclosure-category statements, 21 of which contain TextBlocks. A caller searching collection.search("tax") gets zero hits on an Oracle 10-Q that has 3,945 characters of income-tax narrative. That's a retrieval gap, not a content gap, and it's exactly the kind of thing that's invisible until someone hits it.

On the proposed API, one design point worth settling before implementation:

is_note is the wrong name for the content test. You're already using it correctly in the issue, but the existing property couples two ideas: "this statement contains a TextBlock" and "this statement is narrative-bearing". Those aren't the same thing. A disclosure statement can contain a TextBlock without being note content (some Schedules are tagged with TextBlock roles but are tabular, not narrative). If the new opt-in route leans on is_note, it inherits that ambiguity.

Something like has_narrative_text or contains_text_block would be more honest, and it would let the new note_content() filter on categories explicitly rather than through a proxy.

On backwards compatibility: the additive approach is right. include_disclosures=False by default keeps existing callers unchanged, and a new method on xbrl.statements gives power users a category-agnostic path without touching the narrow accessors.

On the use case you described: the fact that Notes-category and disclosure-category roles were fully disjoint in that Oracle filing is worth flagging. It means a naive "concatenate both" approach won't double-count anything in that specific filing, but it might in others. Worth documenting the de-duplication rule (by role URI, presumably) rather than by statement title.

One question for the maintainers: is the category taxonomy (note vs. disclosure) actually a property of the filing's presentation linkbase, or is it EdgarTools' classification? If it's EdgarTools', then the boundary is a design choice and the fix is straightforward. If it's the filer's, then any unified route has to be tolerant of filings that don't respect it.

DOMCHURCH avatar Sep 12 '26 22:09 DOMCHURCH