AlterLab-Academic-Skills alterlab-edgartools
Part of the AlterLab Academic Skills suite. Python library for accessing, analyzing, and extracting data from SEC EDGAR filings. Use when working with SEC filings, financial statements (income statement, balance sheet, cash flow), XBRL financial data, insider trading (Form 4), institutional holdings (13F), company financials, annual/quarterly reports (10-K, 10-Q), proxy statements (DEF 14A), 8-K current events, company screening by ticker/CIK/industry, multi-period financial analysis, or any SEC regulatory filings.
git clone https://github.com/AlterLab-IEU/AlterLab-Academic-Skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/AlterLab-IEU/AlterLab-Academic-Skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/finance-economics/alterlab-edgartools" ~/.claude/skills/alterlab-ieu-alterlab-academic-skills-alterlab-edgartools && rm -rf "$T"
skills/finance-economics/alterlab-edgartools/SKILL.mdedgartools — SEC EDGAR Data
Python library for accessing all SEC filings since 1994 with structured data extraction.
Authentication (Required)
The SEC requires identification for API access. Always set identity before any operations:
from edgar import set_identity set_identity("Your Name your.email@example.com")
Set via environment variable to avoid hardcoding:
EDGAR_IDENTITY="Your Name your@email.com".
Installation
uv pip install edgartools # For AI/MCP features: uv pip install "edgartools[ai]"
Core Workflow
Find a Company
from edgar import Company, find company = Company("AAPL") # by ticker company = Company(320193) # by CIK (fastest) results = find("Apple") # by name search
Get Filings
# Company filings filings = company.get_filings(form="10-K") filing = filings.latest() # Global search across all filings from edgar import get_filings filings = get_filings(2024, 1, form="10-K") # By accession number from edgar import get_by_accession_number filing = get_by_accession_number("0000320193-23-000106")
Extract Structured Data
# Form-specific object (most common approach) tenk = filing.obj() # Returns TenK, EightK, Form4, ThirteenF, etc. # Financial statements (10-K/10-Q) financials = company.get_financials() # annual financials = company.get_quarterly_financials() # quarterly income = financials.income_statement() balance = financials.balance_sheet() cashflow = financials.cashflow_statement() # XBRL data xbrl = filing.xbrl() income = xbrl.statements.income_statement()
Access Filing Content
text = filing.text() # plain text html = filing.html() # HTML md = filing.markdown() # markdown (good for LLM processing) filing.open() # open in browser
Key Company Properties
company.name # "Apple Inc." company.cik # 320193 company.ticker # "AAPL" company.industry # "ELECTRONIC COMPUTERS" company.sic # "3571" company.shares_outstanding # 15115785000.0 company.public_float # 2899948348000.0 company.fiscal_year_end # "0930" company.exchange # "Nasdaq"
Form → Object Mapping
| Form | Object | Key Properties |
|---|---|---|
| 10-K | TenK | , , |
| 10-Q | TenQ | , , |
| 8-K | EightK | , |
| Form 4 | Form4 | , |
| 13F-HR | ThirteenF | , |
| DEF 14A | ProxyStatement | , |
| SC 13D/G | Schedule13 | , |
| Form D | FormD | , |
Important:
filing.financials does NOT exist. Use filing.obj().financials.
Common Pitfalls
→ AttributeError; usefiling.financialsfiling.obj().financials
has noget_filings()
param; uselimit
or.head(n).latest(n)- Prefer
for multi-period analysis (amended filings may be incomplete)amendments=False - Always check for
before accessing optional dataNone
Reference Files
Load these when you need detailed information:
- companies.md — Finding companies, screening, batch lookups, Company API
- filings.md — Working with filings, attachments, exhibits, Filings collection API
- financial-data.md — Financial statements, convenience methods, DataFrame export, multi-period analysis
- xbrl.md — XBRL parsing, fact querying, multi-period stitching, standardization
- data-objects.md — All supported form types and their structured objects
- entity-facts.md — EntityFacts API, FactQuery, FinancialStatement, FinancialFact
- ai-integration.md — MCP server setup, Skills installation,
and.docs
properties.to_context()