Skip to content

Instantly share code, notes, and snippets.

@chriscarrollsmith
Created February 11, 2026 12:31
Show Gist options
  • Select an option

  • Save chriscarrollsmith/46b1356d89a2212f7cf619ec1b53b332 to your computer and use it in GitHub Desktop.

Select an option

Save chriscarrollsmith/46b1356d89a2212f7cf619ec1b53b332 to your computer and use it in GitHub Desktop.
Claude skill for retrieving SEC filings from EDGAR and parsing them for analysis
name description
analyzing-sec-filings
Retrieves and parses SEC EDGAR filings (10-K, 10-Q, 8-K, DEF 14A) into markdown or structured financial data using the edgartools Python library. Use when working with SEC filings, EDGAR data, XBRL financials, or company fundamental analysis.

Analyzing SEC Filings

Use edgartools for all SEC filing work. Do not use curl, manual HTML parsing, or filing.full_text_submission().

Setup

from edgar import Company, set_identity
set_identity("research research@example.com")  # required before any call

Getting filings

company = Company("AAPL")
filing = company.get_filings(form="10-K").latest()

# Other forms: "10-Q", "8-K", "DEF 14A"
# Filter by year: company.get_filings(form="10-K", year=2024)

Reading filing text

Default method for full-text reading:

md = filing.markdown()  # full filing as clean markdown, iXBRL stripped
Method Returns Use for
filing.markdown() Clean markdown Full-text reading, thesis writing
filing.text() Plain text Regex / keyword extraction
filing.html() Raw HTML Post-processing
filing.search(query) BM25-ranked matches Finding topics in large filings

Targeted section access (10-K / 10-Q)

tenk = filing.obj()  # returns TenK with typed accessors

tenk.business                # Item 1
tenk.risk_factors            # Item 1A
tenk.management_discussion   # Item 7 (MD&A)

Returns plain text strings for prose sections.

Financial statements

Use the Company API for multi-period comparison (faster, single API call):

income = company.income_statement(periods=3)         # last 3 fiscal years
balance = company.balance_sheet(periods=3)
quarterly = company.income_statement(periods=4, annual=False)

Use XBRL from a specific filing when you need exact as-filed line items:

xbrl = filing.xbrl()
inc = xbrl.statements.income_statement()
df = inc.to_dataframe()

Token-efficient exploration

Orient before reading in full:

company.to_context()   # ~88 tokens — company profile
filing.to_context()    # ~109 tokens — filing metadata + available methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment