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.
- Paper: The Stanford EDGAR Filings Dataset
- Dataset: SEFD-v1 on Hugging Face
Install
From PyPI:
pip install stanford-edgar-parser
Agent-friendly install alias:
pip install "stanford-edgar-parser[ai]"
Or directly from GitHub:
pip install "stanford-edgar-parser[ai] @ 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 Setup
The [ai] extra is an agent-facing install alias. It currently uses the same runtime dependencies as the base package, but gives agent clients a stable target compatible with package patterns such as edgartools[ai].
Codex
Install the Codex skill:
uvx --from "stanford-edgar-parser[ai]" stanford-edgar-install-skill --target codex --overwrite
Add the MCP server to ~/.codex/config.toml:
[mcp_servers.stanford_edgar_parser]
command = "uvx"
args = ["--from", "stanford-edgar-parser[ai]", "stanford-edgar-mcp"]
startup_timeout_sec = 120
For full repo-local render/review tools, point Codex at a clone instead:
[mcp_servers.stanford_edgar_parser]
command = "python"
args = ["-m", "stanford_edgar_parser.mcp_server"]
cwd = "/path/to/stanford-edgar-filings-dataset"
startup_timeout_sec = 120
Claude Code
Install the Claude skill:
uvx --from "stanford-edgar-parser[ai]" stanford-edgar-install-skill --target claude --overwrite
For project-local MCP, add this .mcp.json to your project or use the one included in this repository:
{
"mcpServers": {
"stanford-edgar-parser": {
"command": "uvx",
"args": ["--from", "stanford-edgar-parser[ai]", "stanford-edgar-mcp"]
}
}
}
For repo-local render/review tools, use a clone-backed .mcp.json:
{
"mcpServers": {
"stanford-edgar-parser": {
"command": "python",
"args": ["-m", "stanford_edgar_parser.mcp_server"],
"cwd": "/path/to/stanford-edgar-filings-dataset"
}
}
}
Claude Desktop
Add this to your Claude Desktop MCP config:
{
"mcpServers": {
"stanford-edgar-parser": {
"command": "uvx",
"args": ["--from", "stanford-edgar-parser[ai]", "stanford-edgar-mcp"]
}
}
}
Python Skill Installer
The same bundled skills can also be installed from Python:
from stanford_edgar_parser.ai import install_skill
install_skill(targets=("codex", "claude"), overwrite=True)
GitHub MCP Install
Use the GitHub source directly before a PyPI release:
[mcp_servers.stanford_edgar_parser]
command = "uvx"
args = [
"--from",
"stanford-edgar-parser[ai] @ git+https://github.com/Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset.git",
"stanford-edgar-mcp"
]
startup_timeout_sec = 120
Package-installed MCP always exposes parse_filing. Repo-local rendering and review tools are exposed when the server runs from a full clone containing multimarkdown.js, html-to-pdf.mjs, and tools/.
MCP Tools
The MCP server exposes:
parse_filing: parse local SEC submissions to Markdown or MultiMarkdownrender_markdown: render parsed Markdown to PDF when running from a full repo clonecheck_showcase_tables: run static table-integrity checks when running from a full repo clonereview_snippet: build raw-browser-vs-parsed review snippets when running from a full repo clone
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stanford_edgar_parser-0.1.2.tar.gz.
File metadata
- Download URL: stanford_edgar_parser-0.1.2.tar.gz
- Upload date:
- Size: 206.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09dac86febc838de5a959f6bc354780cb41f48c2fc4d9654fdf8b01abd43164f
|
|
| MD5 |
860d37e77834a549464179a1bd0925f9
|
|
| BLAKE2b-256 |
3822fab7639c73399b457e61533f6ede4b3e8a0ce2bf7394f3d1da2f8d8b385d
|
Provenance
The following attestation bundles were made for stanford_edgar_parser-0.1.2.tar.gz:
Publisher:
publish.yml on Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stanford_edgar_parser-0.1.2.tar.gz -
Subject digest:
09dac86febc838de5a959f6bc354780cb41f48c2fc4d9654fdf8b01abd43164f - Sigstore transparency entry: 1866992545
- Sigstore integration time:
-
Permalink:
Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset@704a8d13b5862b0b1efe55ab200911f3d015c057 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Stanford-Advanced-FinTech-Lab-SAFTL
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@704a8d13b5862b0b1efe55ab200911f3d015c057 -
Trigger Event:
push
-
Statement type:
File details
Details for the file stanford_edgar_parser-0.1.2-py3-none-any.whl.
File metadata
- Download URL: stanford_edgar_parser-0.1.2-py3-none-any.whl
- Upload date:
- Size: 221.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee312310577ce19e0781594a2a11f12af445e4eb67ed12d65360d0e6cbc4a71e
|
|
| MD5 |
003fa46bc9e3d4955d6cc216b6539971
|
|
| BLAKE2b-256 |
38ec84f7d89063e6693190bb8e9ad9078f80db69bd48e5bddb1103471097676d
|
Provenance
The following attestation bundles were made for stanford_edgar_parser-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stanford_edgar_parser-0.1.2-py3-none-any.whl -
Subject digest:
ee312310577ce19e0781594a2a11f12af445e4eb67ed12d65360d0e6cbc4a71e - Sigstore transparency entry: 1866992559
- Sigstore integration time:
-
Permalink:
Stanford-Advanced-FinTech-Lab-SAFTL/stanford-edgar-filings-dataset@704a8d13b5862b0b1efe55ab200911f3d015c057 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/Stanford-Advanced-FinTech-Lab-SAFTL
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@704a8d13b5862b0b1efe55ab200911f3d015c057 -
Trigger Event:
push
-
Statement type: