skillfed

census

A wrapper for the US Census Bureau's API

census v0.8.27 198.7K downloads/30d#9,722 on PyPI681
Permissive license BSD Active released

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 census

uv

uv add census

poetry

poetry add census

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python

Tags

census bureau api wrapperus demographic data accessamerican community survey pythoncensus acs sf1 datageographic census queriesfips code demographic lookupus census api client
census-datagovernment-apidemographics

More WWW/HTTP packages