A helper library for exploring and fetching data from the U.S. Census Bureau API.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file cendat-0.8.0.tar.gz.
File metadata
- Download URL: cendat-0.8.0.tar.gz
- Upload date:
- Size: 6.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f15c26abc58a3e2e82d5515b09f3ce58c973ed90ff94ed75d43e6998080eb4b
|
|
| MD5 |
bf1023b5fe02d5ea1e59b30c7bb30ec0
|
|
| BLAKE2b-256 |
36847414618efaad214998e35f4cfa5097afb81118057571e38b91c424a3fc1c
|
File details
Details for the file cendat-0.8.0-py3-none-any.whl.
File metadata
- Download URL: cendat-0.8.0-py3-none-any.whl
- Upload date:
- Size: 29.0 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 |
5acd4094436260d151ac1a6a0976130fd0771ea86033aa551204ea8f1ea3bb2e
|
|
| MD5 |
ced3dc6c1b5d0ec15905d222b7141ab9
|
|
| BLAKE2b-256 |
e8e6d95b9c5ba4c1904f0cadad9a5e345d666cfcdcafccc1ebcf65234a79cc19
|