Skip to main content

Structured financial data from SEC EDGAR filings — 10-Q, 10-K, and 8-K

Project description

edgar-parser

Structured financial data from SEC EDGAR filings.

Give your Python application access to income statements, balance sheets, cash flows, and qualitative sections from 10-Q, 10-K, and 8-K filings — parsed directly from SEC EDGAR with no third-party data vendor required.

This isn't a raw EDGAR scraper. The library handles XBRL namespace resolution, fiscal period matching, current vs. prior period alignment, sign normalization, and fuzzy metric lookup — so you get clean, analysis-ready data.

What it does

Core Extraction (parse_filing)

  • Parses iXBRL facts from 10-Q and 10-K filings on SEC EDGAR
  • Resolves XBRL namespaces, units, scales, and dimensional qualifiers
  • Enriches facts with presentation roles and negated-label sign flipping

Period Matching (match_filing)

  • Aligns current and prior period values for each financial line item
  • Handles quarterly, full-year, and 4Q (derived annual) modes
  • Zip-matching with adaptive fallback to fuzzy matching for edge cases

8-K Earnings Extraction (earnings_8k) — optional, requires anthropic

  • Extracts financial data from 8-K earnings press releases using Claude
  • Automatic fallback when 10-Q/10-K is not yet available for a period
  • Same output schema as core extraction for seamless integration

Filing Sections (section_parser)

  • Parses qualitative sections from 10-K/10-Q filings (Risk Factors, MD&A, Business, etc.)
  • Summary and full-text modes with configurable word limits

High-Level Tools (tools)

  • get_financials(ticker, year, quarter) — all facts for a filing period
  • get_filings(ticker, year, quarter) — list available filings (10-Q, 10-K, 8-K)
  • get_metric(ticker, year, quarter, metric_name) — single metric lookup with fuzzy matching
  • get_filing_sections(ticker, year, quarter) — qualitative section text

Install

pip install edgar-parser

For 8-K earnings extraction (uses Claude API):

pip install "edgar-parser[llm]"

Quick start

from edgar_parser.tools import get_financials, get_metric

# Get all financial facts from Apple's Q1 2025 10-Q
result = get_financials("AAPL", 2025, 1)
for fact in result["facts"][:5]:
    print(f"{fact['metric']}: {fact['current_value']}")

# Look up a single metric
revenue = get_metric("AAPL", 2025, 1, "Revenue")
print(f"Revenue: {revenue['value']} {revenue['unit']}")

Or use the lower-level API for more control:

from edgar_parser import parse_filing, match_filing

# Parse raw XBRL facts
parsed = parse_filing("AAPL", 2025, 1, full_year_mode=False)

# Match current vs. prior periods
matched = match_filing(parsed)
print(matched.head())

Key functions

Function Module Description
get_financials tools All facts for a ticker/period, with caching
get_filings tools List SEC filings (10-Q, 10-K, 8-K) for a period
get_metric tools Single metric lookup with fuzzy matching
get_filing_sections tools Qualitative section text (Risk Factors, MD&A, etc.)
parse_filing pipeline Low-level XBRL fact extraction
enrich_filing pipeline Fiscal period categorization and enrichment
match_filing matching Current vs. prior period alignment
find_8k_for_period earnings_8k Find 8-K earnings release for a fiscal period

Requirements

  • Python 3.10+
  • No API key needed — data comes directly from SEC EDGAR (public)
  • Optional: ANTHROPIC_API_KEY environment variable for 8-K extraction

See also

  • edgar-mcp — MCP server that exposes EDGAR financial data as AI agent tools. If you're building with Claude Code or another MCP-compatible agent, use this instead.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edgar_parser-0.2.0.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edgar_parser-0.2.0-py3-none-any.whl (67.7 kB view details)

Uploaded Python 3

File details

Details for the file edgar_parser-0.2.0.tar.gz.

File metadata

  • Download URL: edgar_parser-0.2.0.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for edgar_parser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 44e005cdcc656907fc7bd8c029b808d8247e4edd140f2d559d3fd5dddd7dd294
MD5 2d7e28d8784673cf0bf616ec864921fa
BLAKE2b-256 d28560c1eb6f85d8775cd845d7fe5ab6ddb0653ac31c8ca85e0fac364a991c4e

See more details on using hashes here.

File details

Details for the file edgar_parser-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: edgar_parser-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 67.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for edgar_parser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88bc6b854ab1e7d97b27b852ef702157672ac392885d10145013ac40fdcdbd2a
MD5 20268dafaec06db705a3862413a43775
BLAKE2b-256 5dc3764365b7a9bfaaf9346a67681df60c86004009fd9950d96b4dee410caefa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page