Skip to main content

Download SVI (social vulnerability index) data from CDC

Project description

svi_data

Code to download 5 year American Community Survey Data estimates and create the Social Vulnerability Index (SVI) data from CDC. SVI combines data from several different domains into an overall health index:

This code downloads the data into a pandas dataframe for a given geography (either county, zipcode, or census tract). To install is:

pip install svi-data

Packages that need to be installed for this to work are the pandas and census. Also you will need to sign up for a census API key (it is free), and will need access to the internet.

An example of importing the SVI data for zipcodes:

import svi_data
key = svi_data.get_key('census_api.txt') # read in census api key from text file
svi_zips = svi_data.get_svi(key,'zip')   # download the SVI data for zipcodes in the US

Note this uses the 2018 SVI version data definition, but allows you to download data for other years and apply that 2018 definition. See the Jupyter notebook ExampleAnalysis.ipynb in the root of the github repo illustrating grabbing different variables and different years of data.

Future Development

In the /src/prep_acs.py functions, it has functions to download the ACS data from the FTP site and creates a localized sqllite database with all of the census variables for a given year. Future work will incorporate this as a potential way to grab the data to create the SVI or additional variables from the 5 year ACS (which are available at various geographies).

This work was supported by Gainwell technologies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svi_data-0.0.3.tar.gz (12.7 kB view hashes)

Uploaded Source

Built Distribution

svi_data-0.0.3-py3-none-any.whl (13.2 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