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

Adaptation Detail By Location

Kelvin edited this page Oct 30, 2020 · 5 revisions

Adaptation Detail by Location Method

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

This method first runs the AdaptationSummary product for the given IDs to get all relevant adaptation ids in the given location IDs, then runs the AdaptationDetail product on the extracted adaptation details.

This method returns an array of array of AdaptationSummary and AdaptationDetail products for the given IDs. Optionally creates a csv file.

Arguments:

  • search_items: list/file of AdaptationIds, adaptations to retrieve adaptation detail information 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 (if csv is True).

Example (Command Line):

# Call adaptation.get_detail_by_location on a list with 2 FSIDs
python -m firststreet -p adaptation.get_detail_by_location -i 190836953;193139123 -l property

# Call adaptation.get_detail_by_location on a file of SearchItems
python -m firststreet -p adaptation.get_detail_by_location -f sample.txt -l property

Example (Python File):

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

# Call adaptation.get_detail_by_location on a list with 2 property FSIDs
adaptation_detail = fs.adaptation.get_detail_by_location ([190836953, 193139123], location_type="property", csv=True)

# Call adaptation.get_detail_by_location on a file of SearchItems
adaptation_detail = fs.adaptation.get_detail_by_location ("sample.txt", csv=True)

Adaptation Detail By Location Output

Output:

List with 2 items:

  1. List of AdaptationSummary products (See the Adaptation Summary page for more information)

  2. List of AdaptationDetail products (See the Adaptation Detail page for more information)

Clone this wiki locally