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
Historic Event By Location
Kelvin edited this page Oct 30, 2020
·
7 revisions
historic.get_events_by_location(
search_items,
location_type,
csv=False,
output_dir='/output'
)This method first runs the HistoricSummary product for the given IDs to get all relevant historic event ids in the given location IDs, then runs the HistoricEvent product on the extracted historic events.
This method returns an array of array of HistoricSummary and HistoricEvent products for the given IDs. Optionally creates a csv file.
-
search_items:
list/file of EventIds, events to retrieve historic event 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 (ifcsvis True).
# Call historic.get_events_by_location on a list with 2 FSIDs
python -m firststreet -p historic.get_events_by_location -i 190836953;193139123 -l property
# Call historic.get_events_by_location on a file of SearchItems
python -m firststreet -p historic.get_events_by_location -f sample.txt -l property# Contents of sample.py
# Create a `FirstStreet` object.
import firststreet
fs = firststreet.FirstStreet("api-key")
# Call historic.get_events_by_location on a list with 2 property FSIDs
historic_event = fs.historic.get_events_by_location([190836953, 193139123], location_type="property", csv=True)
# Call historic.get_events_by_location on a file of SearchItems
historic_event = fs.historic.get_event("sample.txt", csv=True)List with 2 items:
-
List of
HistoricSummaryproducts (See the Historic Summary page for more information) -
List of
HistoricEventproducts (See the Historic Event page for more information)
-
Installation
-
Usage
-
Products
-
Update