cendat
A Python helper for the U.S. Census Bureau API.
cendat provides a high-level, chainable interface for discovering datasets, filtering geographies and variables, and fetching data concurrently.
Installation
pip install cendat
Optional Dependencies
pip install cendat[pandas] # pandas support
pip install cendat[polars] # polars support
pip install cendat[geopandas] # geopandas support
pip install cendat[all] # all of the above
Quick Example
from cendat import CenDatHelper
# Initialize with your API key
cdh = CenDatHelper(years=[2023], key="your-api-key")
# Find and select a product
cdh.list_products(patterns=r"acs/acs5\)")
cdh.set_products()
# Select geography and variables
cdh.set_geos(["050"]) # Counties
cdh.set_variables(["B01001_001E"]) # Total population
# Fetch data
response = cdh.get_data(include_names=True)
df = response.to_polars(concat=True, destring=True)
Documentation
📖 Full documentation: mostlyunoriginal.github.io/cendat
Links
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cendat-0.8.1.tar.gz
(7.9 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
cendat-0.8.1-py3-none-any.whl
(29.5 kB
view details)
File details
Details for the file cendat-0.8.1.tar.gz.
File metadata
- Download URL: cendat-0.8.1.tar.gz
- Upload date:
- Size: 7.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5647582833be5843a6c0459223282bd5720f710ca3788625722b1a81856a7ec7
|
|
| MD5 |
0d7d056c9e44777dcb16b19c49ef5331
|
|
| BLAKE2b-256 |
4dbb6c89cb27e7fb4e962d449fc41f6f49de6a542a78ea9968268cba4a3762fc
|
File details
Details for the file cendat-0.8.1-py3-none-any.whl.
File metadata
- Download URL: cendat-0.8.1-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4044d8c1becac42b0c03f472500b168839b6c6610f4d796b90d4a1fcb128f40d
|
|
| MD5 |
4c56e949a2ba0f02be93982153cca586
|
|
| BLAKE2b-256 |
f19b102a98b64699efa83c095656744b06215e1fe0ceb8a49dc2606f26d07aac
|