This repository was archived by the owner on Jan 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Adaptation Summary
Kelvin edited this page May 20, 2021
·
12 revisions
adaptation.get_summary(
search_items,
location_type,
csv=False,
output_dir='/output'
)
Delivers the adaptation IDs for all projects that serve the location.
This method returns an array of AdaptationSummary
product for the given IDs and location_type. Optionally creates a csv file
(More information on the Adaption Summary product can be found on the Adaptation Summary Page on the First Street Foundation API Data Dictionary)
-
search_items:
list/file of SearchItems
, parcels to retrieve adaptation summary for. -
location_type:
string
, one of{property, neighborhood, city, zcta, tract, county, cd, state}
, for the search item type. -
csv:
bool
, whether to create a CSV for the retrieved data. -
output_dir:
string
, location to output the created CSV (ifcsv
is True).
python -m firststreet -p adaptation.get_summary -s 511447411;511447412;511447413 -l property
python -m firststreet -p adaptation.get_summary -s 540225;7924;631054 -l neighborhood
python -m firststreet -p adaptation.get_summary -s 1982200;1935265;3958002 -l city
python -m firststreet -p adaptation.get_summary -s 50156;50158;43935 -l zcta
python -m firststreet -p adaptation.get_summary -s 19153004900;39061007100;39153531702 -l tract
python -m firststreet -p adaptation.get_summary -s 19163;19047;39027 -l county
python -m firststreet -p adaptation.get_summary -s 1901;3903;3915 -l cd
python -m firststreet -p adaptation.get_summary -s 19;39 -l state
python -m firststreet -p adaptation.get_summary -s 37.16314,-76.55782;38.50303,-106.72863 -l state
python -m firststreet -p adaptation.get_summary -s "New York";"Ohio" -l state
python -m firststreet -p adaptation.get_summary -s sample_property.txt -l property
python -m firststreet -p adaptation.get_summary -s sample_neighborhood.txt -l neighborhood
python -m firststreet -p adaptation.get_summary -s sample_city.txt -l city
python -m firststreet -p adaptation.get_summary -s sample_zcta.txt -l zcta
python -m firststreet -p adaptation.get_summary -s sample_tract.txt -l tract
python -m firststreet -p adaptation.get_summary -s sample_county.txt -l county
python -m firststreet -p adaptation.get_summary -s sample_cd.txt -l cd
python -m firststreet -p adaptation.get_summary -s sample_state.txt -l state
# Contents of sample.py
# Create a `FirstStreet` object.
import firststreet
fs = firststreet.FirstStreet("api-key")
# Call adaptation.get_summary on a list of FSIDs
adaptation_summary = fs.adaptation.get_summary(search_items=[511447411, 511447412, 511447413], location_type="property", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=[540225, 7924, 631054], location_type="neighborhood", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=[1982200, 1935265, 3958002], location_type="city", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=[50156, 50158, 43935], location_type="zcta", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=[19153004900, 39061007100, 39153531702], location_type="tract", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=[19163, 19047, 39027], location_type="county", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=[1901, 3903, 3915], location_type="cd", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=[19, 39], location_type="state", csv=True)
# Call adaptation.get_summary on a lat/lng or address
adaptation_summary = fs.adaptation.get_summary(search_items=[(37.16314,-76.55782)], location_type="county", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items=["New York, New York"], location_type="city", csv=True)
# Call adaptation.get_summary on a file of SearchItems
adaptation_summary = fs.adaptation.get_summary(search_items="sample_property.txt", location_type="property", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items="sample_neighborhood.txt", location_type="neighborhood", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items="sample_city.txt", location_type="city", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items="sample_zcta.txt", location_type="zcta", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items="sample_tract.txt", location_type="tract", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items="sample_county.txt", location_type="county", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items="sample_cd.txt", location_type="cd", csv=True)
adaptation_summary = fs.adaptation.get_summary(search_items="sample_state.txt", location_type="state", csv=True)
Key | Type | Description | Example |
---|---|---|---|
fsid | str | First Street ID (FSID) is a unique identifier assigned to each location. | 392804911 |
valid_id | bool | Whether the input FSID returned valid data from the server. | True |
adaptation | Array[int] | Any Adaptation ID(s) (unique First Street ID assigned to all adaptation projects) for project(s) where the area served for the project overlaps any area of the location. | [12345, 23456, 34567, 45678] |
properties | int | For location_type that are not property , the number of properties covered within the location area |
79283 |
-
Installation
-
Usage
-
Products
-
Update