Package: hydrotools.svi-client
OWPHydroTools :: SVI ClientThis 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 givengeographic contextandgeographic scale. The themes are:SocioeconomicHousehold Composition & DisabilityMinority Status & LanguageHousing Type & TransportationRankings are calculated relative to ageographic 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 twogeographic 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:20002010201420162018See theSVI Client Documentationfor a complete list and description of the currently available methods. To report bugs or request
new features, submit an issue through theOWPHydroTools Issue
Trackeron GitHub.InstallationIn 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-invenvmodule 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-mvenvvenv
$sourcevenv/bin/activate
$python3-mpipinstall--upgradepip# Install nwis_client$python3-mpipinstallhydrotools.svi_clientUsageCodefromhydrotools.svi_clientimportSVIClientclient=SVIClient()df=client.get(location="AL",# state / nation name (i.e. "alabama" or "United States") also accepted. case insensitivegeographic_scale="census_tract",# "census_tract" or "county"year="2018",# 2000, 2010, 2014, 2016, or 2018geographic_context="national"# only "national" supported. "state" will be supported in the future)print(df)Example outputstate_name state_abbreviation  ... svi_edition                                           geometry0        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 RequirementsDevelopment$python3-mvenvenv
$sourceenv/bin/activate
$python3-mpipinstall-Upip
$python3-mpipinstall-Usetuptools
$python3-mpipinstall-e".[develop]"To generate a source distribution:$python3-mpipinstall-Uwheelbuild
$python3-mbuildThe packages generated indist/can be installed directly withpipor uploaded to PyPI usingtwine.