Public accessor on XBRL for standard-concept metadata (ASC references, definition, balance, period type)
Feature Category
- [x] 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.
The metadata that says what a standard (us-gaap) concept is has no home on the XBRL object: its FASB Accounting Standards Codification (ASC) references (for example ASC 230-10-45-28), its definition text, its balance, and its period type. The SEC computes the first three for every filing and ships them as MetaLinks.json; EdgarTools already parses that file (edgar/sgml/metalinks.py: MetaLinks, TagDefinition, AuthRef). Today the ASC references have exactly one public route, through the SEC-viewer object, and that route is built for a different job. The definition text has a second route through Company Facts.
For one concept, us-gaap_IncreaseDecreaseInContractWithCustomerLiability in Oracle's 10-Q for the period ended 2026-08-31 (accession 0001193125-26-389274), this is what each surface returns on EdgarTools 5.60.0:
| Surface | Definition text | ASC references | Balance | Period type |
|---|---|---|---|---|
filing.viewer._metalinks.get_tag(...) (private attribute) |
yes | yes (2) | debit |
not in the file |
filing.viewer.concepts[...] (public, documented in docs/guides/sec-viewer-guide.md) |
yes | yes (2) | debit |
no attribute |
FinancialFact.business_context (Company Facts, Company.get_facts()) |
yes (the SEC's description; the label or a canned sentence when the description is not longer than the label) | no | no field | per fact |
Statement.to_dataframe() row |
no | no | NaN |
not a column |
So the capability exists, but the object that statements, facts and the element catalog hang from cannot answer "what is this concept?". A caller who is holding an XBRL object and a statement row has to go back to the Filing, build a second object through the SEC-viewer path, and translate between the two spellings of the same concept id. The details that make that awkward:
- The viewer path needs a different object and a different input.
filing.viewer.conceptsbuilds aConceptGraphby parsing every R-file report (59 here; 0.7 to 1.1 s on a warm cache) before it will answer a lookup, it needs the SGML bundle plusMetaLinks.json(filing.viewerisNonewithout them), and it only accepts the underscore spelling:viewer.concepts["us-gaap:IncreaseDecreaseInContractWithCustomerLiability"]returnsNone.Concepthas no period type. The guide presents this path as "what the SEC displays", not as element metadata for the parsed XBRL. - The statement DataFrame only partly fills the gap.
balance,weightandpreferred_signareNaNfor this row, although the SEC metadata saysdebit; other rows, such asus-gaap_Assets, do carrydebit. The concept is presented and calculated in the filing but has no fact in this quarter (xbrl.facts.query().by_concept(...)returns nothing), so a value cannot be derived from facts either. - Company Facts carries the definition, not the references.
FinancialFact.business_contextholds the SEC's concept description when it is longer than the label, and otherwise the label or a canned sentence such as "Total revenue generated from operations" (_generate_business_contextinedgar/entity/parser.py), so it cannot be treated as definition text without checking. It has no ASC references and no balance, and it belongs to the company-wideEntityFacts, not to the filing'sXBRL. AuthRefis not exported fromedgar.sgml(onlyMetaLinksandTagDefinitionare), althoughConcept.auth_referencesreturnsAuthRefobjects.
This is not a regression or a violation of a documented contract. No current public XBRL field promises this metadata. It is a capability that exists internally and is only partly and indirectly surfaced.
Who would benefit from this feature?
- [ ] 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
Add a small, read-only, additive accessor on XBRL that returns the element metadata for a concept, accepting either spelling (us-gaap:X or us-gaap_X). Exact naming and shape are left to the maintainer; one sketch:
meta = xbrl.element_metadata("us-gaap:IncreaseDecreaseInContractWithCustomerLiability")
meta.concept # 'us-gaap_IncreaseDecreaseInContractWithCustomerLiability'
meta.is_standard # True
meta.data_type # 'monetaryItemType'
meta.balance # 'debit' (None when the source does not say)
meta.period_type # 'duration' (None when the source cannot say, never a default)
meta.documentation # 'Amount of increase (decrease) in obligation to transfer good or service ...'
meta.references # [AuthRef(topic='912', sub_topic='310', section='45', paragraph='11', uri=...),
# AuthRef(topic='230', sub_topic='10', section='45', paragraph='28', uri=...)]
Behavior I would expect:
Nonefor an unknown concept, andNonefields (not defaults) whenMetaLinks.jsonis not available for the filing, so the call is safe to use across old filings and locally builtXBRLobjects.- Extension concepts return their balance, type and documentation label as the filer wrote them, and an empty
referenceslist (the SEC file listed no references for any extension concept in the filings I checked). period_typeis secondary.MetaLinks.jsoncarries no period type (the raw keys for the tag areauth_ref,calculation,crdr,lang,localname,nsuri,presentation,xbrltype), so a first increment can leave it out, or fill it from the filing's own facts when any exist. The important property is that it isNonewhen unknown.
Describe alternatives you've considered
filing.viewer._metalinks.get_tag(...). It returns everything needed except period type and works today, which is why it can be demonstrated. It is a private attribute on a class whose layout can change without notice.filing.viewer.concepts[...]. Public and documented, and it gives definition text, balance and references. It is a separate object from theXBRLthe statements come from, it parses every R-file before the first lookup, it needs the SGML bundle, its tag-id lookup only takes the underscore spelling, and it has no period type. Fine for looking up one concept by hand; awkward for classifying every row of every statement across many filings.FinancialFact.business_contextfrom Company Facts. It gives definition text for most concepts, but it is a different data source (company-wide, not per filing), it falls back to the label or canned text, and it has no ASC references or balance.- Parsing the taxonomy (the
us-gaapschema plus its reference and label linkbases). That duplicates what the SEC already computed per filing inMetaLinks.json, and the filer's own submission does not contain the standard references. standard_concept/ the standardization store. It answers "which family does this tag belong to" (for exampleChangeInDeferredRevenue), not "which ASC paragraph and definition apply". It is useful but a different question, and it is keyed on the concept id with no per-filing evidence.
Use Case Example
How would you use this feature?
Classifying the economic role of each line in a 10-K or 10-Q (for example whether a cash-flow line is an investing flow, a financing flow or an operating adjustment) from what the standard concept is, instead of from its caption or its name. A caption is the filer's wording; the ASC reference and the definition are the taxonomy's.
# Illustrative additive API; exact naming is left to the maintainer.
for _, row in xbrl.statements.cash_flow_statement().to_dataframe().iterrows():
meta = xbrl.element_metadata(row["concept"])
if meta is None or not meta.references:
continue # extension concept or no metadata: handle separately
paragraphs = {(r.topic, r.sub_topic, r.section, r.paragraph) for r in meta.references}
if ("230", "10", "45", "13") in paragraphs: # cash outflows from investing activities
...
The reproduction below runs on EdgarTools 5.60.0 (it needs a SEC identity, which set_identity supplies):
import platform
import sys
import time
import edgar
from edgar import Company, get_by_accession_number, set_identity
set_identity("Your Name [email protected]")
print("edgartools", edgar.__version__, "| Python", sys.version.split()[0], "|", platform.platform())
filing = get_by_accession_number("0001193125-26-389274") # Oracle 10-Q, period ended 2026-08-31
xbrl = filing.xbrl()
TAG = "us-gaap_IncreaseDecreaseInContractWithCustomerLiability"
# 1. The public viewer path: filing.viewer.concepts[...]
t0 = time.time()
graph = filing.viewer.concepts
print(f"\nviewer.concepts : {time.time() - t0:.1f}s ({graph.report_count} R-file reports parsed)")
c = graph[TAG]
print("viewer Concept :", c.id)
print(" crdr :", c.crdr)
print(" documentation :", c.documentation)
print(" auth_references :", [f"{r.name} {r.topic}-{r.sub_topic}-{r.section}-{r.paragraph}" for r in c.auth_references])
print(" has period_type :", hasattr(c, "period_type"))
print(" by QName spelling :", graph["us-gaap:IncreaseDecreaseInContractWithCustomerLiability"])
print(" XBRL has a link to the viewer:", any("viewer" in n or "metalinks" in n for n in dir(xbrl) if not n.startswith("_")))
# 2. The statement row for the same concept
row = xbrl.statements.cash_flow_statement().to_dataframe().query("concept == @TAG").iloc[0]
print("\nstatement row :", {"balance": row["balance"], "weight": row["weight"], "preferred_sign": row["preferred_sign"]})
print("facts in this filing :", len(xbrl.facts.query().by_concept("IncreaseDecreaseInContractWithCustomerLiability").to_dataframe()))
# 3. Company Facts: the only other public place the definition text appears
fact = Company("ORCL").get_facts().query().by_concept("us-gaap:IncreaseDecreaseInContractWithCustomerLiability", exact=True).latest(1)[0]
print("\nFinancialFact.business_context:", fact.business_context[:70] + "...")
print(" attributes matching reference/auth:", [n for n in dir(fact) if n.startswith(("auth", "reference", "asc"))])
# 4. The private path
tag = filing.viewer._metalinks.get_tag(TAG)
print("\nprivate _metalinks :", tag.crdr, "|", tag.documentation[:60] + "...", "|", len(tag.auth_ref_ids), "references")
Actual output:
edgartools 5.60.0 | Python 3.14.4 | Windows-11-10.0.26200-SP0
viewer.concepts : 0.7s (59 R-file reports parsed)
viewer Concept : us-gaap_IncreaseDecreaseInContractWithCustomerLiability
crdr : debit
documentation : Amount of increase (decrease) in obligation to transfer good or service to customer for which consideration has been received or is receivable.
auth_references : ['Accounting Standards Codification 912-310-45-11', 'Accounting Standards Codification 230-10-45-28']
has period_type : False
by QName spelling : None
XBRL has a link to the viewer: False
statement row : {'balance': nan, 'weight': np.float64(nan), 'preferred_sign': np.float64(nan)}
facts in this filing : 0
FinancialFact.business_context: Amount of increase (decrease) in obligation to transfer good or servic...
attributes matching reference/auth: []
private _metalinks : debit | Amount of increase (decrease) in obligation to transfer good... | 2 references
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 parsing and the data classes already exist and are tested (MetaLinks.parse, TagDefinition, AuthRef, tests/sgml/test_metalinks.py). The new work is the wiring and the contract:
XBRL.from_filing()has the filing in scope, andMetaLinks.jsonis a sibling document in the same submission (filing.sgml().get_content('MetaLinks.json'), which is howFilingViewer.from_filingalready reads it). A lazy, cached load on first call would keepfiling.xbrl()as fast as it is now.- Define what is returned when the file is missing (
Nonefields) and which spelling is canonical in the return value. ExportingAuthReffromedgar.sgmlwould make the return type importable.
Additional Context
Environment: EdgarTools 5.60.0 (source checkout of main at b50b38b4, v5.60.0-6), Python 3.14.4, Windows 11. The six commits after the 5.60.0 tag do not touch edgar/xbrl (which includes the viewer), edgar/sgml or edgar/entity.
Filing: Oracle Corporation (ORCL), Form 10-Q, period ended 2026-08-31, accession 0001193125-26-389274.
Why it matters for 10-K and 10-Q classification. Standard concepts are where the taxonomy states, in machine-readable form, what a line is. Extension concepts carry only what the filer wrote (a balance, a type, a calculation parent), and their references were empty in every filing I checked, so the standard-concept metadata is also what an extension line has to be compared against. Reading it from the taxonomy avoids matching on captions or concept names, which differ by filer and by year. As a measure of how much signal there is, in the latest 10-Q or 10-K of five large issuers (ORCL, INTU, AMZN, MSFT, SNPS) the cash-flow statements hold 168 standard line concepts (counted once per filing). Of these, 166 carry at least one ASC reference, and 132 cite ASC 230-10-45-12, 13, 14, 15 or 28 (investing and financing inflows and outflows, and the operating reconciliation items). For the 114 of those 132 that sit under an operating, investing or financing total in the calculation linkbase, none of the references disagrees with that total. The definition text and the references are what make those lines classifiable without reading the label, and today a caller can reach them only by going around the XBRL object.
Searches of the open and closed GitHub tracker for "metalinks", "MetaLinks.json", "_metalinks", "auth_ref", "ASC reference", "authoritative references", "element documentation", "documentation label", "references definition label" and "element_metadata" found no matching issue. A source search at the commit above found no public path from XBRL, Filing (other than Filing.viewer), ElementCatalog or Statement to the ASC references of a standard concept. Its definition text is public only through the viewer and through Company Facts' business_context.
Related Issues/Features:
- #1425: the related data-quality issue, filed separately.
xbrl.element_catalog[...]returns placeholder metadata for standard concepts (data_type '',balance None,period_typealways'duration'). - #1255: asks the catalog to expose Extensible Enumerations metadata for extension elements. Same theme (element-level metadata that is parsed or available but not on the public catalog), different content; no overlap.
- #766 (closed): asked for extension concepts' labels and calculation parents to be read from the filer's own linkbases. That concerns extension elements; this request concerns standard elements, whose metadata is not in the filer's linkbases.
- #1422: asks
MappingResultto expose fields that are currently only in a private index. The same pattern, applied to the standardization store.
Feature requests are evaluated based on EdgarTools' core principles: Simple yet powerful, accurate financials, beginner-friendly, and joyful UX.
@dgunning, here is our current thinking on the root cause, proposed behavior, and coordination with other issues.
Root Cause:
XBRL has no public concept-metadata accessor even though schema and MetaLinks parsing already supply some of that information. MetaLinks does not supply abstract or period-type declarations, so imported-taxonomy coverage remains limited.
Proposed Behavior:
Add a lazy, read-only XBRL.element_metadata() accessor over available schema and MetaLinks sources without constructing the viewer. Preserve namespace/version identity and distinguish sourced fields, absent fields, unavailable evidence and conflicts. Return an explicit unavailable result when coverage prevents a completed lookup; reserve None for a completed negative lookup in the searched sources. Keep existing statement and fact behavior intact, and distinguish observed period type from a schema declaration.
Coordination:
Agree provenance vocabulary with #1728 and #1730, then keep access, balance and abstract changes in separate PRs. Closed #1680 remains a fact-lookup control, and this accessor does not resolve missing imported declarations.
Below, please find the full design document. Please let me know your thoughts.
Brian
Attachment: design-public.md, Proposal: source-aware concept metadata on XBRL — #1426.
AI assistance: Codex; GPT-6.1 Sol (High) performed current-main scouting, retained-fixture checks and final writing; GPT-6 Astra (Max) developed the architecture; a separate GPT-6 Astra (Max) reviewed financial source fidelity and the design, including the unavailable-versus-not-found correction.