Reproducibility
National Nonprofit Infrastructure & County Needs

1) Required downloads

  • IRS EO BMF Extract — EO regional CSV files (eo1–eo4).
  • HUD ZIP Crosswalk — ZIP-to-tract crosswalk CSV containing ZIP + TRACT + ratio columns.
  • ACS 5-year — accessed via Census API at runtime for population denominators.
Note

This pipeline is designed to be reproducible and runs from a single working directory. No absolute paths are required.

2) Folder structure

Place inputs and scripts in a single project folder (example below). Outputs will be written into the same folder by default.

project_folder/
  eo1.csv
  eo2.csv
  eo3.csv
  eo4.csv
  hud_zip_county_crosswalk.csv

  org_extract_with_county_fips.py
  county_focus_area.py
  county_summary.py

  # Outputs (generated)
  org_extract_with_county_fips.csv
  county_focus_area.csv
  county_summary.csv

3) Run order

Run the scripts in order. The org extract is the source of truth for aggregation layers.

Expected outputs
  • org_extract_with_county_fips.csv (EIN grain)
  • county_focus_area.csv (county × focus_area grain)
  • county_summary.csv (county grain)

4) QA checks

4.1 Structural checks
  • FIPS formatting: county_fips must be 5-digit strings (leading zeros preserved).
  • ZIP formatting: ZIP should be cleaned to 5 digits; invalid ZIP rows are dropped.
  • NTEE required: missing NTEE rows are excluded (cannot classify focus area).
4.2 Reconciliation checks
  • For a given county, sum of nonprofit_count across focus areas should equal total_nonprofits in county_summary.
  • Per-100k metrics can exceed raw counts; they are rates, not counts.
4.3 Coverage notes
  • ZIP-to-county is an approximation; this pipeline uses a deterministic “primary county per ZIP” for reproducibility.
  • EO BMF is a registry; it does not measure service capacity, staffing, or utilization.

5) Code

The embedded scripts below are publication-safe: no local paths and no program-specific language. Defaults assume files exist in the current directory.

View Data Scripts

Tip: keep the scripts canonical in one page (methodology.html) they are vailable on the methodology page.