edgartools: SEC EDGAR Filings Analysis

5.29.0 · active · verified Tue Apr 14

EdgarTools is a Python library designed to access and analyze SEC EDGAR filings, XBRL financial statements, 10-K, 10-Q, and 8-K reports. It provides structured Python objects for over 20 filing types, converting complex SEC data into easy-to-use DataFrames. Currently at version 5.29.0, the library is actively developed with frequent updates addressing bug fixes and adding new features, often multiple releases per month.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to set your SEC identity, create a `Company` object, access basic company information, and retrieve the latest income statement and balance sheet. It highlights the structured data access that edgartools provides.

import os
from edgar import Company, set_identity

# The SEC requires all API users to identify themselves with a name and email.
# Set this once or use the EDGAR_IDENTITY environment variable.
identity = os.environ.get('EDGAR_IDENTITY', 'John Doe john.doe@example.com')
set_identity(identity)

# Get a company by its ticker symbol
company = Company("AAPL")

# Access basic company data
print(f"Company: {company.name}")
print(f"Industry: {company.industry}")

# Get the company's latest financial statements
financials = company.get_financials()
income_statement = financials.income_statement()
balance_sheet = financials.balance_sheet()
cashflow_statement = financials.cashflow_statement()

print("\nLatest Income Statement (first 5 rows):\n", income_statement.head())
print("\nLatest Balance Sheet (first 5 rows):\n", balance_sheet.head())

view raw JSON →