Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Adaptation Detail

Kelvin edited this page Jan 7, 2021 · 7 revisions

Adaptation Project Method

adaptation.get_detail(
    search_items, 
    csv=False, 
    output_dir='/output'
)

Delivers information on the adaptation project including type, name, scenario it protects against, conveyance, total count properties served, return period (the flooding event that the adaptation can withstand), and adaptation area geometry.

This method returns an array of AdaptationDetail product for the given adaptation IDs. Only adaptation IDs are accepted. Optionally creates a csv file.

(More information on the Adaptation Detail product can be found on the Adaptation Detail Page on the First Street Foundation API Data Dictionary)

Arguments:

  • search_items: list/file of AdaptationIds, adaptation to retrieve adaptation detail information for.
  • csv: bool, whether to create a CSV for the retrieved data.
  • output_dir: string, location to output the created CSV (if csv is True).

Example (Command Line):

Call adaptation.get_detail on a list with 2 FSIDs

python -m firststreet -p adaptation.get_detail -s 10;12

Call adaptation.get_detail on a file of SearchItems

python -m firststreet -p adaptation.get_detail -s sample_adaptation.txt

Example (Python File):

# Contents of sample.py
# Create a `FirstStreet` object.  
import firststreet
fs = firststreet.FirstStreet("api-key")

# Call adaptation.get_detail on a list with 2 property FSIDs
adaptation_detail = fs.adaptation.get_detail(search_items=[10, 12], csv=True)

# Call adaptation.get_detail on a file of SearchItems
adaptation_detail = fs.adaptation.get_detail(search_items="sample_adaptation.txt", csv=True)

Adaptation Detail Objects

AdaptationDetail Object

Key Type Description Example
adaptationId str A unique First Street identifier assigned to each adaptation project 23456
valid_id bool Whether the input FSID returned valid data from the server. True
name string The name of the adaptation project Pawcatuck River - Pawcatuck, CT
type Array[string] The type(s) categorization of the adaptation project from 40 categories (see Adaptation Type Dictionary) inclusive of grey and green adaptation projects. ['Dam', 'Levee', 'Seawall']
scenario Array[string] The type(s) of flooding the adaptation project protects against (pluvial, fluvial or tidal). ['Pluvial', 'Tidal']
conveyance boolean Applicable for structures that convey certain amounts of water during pluvial and fluvial events. Adaptation structures with conveyance are incorporated into the model without completely removing flooding from within the area served. true
returnPeriod int The flooding event that the adaptation can withstand. For example, a 1 in 100 flood. 100
serving dict Count of locations that the adaptation project is serving as an array of dict, broken down by location type. See below
geometry Geometry A collection of nodes a Geometry that represents geographical information for area served by the adaptation project. See Geometry

Adaptation Serving

Key Type Description Example
property int The count of properties that the adaptation project is serving. 24
neighborhood int The count of neighborhoods that the adaptation project is serving. 2
zcta int The count of zctas that the adaptation project is serving. 1
tract int The count of tracts that the adaptation project is serving. 1
city int The count of cities that the adaptation project is serving. 1
county int The count of counties that the adaptation project is serving. 1
cd int The count of congressional districts that the adaptation project is serving. 1
state int The count of states that the adaptation project is serving. 1
Clone this wiki locally