Feature request: Need a straightforward way to get current period only data for 10-K, 10-Q, including notes sections and xbrl tags
Perhaps I'm missing it in the vast api you've developed, but shouldn't there be a simple way to get current period numbers only, and not just standardized?
First, most people, I suspect, do not make use of the prior period comparative numbers since we can just process a previous 10-K.
Second, although standardization is nice, your standard buckets aren't my standard buckets, so getting the xbrl tags should be an option.
Finally, again I may be missing it, but I'd like the same for not just the standard statements but also the notes that follow the statements. There's usually a lot of good data in there, necessary for making adjustments for valuation purposes.
Looking through the code it seems like the elements for this should be present somewhere, but honestly it's hard to know where to start for an outsider. You've built quite a code base there.
Thank you for this excellent feature request! You've identified a really important gap in EdgarTools' current API. Many users do need straightforward access to current period data with raw XBRL tags, and the notes sections are indeed crucial for comprehensive financial analysis.
What You're Looking For
I understand you need three key things:
- Current period only data - without comparative periods since you can process previous 10-Ks separately
- Raw XBRL tags - access to the original concept names (like
us-gaap:Revenues) rather than standardized labels - Notes sections - structured access to the valuable supplementary information in notes to financial statements
Current Workarounds
While we work on a better solution, here are some ways to get closer to what you need with the current API:
Current Period Only
# Get the most recent period key
periods = xbrl.reporting_periods
current_period = periods[0]['key'] if periods else None
# Use it to filter statements
income_stmt = xbrl.render_statement('IncomeStatement',
period_filter=current_period,
standard=False) # This gives you original labels
Raw XBRL Concepts
# Access facts directly with original concept names
facts_df = xbrl.facts.query().to_dataframe()
# The 'concept' column contains the original XBRL tag names
# Or get raw statement data
raw_data = xbrl.get_statement('IncomeStatement')
# Each item has 'name' field with original concept name
Notes Sections
# List all available statements including notes
all_statements = xbrl.get_all_statements()
notes = [s for s in all_statements if s.get('type') == 'Notes' or 'note' in s.get('definition', '').lower()]
# Access specific notes section
for note in notes:
note_data = xbrl.get_statement(note['role'])
Planned Enhancement
I'm planning a comprehensive enhancement to address exactly these needs. The goal is to add a clean, intuitive API like:
# Simple current period access
current = xbrl.current_period
current.balance_sheet(raw_concepts=True)
current.income_statement(raw_concepts=True)
current.notes() # All notes sections
current.notes('inventory') # Specific note section
# Enhanced DataFrame output with both standardized and raw concept names
df = current.income_statement(raw_concepts=True)
# Would include columns for both 'label' and 'concept' (raw XBRL tag)
This would make EdgarTools much more accessible for your use case while preserving all the powerful features for advanced users.
Timeline
I'm prioritizing this enhancement and expect to have an initial implementation within the next few weeks. It will be additive (won't break existing code) and will make these common operations much simpler.
Would you be interested in testing the new API once it's ready? Your feedback would be invaluable for making sure it meets real-world needs.
Thanks again for the detailed feedback - it really helps prioritize development efforts!
Available in Release 4.11.0
I'm so glad you like the ideas. I tried the latest. As you've no doubt already seen income statement doesn't yet present anything and cash flow is still underpopulated. But I'll keep my on this space.... If this works, I'll have to toss about 2 years worth of work I've done on a similar project (with MUCH smaller ambition than you have). I'm using the monthly files the SEC produces, which have their own problems. Something else you might want to consider (lower priority) is making the standardization user definable. That is to say, let a user provide a json or csv with mapping. I've mapped a few thousand tags (by hand!!) to my favorite standard tags. But for now, if your api gives me xbrl I can map after the fact.