census
A wrapper for the US Census Bureau's API
What it is and what it does
Census is a lightweight client library that abstracts the Census Bureau's HTTP API into Python method calls. It handles the low-level details of constructing API requests, managing geographic specifications (FIPS codes, state/county/tract hierarchies), and parsing responses for multiple Census datasets including ACS 5-year, 3-year, and 1-year estimates, as well as Summary File 1 and redistricting data.
The library provides convenience methods for common geographic queries (state, county, tract, congressional district, etc.) and supports year-based queries across historical datasets. It depends only on requests for HTTP communication, making it lightweight to integrate into data pipelines, demographic analysis scripts, or research tools that need programmatic Census access.
Use it for:
- Retrieve demographic statistics for a specific state or county to build population reports or dashboards.
- Query historical Census data across multiple years to analyze demographic trends in a geographic area.
- Automate bulk extraction of housing, income, or education metrics for research or policy analysis.
- Build geographic lookup tools that map FIPS codes to Census data for civic tech applications.
- Integrate Census data into data warehouses or ETL pipelines for downstream analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Python wrapper for the United States Census Bureau's API, enabling programmatic access to American Community Survey (ACS) and Summary File 1 (SF1) demographic data across multiple geographic levels.
Yes. Census is a stable, actively maintained wrapper with low install friction (one dependency), no known vulnerabilities, and permissive licensing. Install it if you need programmatic access to US Census data; it eliminates manual API construction and provides geographic convenience methods. The only prerequisite is obtaining a free Census API key.
Install
census on PyPI
pip
pip install censusuv
uv add censuspoetry
poetry add censusInstalling census
Before you install
Low friction: pure Python wheel with only requests as a runtime dependency. Active maintenance with recent release (91 days ago) and 681 repository stars indicate ongoing support.
License in practice
BSD permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install census
from census import Census
c = Census("YOUR_API_KEY")
data = c.acs5.state(('NAME', 'B25034_010E'), '24')
Requires a Census API key obtained from https://api.census.gov/data/key_signup.html before making any data requests.
Verify before relying
- Whether the package supports Python 3.x versions or has any minimum Python version requirement (not specified in metadata).
- Performance characteristics when querying large geographic areas or multiple years of historical data.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — requests |
| Maintenance | actively maintained — 91 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 198,687/month — #9,722 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: census-0.8.27-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
censusgeocodeWraps the US Census Geocoder API to convert…
copyleft · top 15,000 on PyPI
spm-calculatorCalculate Supplemental Poverty Measure (SPM)…
permissive · top 15,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
uszipcodeProvides programmable access to a database of…
permissive · top 5,000 on PyPI
pyzipcodeProvides local lookup of US ZIP code…
permissive · top 15,000 on PyPI
openbb-blsIntegrates the U.S. Bureau of Labor Statistics…
agpl · top 15,000 on PyPI
cellxgene-censusProvides a Python API to query and retrieve…
permissive · top 15,000 on PyPI
SurveyGizmoA Python wrapper for the SurveyGizmo REST API…
permissive · top 15,000 on PyPI
prisma-saseLightweight Python SDK wrapper for the Palo…
permissive · top 15,000 on PyPI