spm-calculator
Calculate SPM (Supplemental Poverty Measure) thresholds for any US geography and year
What it is and what it does
spm-calculator computes official US Supplemental Poverty Measure thresholds for any supported geography and year. It combines three components: base thresholds (derived from Consumer Expenditure Survey data, varying by housing tenure), an equivalence scale that adjusts for family size and composition using the official Betson formula, and geographic adjustments that account for local housing costs using Census metro tables or ACS median rent data. The package bundles national thresholds and official metro data; for custom geographies like states, counties, and tracts, it fetches current median rents from the Census ACS API.
The package is designed for researchers, policy analysts, and developers who need to calculate poverty thresholds programmatically. It supports nation, state, county, metro area, congressional district, PUMA, and tract-level geographies. Base thresholds are validated against published BLS values, and the implementation follows official Census SPM methodology. Runtime dependencies include pandas and numpy for computation, requests for API calls, and the census and us libraries for geographic data handling.
Use it for:
- Calculate poverty thresholds for a specific family composition in a metro area to assess eligibility for assistance programs
- Batch-compute SPM thresholds across multiple counties or states for policy analysis or research
- Build a web or desktop tool that lets users look up poverty thresholds for their geography and family size
- Validate or cross-check poverty calculations in survey data or administrative records against official Census methodology
- Generate historical poverty threshold comparisons across years for trend analysis
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Calculate Supplemental Poverty Measure (SPM) thresholds for US geographies by combining base thresholds, family composition adjustments, and local housing cost data from Census sources.
Yes, if you need to calculate official SPM thresholds programmatically. The package is actively maintained, has low install friction, carries no security vulnerabilities, and implements validated Census methodology. Set CENSUS_API_KEY if you need custom geographies beyond the bundled metro areas. Alpha status reflects ongoing development, not instability—recent commits and active maintenance indicate active use.
Install
spm-calculator on PyPI
pip
pip install spm-calculatoruv
uv add spm-calculatorpoetry
poetry add spm-calculatorInstalling spm-calculator
Before you install
Low install friction with a pure-Python wheel and six common dependencies (pandas, numpy, requests, census, us, openpyxl). Package is actively maintained with recent commits; status is alpha but in active development.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects without licensing concerns.
Quickstart
pip install spm-calculator
from spm_calculator import SPMCalculator
calc = SPMCalculator(year=2024)
threshold = calc.calculate_threshold(
num_adults=2,
num_children=2,
tenure="renter",
geography_type="metro_area",
geography_id="35620"
)
Requires CENSUS_API_KEY environment variable for custom geographies (states, counties, districts, tracts); official metro areas work without it.
Verify before relying
- Whether ACS data fetching handles rate limits or caching for batch operations on many geographies
- Performance characteristics for tract-level calculations across large datasets
- Availability and completeness of ACS rent data for all supported geography types
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — pandas, numpy, requests, census, us, openpyxl |
| Maintenance | actively maintained — 119 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 104,242/month — #12,759 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spm_calculator-0.3.1-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
censusProvides a Python wrapper for the United States…
permissive · top 15,000 on PyPI
krippendorffComputes Krippendorff's alpha, a statistical…
copyleft · top 15,000 on PyPI
cpiAdjusts U.S. dollar amounts for inflation using…
permissive · top 15,000 on PyPI
accessCalculates spatial accessibility metrics to…
permissive · top 15,000 on PyPI
censusgeocodeWraps the US Census Geocoder API to convert…
copyleft · top 15,000 on PyPI
uszipcodeProvides programmable access to a database of…
permissive · top 5,000 on PyPI
usProvides structured access to US state and…
unclear · top 5,000 on PyPI
geonamescacheProvides Python dictionaries of geographic data…
permissive · top 5,000 on PyPI
coverage-thresholdValidates Python code coverage against…
permissive · top 15,000 on PyPI
policyengine-usPolicyEngine US models the US federal and state…
agpl · top 15,000 on PyPI