edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

Add a filter for filer-defined XBRL tags

Open joshhheo opened this issue 2 weeks ago • 0 comments

Feature Category

  • [x] New API functionality

Problem Statement

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

When I inspect a 10-K, I’d like to see which reported facts use tags the company defined in its own XBRL taxonomy. EdgarTools preserves the original tag names, but filtering for filer-defined tags currently requires writing a predicate and determining which namespace belongs to the filer.

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

Add a built-in filter to the filing XBRL query API. The proposed by_extension() method would return facts whose concepts are defined in the filer’s extension taxonomy. It could be chained with existing filters, such as a date range.

Describe alternatives you've considered

The existing by_custom() method can take a user-written predicate. A built-in filter would let callers ask for filer-defined facts directly without having to look up the filing’s taxonomy namespaces themselves.

Use Case Example

The method name below is proposed.

from edgar import Company

filing = Company("AAPL").get_filings(form="10-K").latest()
xbrl = filing.xbrl()

extension_facts = xbrl.query().by_extension().to_dataframe()
print(extension_facts)

Implementation Considerations

Complexity Level

  • [x] Moderate (new functionality with existing patterns)

Use the namespace URI that identifies the concept’s taxonomy. The prefix used in the filing is an alias and can vary.

Backwards Compatibility

  • [x] This feature maintains backwards compatibility

The proposed method is an opt-in filter on the existing filing XBRL query API.

Additional Context

The SEC’s Company Facts API excludes filer-defined tags. The proposed filter would use the XBRL data already parsed from an individual filing.

Related Issues/Features

joshhheo avatar Nov 17 '26 01:11 joshhheo