Skip to main content

US Census utilities for a variety of data loading, analysis, and mapping purposes.

Project description

censusdis

U.S. Map of Integration

Hippocratic License HL3-CL-ECO-EXTR-FFD-LAW-MIL-SV PyPI PyPI - Python Version

PyPI - Status PyPI - Format PyPI - Downloads

GitHub last commit Tests Badge Coverage Badge Documentation Status

censusdis is a package for discovering, loading, analyzing, and computing diversity, integration, and segregation metrics to U.S. Census demographic data. It is designed

  • to support every dataset, every geography, and every year. It's not just about ACS data through the last time the software was updated and released;
  • to support all geographies, on and off-spine, not just states, counties, and census tracts;
  • to have integrated mapping capabilities that save you time and extra coding;
  • to be intuitive, Pythonic, and fast.

Note:

For the full README, please visit the censusdis source repository.

Installation and First Example

censusdis can be installed with pip:

pip install censusdis

Every censusdis query needs four things:

  1. What data set we want to query.
  2. What vintage, or year.
  3. What variables.
  4. What geographies.

Here is an example of how we can use censusdis to download data once we know those four things.

import censusdis.data as ced
from censusdis.datasets import ACS5
from censusdis import states

df_median_income = ced.download(
    # Data set: American Community Survey 5-Year
    dataset=ACS5,
    
    # Vintage: 2022
    vintage=2022, 
    
    # Variable: median household income
    download_variables=['NAME', 'B19013_001E'], 
    
    # Geography: All counties in New Jersey.
    state=states.NJ,
    county='*'
)

There are many more examples in the tuturial and in the sample notebooks.

Tutorial (A Great Place to Start!)

For a tutorial, please see the censusdis-tutorial repository. This tutorial was presented at PyData Seattle 2023. If you want to try it out for yourself, the README.md contains links that let you run the tutorial notebooks live on mybinder.org in your browser without needing to set up a local development environment or download or install any code.

Tutorial Video

A 86 minute video of the tutorial as presented at PyData Seattle 2023 is also available.

PyData Seattle Tutorial Video

More Details

For the full README, lots of maps, demo notebooks, and more, please visit the censusdis source repository.

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

censusdis-1.1.5.tar.gz (385.9 kB view hashes)

Uploaded Source

Built Distribution

censusdis-1.1.5-py3-none-any.whl (423.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page