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
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
File details
Details for the file svi_data-0.0.3.tar.gz
.
File metadata
- Download URL: svi_data-0.0.3.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5f31e24ee9b39604e2bf2eafb4beb6cdd66261d218dc7fa200c11aa5626eadf |
|
MD5 | 9d8eb274fb6227aaff5035bbeb9bb4a9 |
|
BLAKE2b-256 | ed0e145b2798d5b685831c860b9b3006df9a7a5d7266ad8af00e00928555569a |
File details
Details for the file svi_data-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: svi_data-0.0.3-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ffdddf0d598e5837ad983e162e4ed7be26f79e63ad3af5f2674ae838205e15f |
|
MD5 | 7b2389f70ae781601dffa788da6bf757 |
|
BLAKE2b-256 | e6d6bfb091147bdb848bb9f93e30dddf9f932cb662d6b4942fd1a7bcffccb8ef |