Skip to main content

Layout-faithful SEC EDGAR filing parser from the Stanford EDGAR Filings Dataset.

Project description

Stanford EDGAR Filings Dataset Parser

The Stanford EDGAR Filings Dataset (SEFD) is a 550B-token reconstruction of 18.5M SEC filings into layout-faithful MultiMarkdown for LLM pretraining, financial reasoning, document understanding, and evaluation.

SEFD reverse-engineers EDGAR's heterogeneous disclosure formats into a token-efficient representation that preserves financial tables, indentation, merged headers, numeric signs, currency and percent symbols, document hierarchy, and other layout cues that carry financial meaning. Internal validation shows our rule-based reconstruction methodology achieves greater than 99% structural and semantic accuracy on sampled outputs.

The software routes and parses the full EDGAR source-format surface, including legacy fixed-width text, tag-soup HTML, SGML wrappers, XML submissions, and PDF attachments, with specialized reconstruction for more than 30 SEC XML schemas, including Forms 3, 4, 5, D, 13D/G, N-PX, N-PORT, N-CEN, 13F, 144, ATS-N, 1-A/K/Z, C, MA, TA, X-17A-5, 24F-2NT, ABS-EE, and related amendments, withdrawals, and corrections. PDF attachments are parsed with Mistral OCR 3.

Our first public release, SEFD-v1, is a 152B-token dataset covering filings from January 2022 through June 2025.

Install

From PyPI:

pip install stanford-edgar-parser

Or directly from GitHub:

pip install "stanford-edgar-parser @ git+https://github.com/Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset.git"

Usage

Parse a local filing and convert tables to MultiMarkdown:

stanford-edgar-parser path/to/filing.txt --to_mmd

or:

python -m stanford_edgar_parser path/to/filing.txt --to_mmd

Optional rendering helpers:

node multimarkdown.js path/to/file.md > file.html
node html-to-pdf.mjs file.html file.pdf

Agent Skills

Install bundled Codex and Claude skills:

stanford-edgar-install-skill

or:

from stanford_edgar_parser.ai import install_skill

install_skill()

MCP

Package install:

[mcp_servers.stanford_edgar_parser]
command = "uvx"
args = ["--from", "stanford-edgar-parser", "stanford-edgar-mcp"]
startup_timeout_sec = 120

GitHub install:

[mcp_servers.stanford_edgar_parser]
command = "uvx"
args = [
  "--from",
  "stanford-edgar-parser @ git+https://github.com/Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset.git",
  "stanford-edgar-mcp"
]
startup_timeout_sec = 120

The package-installed MCP server always exposes parse_filing. Repo-local rendering and review tools are exposed when the full clone includes multimarkdown.js, html-to-pdf.mjs, and tools/.

Citation

@article{bettencourt2026stanfordedgar,
  title={The Stanford EDGAR Filings Dataset: Reconstructing U.S. Corporate and Financial Disclosures into Layout-Faithful and Token-Efficient Pretraining Data},
  author={Bettencourt, Nick and Ding, Xiaowei and Giesecke, Kay},
  journal={arXiv preprint arXiv:2606.18192},
  year={2026},
  url={https://arxiv.org/abs/2606.18192}
}

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

stanford_edgar_parser-0.1.1.tar.gz (204.4 kB view details)

Uploaded Source

Built Distribution

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

stanford_edgar_parser-0.1.1-py3-none-any.whl (220.9 kB view details)

Uploaded Python 3

File details

Details for the file stanford_edgar_parser-0.1.1.tar.gz.

File metadata

  • Download URL: stanford_edgar_parser-0.1.1.tar.gz
  • Upload date:
  • Size: 204.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for stanford_edgar_parser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3b7112c433d04947d70ca4fe92b8988f232a6aa4c52dbbd508f48262baea5c03
MD5 a2286aebf6fbfb6d0631318540abbb41
BLAKE2b-256 c489908c8ffd0484da3666df46bed5a4dd0348f08d55cc9efaca57bdf8ba7972

See more details on using hashes here.

Provenance

The following attestation bundles were made for stanford_edgar_parser-0.1.1.tar.gz:

Publisher: publish.yml on Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stanford_edgar_parser-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stanford_edgar_parser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5be377b1e94b91e0895179eaa7395436cf5506231dd59d8727e890d25eda6a3b
MD5 4e509496770454aef720637db4a9e643
BLAKE2b-256 df58d65f88d5ec0f299529305205faebe75f7cafce50af5a434fe2cc4548c217

See more details on using hashes here.

Provenance

The following attestation bundles were made for stanford_edgar_parser-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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