Skip to main content

EdgarTools Python SEC EDGAR library logo

Async-Enabled Python Library for SEC EDGAR Data Extraction

PyPI - Version Hatch project GitHub

Async fork of edgartools with enhanced XBRL support for non-US GAAP statements (IFRS, etc.). Extract financial data without blocking your event loop - perfect for high-throughput financial data pipelines.

⭐ ALL CREDIT GOES TO EDGARTOOLS ⭐ This is a temporary fork created solely to add async support for immediate production needs. ALL the heavy lifting, design, and core functionality is from the brilliant work of Dwight Gunning and the edgartools community.

Use the original edgartools for production - it's actively maintained, has extensive documentation, and a strong community. This fork exists only to add async APIs until they're merged upstream.

If you find this useful, please ⭐ star and support the original project: https://github.com/dgunning/edgartools

EdgarTools SEC filing data extraction demo

SEC Filing Data Extraction with Python

With EdgarTools Without EdgarTools
✅ Instant access to any filing since 1994 ❌ Hours spent navigating SEC.gov
✅ Clean Python API with intuitive methods ❌ Complex web scraping code
✅ Automatic parsing into pandas DataFrames ❌ Manual extraction of financial data
✅ Specialized data objects for each form type ❌ Custom code for each filing type
✅ One-line conversion to clean, readable text ❌ Messy HTML parsing for text extraction
✅ LLM-ready text extraction for AI pipelines ❌ Extra processing for AI/LLM compatibility
✅ Automatic throttling to avoid blocks ❌ Rate limiting headaches

Apple's income statement in 1 line of code

balance_sheet = Company("AAPL").get_financials().balance_sheet()         

🚀 Quick Start (2-minute tutorial)

# 1. Import the library
from edgar import *

# 2. Tell the SEC who you are (required by SEC regulations)
set_identity("your.name@example.com")  # Replace with your email

# 3. Find a company
company = Company("MSFT")  # Microsoft

# 4. Get company filings
filings = company.get_filings() 

# 5. Filter by form 
insider_filings = filings.filter(form="4")  # Insider transactions

# 6. Get the latest filing
insider_filing = insider_filings[0]

# 7. Convert to a data object
ownership = insider_filing.obj()

Apple SEC Form 4 insider transaction data extraction with Python

⚡ Async API (New in edgartools-async)

Perfect for high-throughput pipelines and concurrent processing:

import asyncio
from edgar.async_api import get_company_async, load_sgmls_concurrently
from edgar import set_identity

async def main():
    # Set identity BEFORE async operations
    set_identity("your.name@example.com")

    # Load company data without blocking event loop
    company = await get_company_async("AAPL", user_agent="your.name@example.com")

    # Load SGML data asynchronously
    filings = company.get_filings(form="10-K")
    sgml = await filings[0].sgml_async()

    # Batch load multiple filings concurrently
    filings_list = list(company.get_filings(form="10-Q"))[:10]
    sgmls = await load_sgmls_concurrently(filings_list, max_in_flight=32)
    print(f"Loaded {len(sgmls)} filings concurrently!")

asyncio.run(main())

Key Async Features:

  • get_company_async(): Non-blocking company instantiation
  • filing.sgml_async(): Async SGML file loading
  • load_sgmls_concurrently(): Batch concurrent loading with rate limiting
  • Thread-safe identity management: No stdin blocking in async contexts

🌍 Enhanced Non-US GAAP Support (New in edgartools-async)

Improved handling of international financial statements (IFRS, etc.):

Key Enhancements:

  • IFRS taxonomy support: Better detection and parsing of IFRS statements
  • Quarterly vs YTD fallback: Intelligently selects best available periods (prefers 3-month, falls back to YTD for cash flow)
  • Sparse period filtering: Removes comparison periods with incomplete data
  • Improved concept matching: Better revenue/income detection across taxonomies
  • Abstract element inference: Automatically identifies abstract/header rows
  • Revenue deduplication: Smarter handling of dimensional breakdowns vs parent totals

Example: Foreign Filer with IFRS

from edgar import Company

# Works seamlessly with non-US GAAP filers
company = Company("SAP")  # German company using IFRS
financials = company.income_statement(periods=4, annual=True)
# Automatically detects and parses IFRS taxonomy

SEC Filing Analysis: Real-World Solutions

Company Financial Analysis

Problem: Need to analyze a company's financial health across multiple periods.

Microsoft SEC 10-K financial data analysis with EdgarTools

See full code

📚 Documentation

👥 Community & Support

🔮 Roadmap

  • Coming Soon: Enhanced visualization tools for financial data
  • In Development: Machine learning integrations for financial sentiment analysis
  • Planned: Interactive dashboard for filing exploration

🤝 Contributing

We welcome contributions from the community! Here's how you can help:

  • 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.

❤️ Sponsors & Support

If you find EdgarTools valuable, please consider supporting its development:

Buy Me A Coffee

Your support helps maintain and improve EdgarTools for the entire community!

Key Features for SEC Data Extraction and Analysis

  • Comprehensive Filing Access: Retrieve any SEC filing (10-K, 10-Q, 8-K, 13F, S-1, Form 4, etc.) since 1994.
  • Financial Statement Extraction: Easily access Balance Sheets, Income Statements, Cash Flows, and individual line items using XBRL tags or common names.
  • SEC EDGAR API: Programmatic access to the complete SEC database.
  • Smart Data Objects: Automatic parsing of filings into structured Python objects.
  • Fund Holdings Analysis: Extract and analyze 13F holdings data for investment managers.
  • Insider Transaction Monitoring: Get structured data from Form 3, 4, 5 filings.
  • Clean Text Extraction: One-line conversion from filing HTML to clean, readable text suitable for NLP.
  • Targeted Section Extraction: Pull specific sections like Risk Factors (Item 1A) or MD&A (Item 7).
  • AI/LLM Ready: Text formatting and chunking optimized for AI pipelines.
  • Performance Optimized: Leverages libraries like lxml and potentially PyArrow for efficient data handling.
  • XBRL Support: Extract and analyze XBRL-tagged data.
  • Intuitive API: Simple, consistent interface for all data types.

EdgarTools is distributed under the MIT License.

📊 Star History

Star History Chart

Metadata

Release files for edgartools-async 1.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for edgartools-async 1.0.17
File Size Uploaded Provenance Actions
edgartools_async-1.0.17.tar.gz 1.6 MB Without provenance Details for edgartools_async-1.0.17.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for edgartools-async 1.0.17
File Interpreter ABI Platform Actions
edgartools_async-1.0.17-py3-none-any.whl Python 3 none any Details for edgartools_async-1.0.17-py3-none-any.whl

Total release size: 3.2 MB

Release files / edgartools_async-1.0.17.tar.gz

Download URL edgartools_async-1.0.17.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
d854314143aa867ec8c55436afd7ba7d4ab627aa1e2b618a37e565cfc03b6ad6
BLAKE2b-256 checksum
How to use checksums
0340f0dbe536311989937f357cf1cdaf2f5bcbf760b39cceb511dff93eaa4b7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release files / edgartools_async-1.0.17-py3-none-any.whl

Download URL edgartools_async-1.0.17-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
26ad44cfb2dc6074d2826d81448e907939b0a50c9f4fe43e9326a5d20b1c1356
BLAKE2b-256 checksum
How to use checksums
3c15ea58b2b5b94ec5fbc80c7a23ef116250bc542c3565e7d8de8172fc28bba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Security for edgartools-async 1.0.17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page