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

Commit b2b4cf9

Browse files
committed
Update doc with trimmed images
1 parent f1565e7 commit b2b4cf9

File tree

19 files changed

+41
-5
lines changed

19 files changed

+41
-5
lines changed

README.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
# First Street Foundation API Access Documentation (Python)
22
The First Street Foundation API Access (Python) is a wrapper used to bulk extract flood data from the First Street Foundation API
33

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+
<a name="installation"></a>
425
# Installation
526
**NOTE**: This project requires [Python](https://www.python.org/downloads/) 3.6+ to run.
627
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
6687
├── venv
6788
├── my_script.py
6889
69-
# Method 1: Through the Command Line
90+
<a name="method1"></a>
91+
## Running the Project - Method 1: Through the Command Line
7092
**[Reminder] Keep your API key safe, and do not share it with others!**
7193
7294
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
85107

86108
![Screenshot](doc/images/3.2.1.png)
87109

88-
##### Command Line Argument Details:
110+
<a name="commandline"></a>
111+
### Command Line Argument Details:
89112

90113
- `-p/--product PRODUCT`: [REQUIRED] The product to call from the API
91114

@@ -133,7 +156,8 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
133156

134157
![Screenshot](doc/images/4.4.2.png)
135158

136-
## Method 2: Through the Client
159+
<a name="method2"></a>
160+
## Running the Project - Method 2: Through the Client
137161
**[Reminder] Keep your API key safe, and do not share it with others!**
138162

139163
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
142166
import firststreet
143167
fs = firststreet.FirstStreet("api-key")
144168
```
169+
<a name="client-init"></a>
145170
#### Client Initialization Details
146171

147172
```python
148173
firststreet.FirstStreet(api_key, [version], [log])
149174
```
150175

176+
<a name="client-arguments"></a>
151177
#### Arguments
152178
* api_key `string`: The assigned API key to access the API.
153179
* 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
170196

171197
![Screenshot](doc/images/2.3.1.png)
172198

199+
<a name="products"></a>
173200
# Products
201+
<a name="location"></a>
174202
#### Location
175203

176204
The Location API provides `Detail` and `Summary` data for the given FSIDs.
@@ -182,6 +210,7 @@ location.<method>
182210
* `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
183211
* `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
184212

213+
<a name="probability"></a>
185214
#### Probability
186215

187216
The Probability API provides `Depth`, `Chance`, `Cumulative`, `Count` data for the given FSIDs.
@@ -196,6 +225,7 @@ probability.<method>
196225
* `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
197226
* `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
198227

228+
<a name="historic"></a>
199229
#### Historic
200230

201231
The Historic API provides `Summary` and `Event` data for the given FSIDs.
@@ -207,6 +237,7 @@ historic.<method>
207237
* `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
208238
* `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
209239

240+
<a name="adaptation"></a>
210241
#### Adaptation
211242

212243
The Adaptation API provides `Summary` and `Project` data for the given FSIDs.
@@ -218,6 +249,7 @@ adaptation.<method>
218249
* `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
219250
* `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
220251

252+
<a name="fema"></a>
221253
#### Fema
222254

223255
The Fema API provides `NFIP` data for the given FSIDs.
@@ -228,6 +260,7 @@ fema.<method>
228260

229261
* `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
230262

263+
<a name="environmental"></a>
231264
#### Environmental
232265

233266
The Environmental API provides `Precipitation` data for the given FSIDs.
@@ -238,6 +271,7 @@ environmental.<method>
238271

239272
* `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
240273

274+
<a name="examples"></a>
241275
# Examples
242276
**[Reminder] Keep your API key safe, and do not share it with others!**
243277
1. Single FSID Extraction Through the Client:
@@ -340,18 +374,19 @@ environmental.<method>
340374
540651172,1,0,1,0,0
341375
```
342376

343-
377+
<a name="csv-output"></a>
344378
# CSV File Output:
345379
Any product above can be additionally exported to a CSV file for further usage if the csv boolean is set during the product call, or any call using the command line. The extracted can be found in the `data_csv` directory of the project folder (if at least one CSV has been extracted).
346380

347-
381+
<a name="csv-name"></a>
348382
#### CSV File Name:
349383
The file name will be in the format of `YYYY_MM_DD_HH_mm_SS_product_subtype_lookup.csv`.
350384

351385
Ex:
352386
- `2020_06_10_17_29_49_adaptation_detail.csv`
353387
- `2020_06_10_17_33_56_adaptation_summary_property.csv`
354388

389+
<a name="csv-content"></a>
355390
#### CSV File Content
356391
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.
357392

@@ -371,6 +406,7 @@ fsid,year,returnPeriod,bin,low,mid,high
371406

372407
![Screenshot](doc/images/5.2.2.png)
373408

409+
<a name="updating"></a>
374410
# Updating the Project to the Newest Version:
375411
If an update is made to this project, you will need to pull the changes from github and reinstall this project.
376412

doc/images/1.1.1.png

-8.95 KB
Loading

doc/images/1.2.1.png

-962 Bytes
Loading

doc/images/1.2.2.png

633 Bytes
Loading

doc/images/1.2.3.png

-64 KB
Loading

doc/images/1.3.1.png

-197 Bytes
Loading

doc/images/1.4.1.png

-3.49 KB
Loading

doc/images/1.4.2.png

-3.66 KB
Loading

doc/images/1.5.1.png

11.2 KB
Loading

doc/images/1.5.2.png

-3.6 KB
Loading

0 commit comments

Comments
 (0)