Reusable section extractors for IRS Form 990, 990-EZ, and 990-PF XML filings.
This repo contains the extraction layer behind Harbor Commons: small, composable Python modules that turn IRS XML into structured outputs for downstream analysis.
extract_part_vii.py— officer and compensation extractionextract_schedule_a.pythroughextract_schedule_r.py— schedule-level extraction modulesextract_990ez_core.py— 990-EZ core extractionextract_narratives.py— narrative/text extraction supportcli.py,run_extract.py,run_extract_v2.py— command-line entry points and orchestrationutils.py— shared IRS namespace, hashing, and helper logic
Most nonprofit analysis starts with PDFs, flat exports, or manual review. This repo works one layer closer to the source: the XML itself. That makes extraction reproducible, diffable, and portable across fields.
- nonprofit researchers
- funders and intermediaries
- civic-tech builders
- anyone building a receipts-first nonprofit intelligence layer
- Modular extractors instead of one monolithic parser
- Section-by-section evolution so individual schedules can improve independently
- Standard-library first where practical
- Public-record discipline so downstream consumers can trace claims back to filings
This repo is the public extraction engine.
harbor-commons is the public product layer built on top of methods like these.
python run_extract.py /path/to/filing.xml
python cli.py /path/to/filing.xml --prettySee METHOD.md for the extraction philosophy, the evolution from flat crawl to targeted section extraction, and how to think about the older issue waves in context.