Skip to main content

Retrieve Social Vulnerability Index data from The Center for Disease Control / The Agency for Toxic Substances and Disease Registry.

Project description

OWPHydroTools :: SVI Client

This subpackage provides programmatic accessing the Center for Disease Control's (CDC) Social Vulnerability Index (SVI). "Social vulnerability refers to the potential negative effects on communities caused by external stresses on human health. Such stresses include natural or human-caused disasters, or disease outbreaks. Reducing social vulnerability can decrease both human suffering and economic loss." [source]

The SVI has been released 5 times (2000, 2010, 2014, 2016, and 2018) and calculates a relative percentile ranking in four themes categories and an overall ranking at a given geographic context and geographic scale. The themes are:

  • Socioeconomic
  • Household Composition & Disability
  • Minority Status & Language
  • Housing Type & Transportation

Rankings are calculated relative to a geographic context, state or all states (United States) . Meaning, for example, a ranking calculated for some location at the United States geographic context would be relative to all other locations where rankings was calculated in the United States. Similarly, SVI rankings are calculated at two geographic scales, census tract and county scales. Meaning, the rankings correspond to a county for a census tract. For completeness, for example, if you were to retrieve the 2018 SVI at the census tract scale, at the state context for the state of Alabama, you would receive 1180 records (number of census tracts in AL in 2010 census) where each ranked percentile is calculated relative to census tracts in Alabama. The tool released in this PR only supports querying for ranking calculated at the United States geographic context. Future work will add support for retrieving rankings at the state spatial scale.

Documentation for each year release of the SVI are located below:

See the SVI Client Documentation for a complete list and description of the currently available methods. To report bugs or request new features, submit an issue through the OWPHydroTools Issue Tracker on GitHub.

Installation

In accordance with the python community, we support and advise the usage of virtual environments in any workflow using python. In the following installation guide, we use python's built-in venv module to create a virtual environment in which the tool will be installed. Note this is just personal preference, any python virtual environment manager should work just fine (conda, pipenv, etc. ).

# Create and activate python environment, requires python >= 3.8
$ python3 -m venv venv
$ source venv/bin/activate
$ python3 -m pip install --upgrade pip

# Install nwis_client
$ python3 -m pip install hydrotools.svi_client

Usage

Code

from hydrotools.svi_client import SVIClient

client = SVIClient()
df = client.get(
    location="AL", # state / nation name (i.e. "alabama" or "United States") also accepted. case insensitive
    geographic_scale="census_tract", # "census_tract" or "county"
    year="2018", # 2000, 2010, 2014, 2016, or 2018
    geographic_context="national" # only "national" supported. "state" will be supported in the future
    )
print(df)

Example output

            state_name state_abbreviation  ... svi_edition                                           geometry
0        alabama                 al  ...        2018  POLYGON ((-87.21230 32.83583, -87.20970 32.835...
1        alabama                 al  ...        2018  POLYGON ((-86.45640 31.65556, -86.44864 31.655...
...          ...                ...  ...         ...                                                ...
29498    alabama                 al  ...        2018  POLYGON ((-85.99487 31.84424, -85.99381 31.844...
29499    alabama                 al  ...        2018  POLYGON ((-86.19941 31.80787, -86.19809 31.808...

System Requirements

Development

$ python3 -m venv env
$ source env/bin/activate
$ python3 -m pip install -U pip
$ python3 -m pip install -U setuptools
$ python3 -m pip install -e ".[develop]"

To generate a source distribution:

$ python3 -m pip install -U wheel build
$ python3 -m build

The packages generated in dist/ can be installed directly with pip or uploaded to PyPI using twine.

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

hydrotools_svi_client-0.0.3.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

hydrotools.svi_client-0.0.3-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file hydrotools_svi_client-0.0.3.tar.gz.

File metadata

  • Download URL: hydrotools_svi_client-0.0.3.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for hydrotools_svi_client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e4bc3a556626634d12f4e90def3a9f6ab3c937317418c9b1acbb88126d198a06
MD5 bb20a9eee01c19d0cc27fe01859c5d57
BLAKE2b-256 9f9866c28071bc16af3370051b7563a01c05ff3bb5c463e388482746dc9dba49

See more details on using hashes here.

File details

Details for the file hydrotools.svi_client-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hydrotools.svi_client-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 683796219a82752c47a9fd3cae4470f229ad97baa5e9a1aac3fceeb0dfaf2f34
MD5 d8cc40d9888685ce91baae9a51287c10
BLAKE2b-256 7bcaa5acb57f7ce7b5be3f1f79fb58f32a6d76f4018845cb115b72376691fbf7

See more details on using hashes here.

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