Skip to main content

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

Project description

Stanford EDGAR Parser

Layout-faithful SEC filing parser used by the Stanford EDGAR Filings Dataset. It converts raw EDGAR TXT/HTML/SGML/XML submissions into Markdown or MultiMarkdown while preserving financial-table structure, indentation, links, inline formatting, and filing metadata where possible.

Install

From PyPI, after release:

pip install stanford-edgar-parser

Until then, install directly from GitHub:

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

For local development from a clone:

pip install -e .

Layout

  • runtime.py: backward-compatible re-export shim
  • orchestrator.py: local filing orchestration and final output cleanup
  • utils/: imports, tokenizer helpers, parse statistics, and shared setup
  • multimarkdown/: MultiMarkdown table conversion
  • parsers/html/: HTML preprocessing, table cleanup, parser, and postprocessing
  • parsers/ocr/: Mistral OCR key rotation, PDF/image OCR, and OCR utilities
  • parsers/plaintext/: plaintext and legacy text-form parsers
  • parsers/sgml/: SGML document-block utilities
  • parsers/xml/: XML filing-form parsers
  • sec_parser.py: compatibility shim for old python stanford_edgar_parser/sec_parser.py usage
  • __main__.py: python -m stanford_edgar_parser command-line entrypoint

The original implementation remains untouched at sec_parser/sec_parser.py. The equivalence tests in tests/parser_equivalence/ verify the split-module coverage and compare parser outputs bit-for-bit.

Usage

python -m stanford_edgar_parser path/to/filing.txt
python -m stanford_edgar_parser path/to/filing.txt --to_mmd
stanford-edgar-parser path/to/filing.txt --to_mmd
from stanford_edgar_parser import main_one, parse_html_filing

Agent Skill Install

Install bundled Codex and Claude skill files:

stanford-edgar-install-skill

Or from Python:

from stanford_edgar_parser.ai import install_skill

install_skill()

Use --overwrite if you want to replace an existing installed skill.

MCP

After package install, expose the parser as an MCP server with:

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

Before the PyPI release, use the GitHub package source:

[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/.

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.0.tar.gz (203.1 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.0-py3-none-any.whl (220.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stanford_edgar_parser-0.1.0.tar.gz
  • Upload date:
  • Size: 203.1 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.0.tar.gz
Algorithm Hash digest
SHA256 dbf843eb513cd85144a05fe9051a2918320a77d59dc538705917669c018ae28e
MD5 46300272393371da9ba864de98419d0f
BLAKE2b-256 7a509ddf24be32e12262f989c1d1f61dfe6a0ab83aee70e29710f6f21a9afeeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for stanford_edgar_parser-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for stanford_edgar_parser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bc0eea0c34641bf8467f28f8efea8ab72184faf52f3af82178603b8d683e67f
MD5 7b67c680dfab5b5fad73d6d205b952c5
BLAKE2b-256 515446947a4e59eaafd10e2ca7187f7bd966a32438c4452729e9b794ebcc1cca

See more details on using hashes here.

Provenance

The following attestation bundles were made for stanford_edgar_parser-0.1.0-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