EdgarTools
效率与工作流编辑精选by dgunning
EdgarTools 是无需 API 密钥即可解析 SEC EDGAR 财报的开源 Python 库。
这个工具解决了金融数据获取的痛点——直接让 AI 读取结构化财报,比如让 Claude 分析苹果的 10-K 文件。适合量化分析师或金融开发者快速构建数据管道。但注意,它依赖 SEC 网站稳定性,高峰期可能延迟。
什么是 EdgarTools?
EdgarTools 是无需 API 密钥即可解析 SEC EDGAR 财报的开源 Python 库。
README
EdgarTools is a Python library for accessing SEC EDGAR filings as structured data. Parse financial statements, insider trades, fund holdings, proxy statements, and dozens of other filing types with a consistent Python API.

Why EdgarTools?
EdgarTools turns SEC filings into Python objects. Every supported form type gives you structured data — not raw HTML, not XML, not JSON dumps. Actual Python objects with properties, methods, and DataFrames.
<table align="center"> <tr> <td align="center" width="33%"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/icon-speed.svg" width="80" alt="Fast"><br> <b>Fast</b><br> Optimized with lxml & PyArrow<br> Smart caching, rate-limit aware </td> <td align="center" width="33%"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/icon-ai.svg" width="80" alt="AI Ready"><br> <b>AI Ready</b><br> Built-in MCP server for Claude<br> LLM-optimized text extraction </td> <td align="center" width="33%"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/icon-quality.svg" width="80" alt="Well Tested"><br> <b>Well Tested</b><br> 1000+ verification tests<br> Type hints throughout </td> </tr> <tr> <td align="center" width="33%"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/icon-xbrl.svg" width="80" alt="XBRL Support"><br> <b>XBRL Native</b><br> Full XBRL standardization<br> Cross-company comparisons </td> <td align="center" width="33%"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/icon-data.svg" width="80" alt="20+ Filing Types"><br> <b>20+ Filing Types</b><br> Typed objects for every form<br> Pandas-ready DataFrames </td> <td align="center" width="33%"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/icon-community.svg" width="80" alt="Open Source"><br> <b>Open Source</b><br> MIT license, free forever<br> No API keys, no rate limits </td> </tr> </table> <p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/dividers/divider-hexagons.svg" alt=""> </p>How It Works
<p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/how-it-works.svg" alt="How EdgarTools Python library extracts SEC EDGAR filing data"> </p> <p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/dividers/divider-hexagons.svg" alt=""> </p> <p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/sections/section-quick-start.svg" alt="Quick Start"> </p>pip install edgartools
from edgar import *
set_identity("your.name@example.com")
# Get a company's balance sheet
balance_sheet = Company("AAPL").get_financials().balance_sheet()
# Browse a company's filings
company = Company("MSFT")
# Parse insider transactions
filings = company.get_filings(form="4")
form4 = filings[0].obj()

Use Cases
Analyze 13F Institutional Holdings & Hedge Fund Portfolios
Track what hedge funds and institutional investors own by parsing SEC 13F filings. EdgarTools extracts complete portfolio holdings with position sizes, values, and quarter-over-quarter changes.
from edgar import get_filings
thirteenf = get_filings(form="13F-HR")[0].obj()
thirteenf.holdings # DataFrame of all portfolio positions
Institutional Holdings guide →
Track Insider Trading with SEC Form 4
Monitor insider buying and selling activity from SEC Form 4 filings. See which executives are purchasing or selling shares, option exercises, and net position changes.
company = Company("TSLA")
form4 = company.get_filings(form="4")[0].obj()
form4.transactions # Insider buy/sell transactions
Extract Financial Statements from 10-K and 10-Q Filings
Get income statements, balance sheets, and cash flow statements from SEC annual and quarterly reports. Data is parsed from XBRL with standardized labels for cross-company comparison.
financials = Company("MSFT").get_financials()
financials.balance_sheet() # Balance sheet with all line items
financials.income_statement() # Revenue, net income, EPS
Parse 8-K Current Reports for Corporate Events
Access material corporate events as they happen -- earnings releases, acquisitions, executive changes, and more. EdgarTools parses 8-K filings into structured items with full text extraction.
eightk = get_filings(form="8-K")[0].obj()
eightk.items # List of reported event items
Query XBRL Financial Data Across Companies
Access structured XBRL financial facts for any SEC filer. Query specific line items like revenue or total assets over time, and compare across companies using standardized concepts.
facts = Company("AAPL").get_facts()
facts.to_pandas("us-gaap:Revenues") # Revenue history as DataFrame
Comprehensive SEC Data Access
<table> <tr> <td width="50%" valign="top">Financial Statements (XBRL)
- Balance Sheets, Income Statements, Cash Flows
- Individual line items via XBRL tags
- Multi-period comparisons with comparative periods
- Standardized cross-company data
- Automatic unit conversion
- Metadata columns (dimensions, members, units)
- Complete dimensional data support
Fund & Investment Data
- 13F institutional holdings & portfolio analysis
- N-PORT fund portfolio data
- N-MFP money market fund holdings
- N-CSR/N-CEN fund reports
- Position tracking over time
Company Dataset & Reference Data
- Industry and state filtering
- Company subsets with metadata
- Standardized industry classifications
- SEC ticker/CIK lookups
- Exchange information
Insider Transactions
- Form 3, 4, 5 structured data
- Transaction history by insider
- Ownership changes
- Grant and exercise details
- Automatic parsing
Filing Intelligence
- Any form type (10-K, 10-Q, 8-K, S-1, etc.)
- Complete history since 1994
- Typed data objects for 20+ form types
- HTML to clean text extraction
- Section extraction (Risk Factors, MD&A)
- Subsidiaries (EX-21) and auditor extraction
Performance & Reliability
- Configurable rate limiting (enterprise mirrors supported)
- Custom SEC data sources (corporate/academic mirrors)
- Smart caching (30-second fresh filing cache)
- Robust error handling
- SSL verification with fail-fast retry
- Type hints throughout
- Enterprise configuration →
Developer Experience
- Intuitive, consistent API
- Pandas DataFrame integration
- Rich terminal output
- 1000+ tests
EdgarTools supports all SEC form types including 10-K annual reports, 10-Q quarterly filings, 8-K current reports, 13F institutional holdings, Form 4 insider transactions, proxy statements (DEF 14A), S-1 registration statements, N-CSR fund reports, N-MFP money market data, N-PORT fund portfolios, Schedule 13D/G ownership, Form D offerings, Form C crowdfunding, and Form 144 restricted stock. Parse XBRL financial data, extract text sections, and convert filings to pandas DataFrames.
<p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/dividers/divider-hexagons.svg" alt=""> </p>Comparison with Alternatives
EdgarTools is a Python library that talks directly to SEC EDGAR. sec-api is a hosted API service that returns JSON. Both parse SEC filings — the difference is how you work with the data.
| EdgarTools | sec-api | Raw EDGAR | |
|---|---|---|---|
| What it is | Python library | REST API service | DIY |
| Cost | Free (MIT) | $49+/mo | Free |
| Data format | Typed Python objects | JSON | Raw XML/HTML |
| Parsed filing types | 24 (10-K, 8-K, 13F, N-PORT, proxy, etc.) | 15+ structured APIs | — |
| Financials | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-check.svg" width="20"> Parsed + standardized | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-check.svg" width="20"> Parsed (XBRL-to-JSON) | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-cross.svg" width="20"> |
| Full-text search | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-check.svg" width="20"> via EFTS | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-check.svg" width="20"> | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-cross.svg" width="20"> |
| AI/MCP integration | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-check.svg" width="20"> | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-cross.svg" width="20"> | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-cross.svg" width="20"> |
| Language | Python | Any | Any |
| Open source | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-check.svg" width="20"> | <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/compare-cross.svg" width="20"> Proprietary | N/A |
Use EdgarTools with Claude Code & Claude Desktop
EdgarTools includes an MCP server and AI skills for Claude Desktop and Claude Code. Ask questions in natural language and get answers backed by real SEC data.
- "Compare Apple and Microsoft's revenue growth rates over the past 3 years"
- "Which Tesla executives sold more than $1 million in stock in the past 6 months?"
Option 1: AI Skills (Recommended)
Install the EdgarTools skill for Claude Code or Claude Desktop:
pip install "edgartools[ai]"
python -c "from edgar.ai import install_skill; install_skill()"
This adds SEC analysis capabilities to Claude, including 3,450+ lines of API documentation, code examples, and form type reference.
Option 2: MCP Server
Run EdgarTools as an MCP server for any AI client -- Claude Desktop, Cline, or your own containerized deployment.
Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"edgartools": {
"command": "uvx",
"args": ["--from", "edgartools[ai]", "edgartools-mcp"],
"env": {
"EDGAR_IDENTITY": "Your Name your.email@example.com"
}
}
}
}
Requires uv. Alternatively, pip install "edgartools[ai]" and use python -m edgar.ai.
See AI Integration Guide for complete documentation.
</details> <p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/dividers/divider-hexagons.svg" alt=""> </p><img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/icons/emoji-heart.svg" width="24" height="24"> Support This Project
EdgarTools replaces hundreds of hours of SEC parsing work — and it costs nothing to use. No API keys, no subscriptions, no rate limits. Free infrastructure for anyone working with SEC data.
But it doesn't maintain itself. The SEC updates filing formats every year. XBRL taxonomies change. New form types appear. One maintainer keeps all of it working, and your support makes that sustainable.
Sponsors aren't just giving back — you're investing in a shared resource and helping shape what gets built next.
<p align="center"> <a href="https://github.com/sponsors/dgunning" target="_blank"> <img src="https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA" alt="GitHub Sponsors" height="40"> </a> <a href="https://www.buymeacoffee.com/edgartools" target="_blank"> <img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="40"> </a> </p>What your support enables:
- Continued maintenance as SEC formats evolve
- New filing types and data objects
- Fast bug fixes and community support
- Free access for everyone, forever
Corporate sponsors: If your team depends on EdgarTools for compliance, financial analysis, or data pipelines, GitHub Sponsors offers tiers designed for organizations with mission-critical dependencies.
<p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/dividers/divider-hexagons.svg" alt=""> </p> <p align="center"> <img src="https://raw.githubusercontent.com/dgunning/edgartools/main/docs/images/sections/section-community.svg" alt="Community & Support"> </p>Documentation & Resources
Get Help & Connect
- GitHub Issues - Bug reports and feature requests
- Discussions - Questions and community discussions
Contributing
Contributions welcome:
- Code: Fix bugs, add features, improve documentation
- Examples: Share interesting use cases and examples
- Feedback: Report issues or suggest improvements
- Spread the Word: Star the repo, share with colleagues
See our Contributing Guide for details.
Professional Services
Need help building production SEC data infrastructure? The creator of EdgarTools offers consulting for teams building financial AI products:
- SEC Data Sprint (1–3 days) — Working prototype on your data
- Architecture Review (1–2 weeks) — Pipeline audit with prioritized fixes
- Pipeline Build (2–4 weeks) — Production-ready code, tests, and handoff
<p align="center"> EdgarTools is distributed under the <a href="LICENSE">MIT License</a> </p>
Star History
<!-- mcp-name: io.github.dgunning/edgartools -->常见问题
EdgarTools 是什么?
Open-source SEC EDGAR toolkit — 11 tools, 7 prompts, every filing type. No API key required.
相关 Skills
表格处理
by anthropics
围绕 .xlsx、.xlsm、.csv、.tsv 做读写、修复、清洗、格式整理、公式计算与格式转换,适合修改现有表格、生成新报表或把杂乱数据整理成交付级电子表格。
✎ 做 Excel/CSV 相关任务很省心,能直接读写、修复、清洗和格式转换,尤其擅长把乱七八糟的表格整理成交付级文件。
PDF处理
by anthropics
遇到 PDF 读写、文本表格提取、合并拆分、旋转加水印、表单填写或加解密时直接用它,也能提取图片、生成新 PDF,并把扫描件通过 OCR 变成可搜索文档。
✎ PDF杂活别再来回切工具了,文本表格提取、合并拆分到OCR识别一次搞定,连扫描件也能变可搜索。
Word文档
by anthropics
覆盖Word/.docx文档的创建、读取、编辑与重排,适合生成报告、备忘录、信函和模板,也能处理目录、页眉页脚、页码、图片替换、查找替换、修订批注及内容提取整理。
✎ 搞定 .docx 的创建、改写与精排版,目录、批量替换、批注修订和图片更新都能自动化,做正式文档尤其省心。
相关 MCP Server
文件系统
编辑精选by Anthropic
Filesystem 是 MCP 官方参考服务器,让 LLM 安全读写本地文件系统。
✎ 这个服务器解决了让 Claude 直接操作本地文件的痛点,比如自动整理文档或生成代码文件。适合需要自动化文件处理的开发者,但注意它只是参考实现,生产环境需自行加固安全。
by wonderwhy-er
Desktop Commander 是让 AI 直接执行终端命令、管理文件和进程的 MCP 服务器。
✎ 这工具解决了 AI 无法直接操作本地环境的痛点,适合需要自动化脚本调试或文件批量处理的开发者。它能让你用自然语言指挥终端,但权限控制需谨慎,毕竟让 AI 执行 rm -rf 可不是闹着玩的。
by stickerdaniel
LinkedIn Profile and Job Scraper 是让 Claude 直接抓取 LinkedIn 个人资料、公司信息和职位详情的工具。
✎ 这个服务器解决了招聘和商业调研中手动复制粘贴 LinkedIn 数据的痛点,适合猎头或市场分析师快速获取候选人背景和公司动态。不过,LinkedIn 反爬机制频繁更新,数据稳定性需要持续维护,使用时建议搭配人工验证。