censusgeocode
Thin Python wrapper for the US Census Geocoder
What it is and what it does
Censusgeocode is a lightweight Python wrapper around the US Census Geocoder API that lets you convert addresses to geographic coordinates and retrieve Census geographic data (blocks, tracts, counties, states) for those locations. It exposes the Census API through simple functions like onelineaddress(), address(), and coordinates(), and returns results as CensusResult objects that preserve the Census's interpretation of your query. The package also includes a command-line tool for geocoding single addresses or batch-processing CSV files.
The wrapper supports both "locations" mode (structured address data) and "geographies" mode (Census geographic boundaries and attributes). You can configure which Census benchmark and vintage to use via the CensusGeocode class if you need historical or alternative data. It depends only on requests and requests-toolbelt, making it lightweight to install and use.
Use it for:
- Geocode a list of addresses in a CSV file to get latitude/longitude pairs and Census geographic identifiers for spatial analysis.
- Look up which Census block, tract, or county contains a given latitude/longitude coordinate.
- Batch-process up to 10,000 addresses from the command line to generate a CSV with parsed addresses and coordinates.
- Retrieve detailed Census geographic attributes (area, population codes, GEOID) for addresses in a Python script.
- Convert single addresses to coordinates programmatically for mapping or location-based applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Wraps the US Census Geocoder API to convert addresses to coordinates and coordinates to Census geographic data, with both programmatic and command-line interfaces.
Yes, if you need to geocode US addresses or map them to Census geographies. The package is stable, has low install friction, and directly wraps an official Census API. The GPLv3 license is a blocker for proprietary applications. Maintenance is aging (last release 187 days ago), so verify that Census API changes haven't broken the wrapper before deploying to production.
Install
censusgeocode on PyPI
pip
pip install censusgeocodeuv
uv add censusgeocodepoetry
poetry add censusgeocodeInstalling censusgeocode
Before you install
Low install friction with only two runtime dependencies (requests and requests-toolbelt). Maintenance is aging—last release was 187 days ago—but the repository remains active and the package supports current Python versions through 3.14.
License in practice
Licensed under GPLv3 (copyleft). Any derivative work or distribution must also be open-source under GPLv3; proprietary applications cannot use this package without complying with copyleft obligations.
Quickstart
pip install censusgeocode
import censusgeocode as cg
result = cg.onelineaddress('1600 Pennsylvania Avenue, Washington, DC')
print(result.input, result)
Requires network access to the US Census Geocoder API (http://geocoding.geo.census.gov/geocoder/); batch geocoding is limited to 10,000 rows per request.
Verify before relying
- Whether the Census Geocoder API requires authentication or has rate limits beyond the documented 10,000-row batch limit.
- Current availability and stability of Census Geocoder API benchmarks and vintages referenced in the package.
Package facts
| License | GNU General Public License v3 (GPLv3) (copyleft) |
| Python support | supports the current Python release (<4,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — requests, requests-toolbelt |
| Maintenance | aging — 187 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 219,749/month — #9,320 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: censusgeocode-0.5.3-py3-none-any.whl
Keywords: census, geocode, api
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
censusProvides a Python wrapper for the United States…
permissive · top 15,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
geocoderGeocoder provides a unified Python interface to…
permissive · top 5,000 on PyPI
opencageA Python wrapper for the OpenCage Geocoding API…
permissive · top 15,000 on PyPI
reverse_geocoderReverse Geocoder converts latitude/longitude…
copyleft · top 15,000 on PyPI
spm-calculatorCalculate Supplemental Poverty Measure (SPM)…
permissive · top 15,000 on PyPI
reverse-geocodeReverse Geocode converts latitude/longitude…
copyleft · top 15,000 on PyPI
uszipcodeProvides programmable access to a database of…
permissive · top 5,000 on PyPI
zipcodesQuery and validate U.S. zipcodes with embedded…
permissive · top 15,000 on PyPI
googlemapsPython client library that wraps Google Maps…
permissive · top 5,000 on PyPI