You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,27 @@
1
1
# First Street Foundation API Access Documentation (Python)
2
2
The First Street Foundation API Access (Python) is a wrapper used to bulk extract flood data from the First Street Foundation API
3
3
4
+
# Table of contents
5
+
-**[Installation](#installation)**
6
+
*[Running the Project - Method 1: Through the Command Line](#method1)
7
+
+[Command Line Argument Details](#commandline)
8
+
*[Running the Project - Method 2: Through the Client](#method2)
9
+
-[Client Initialization Details](#client-init)
10
+
-[Arguments](#client-#arguments)
11
+
-**[Products](#products)**
12
+
-[Location](#location)
13
+
-[Probability](#probability)
14
+
-[Historic](#historic)
15
+
-[Adaptation](#adaptation)
16
+
-[Fema](#fema)
17
+
-[Environmental](#environmental)
18
+
-**[Examples](#examples)**
19
+
-**[CSV File Output:](#csv-output)**
20
+
-[CSV File Name:](#csv-name)
21
+
-[CSV File Content](#csv-content)
22
+
-**[Updating the Project to the Newest Version:](#updating)**
23
+
24
+
<aname="installation"></a>
4
25
# Installation
5
26
**NOTE**: This project requires [Python](https://www.python.org/downloads/) 3.6+ to run.
6
27
1. Go to the Python page (https://www.python.org/downloads/) and download then install Python version 3. **Make sure that the checkbox is checked for Python to be added to the PATH**
@@ -66,7 +87,8 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
66
87
├── venv
67
88
├── my_script.py
68
89
69
-
# Method 1: Through the Command Line
90
+
<a name="method1"></a>
91
+
## Running the Project - Method 1: Through the Command Line
70
92
**[Reminder] Keep your API key safe, and do not share it with others!**
71
93
72
94
1. [Required] Set an Environmental Variable with the `variable_name` as `FSF_API_KEY` and the `variable_value` with the `API_KEY`.
@@ -85,7 +107,8 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
85
107
86
108

87
109
88
-
##### Command Line Argument Details:
110
+
<a name="commandline"></a>
111
+
### Command Line Argument Details:
89
112
90
113
- `-p/--product PRODUCT`: [REQUIRED] The product to call from the API
91
114
@@ -133,7 +156,8 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
133
156
134
157

135
158
136
-
## Method 2: Through the Client
159
+
<a name="method2"></a>
160
+
## Running the Project - Method 2: Through the Client
137
161
**[Reminder] Keep your API key safe, and do not share it with others!**
138
162
139
163
1. Create a new Python script (by using notepad or any other text editor) and initialize a First Street Foundation API Client.
@@ -142,12 +166,14 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
* api_key `string`: The assigned API key to access the API.
153
179
* version `string= v1`: The version of the API to access. Defaults to the current version.
@@ -170,7 +196,9 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
170
196
171
197

172
198
199
+
<a name="products"></a>
173
200
# Products
201
+
<a name="location"></a>
174
202
#### Location
175
203
176
204
The Location API provides `Detail` and `Summary` data for the given FSIDs.
@@ -182,6 +210,7 @@ location.<method>
182
210
*`get_detail`(fsids `list`, location_type `string`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Location Detail` product for the given IDs, location_type, and optionally creates a csv file
183
211
*`get_summary`(fsids `list`, location_type `string`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Location Summary` product for the given IDs, location_type, and optionally creates a csv file
184
212
213
+
<a name="probability"></a>
185
214
#### Probability
186
215
187
216
The Probability API provides `Depth`, `Chance`, `Cumulative`, `Count` data for the given FSIDs.
@@ -196,6 +225,7 @@ probability.<method>
196
225
*`get_cumulative`(fsids `list`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Probability Cumulative` product for the given IDs, and optionally creates a csv file
197
226
*`get_count`(fsids `list`, location_type `string`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Probability Count` product for the given IDs, location_type, and optionally creates a csv file
198
227
228
+
<a name="historic"></a>
199
229
#### Historic
200
230
201
231
The Historic API provides `Summary` and `Event` data for the given FSIDs.
@@ -207,6 +237,7 @@ historic.<method>
207
237
*`get_event`(fsids `list`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Historic Event` product for the given historic IDs, and optionally creates a csv file
208
238
*`get_summary`(fsids `list`, location_type `string`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Historic Summary` product for the given IDs, location_type, and optionally creates a csv file
209
239
240
+
<a name="adaptation"></a>
210
241
#### Adaptation
211
242
212
243
The Adaptation API provides `Summary` and `Project` data for the given FSIDs.
@@ -218,6 +249,7 @@ adaptation.<method>
218
249
*`get_project`(fsids `list`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Adaptation Project` product for the given adaptation IDs, and optionally creates a csv file
219
250
*`get_summary`(fsids `list`, location_type `string`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Adaptation Summary` product for the given IDs, location_type, and optionally creates a csv file
220
251
252
+
<a name="fema"></a>
221
253
#### Fema
222
254
223
255
The Fema API provides `NFIP` data for the given FSIDs.
@@ -228,6 +260,7 @@ fema.<method>
228
260
229
261
*`get_nfip`(fsids `list`, location_type `string`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Fema NFIP` product for the given IDs, location_type, and optionally creates a csv file
230
262
263
+
<a name="environmental"></a>
231
264
#### Environmental
232
265
233
266
The Environmental API provides `Precipitation` data for the given FSIDs.
@@ -238,6 +271,7 @@ environmental.<method>
238
271
239
272
*`get_precipitation`(fsids `list`, csv `bool`, [core_limit `int=100`]) - Returns an array of `Environmental Precipitation` product for the given county IDs, and optionally creates a csv file
240
273
274
+
<a name="examples"></a>
241
275
# Examples
242
276
**[Reminder] Keep your API key safe, and do not share it with others!**
243
277
1. Single FSID Extraction Through the Client:
@@ -340,18 +374,19 @@ environmental.<method>
340
374
540651172,1,0,1,0,0
341
375
```
342
376
343
-
377
+
<a name="csv-output"></a>
344
378
# CSV File Output:
345
379
Any product above can be additionally exported to a CSV file forfurther usage if the csv boolean is set during the product call, or any call using the command line. The extracted can be foundin the `data_csv` directory of the project folder (if at least one CSV has been extracted).
346
380
347
-
381
+
<a name="csv-name"></a>
348
382
#### CSV File Name:
349
383
The file name will be in the format of `YYYY_MM_DD_HH_mm_SS_product_subtype_lookup.csv`.
The contents of the CSV file will follow similar formats as the `First Street Foundation API - V1.0 Overview and Dictionary`, but all lists will be expanded to a flat file. For any values that are null or not available, `<NA>` will be used.
0 commit comments