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

Commit 7de008d

Browse files
committed
Add screenshots
1 parent 50143b3 commit 7de008d

File tree

16 files changed

+83
-42
lines changed

16 files changed

+83
-42
lines changed

README.md

Lines changed: 83 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
44
## Installation
55
**NOTE**: This project requires [Python](https://www.python.org/downloads/) 3.6+ to run.
66
1. Install the source code manager [Git]
7-
2. Create a new project directory
8-
3. Open a shell and navigate to the new project directory
9-
```sh
10-
cd /path/to/project
11-
```
12-
4. Clone the [project repository](https://github.com/FirstStreet/fsf_api_access_python.git) to the new directory
7+
2. Open `git bash` and create then navigate to a new project directory
8+
9+
![Screenshot](doc/images/1.2.1.png)
10+
11+
![Screenshot](doc/images/1.2.2.png)
12+
13+
3. Clone the project repository (https://github.com/FirstStreet/fsf_api_access_python.git) to the new directory
1314
```sh
1415
Example File Structure:
1516

1617
.
1718
├── fsf_api_access_python
19+
```
20+
21+
![Screenshot](doc/images/1.3.1.png)
1822

19-
20-
5. [Optional] Create and activate a new virtual environment through cmd/terminal to keep clean environments:
23+
4. [Optional] Open a console and create and activate a new virtual environment in the project directory:
2124
```sh
2225
python -m venv /path/to/new/virtual/environment
2326
@@ -26,11 +29,18 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
2629
.\venv\Scripts\activate
2730
```
2831

29-
6. Run the setup script to install the project requirements
32+
![Screenshot](doc/images/1.4.1.png)
33+
34+
![Screenshot](doc/images/1.4.2.png)
35+
36+
5. Run the setup script to install the project requirements
3037
```sh
3138
pip install .\fsf_api_access_python\.
3239
```
33-
7. The project is now setup and can be ran through one of the two methods below. See `Products` for details on how to extract flood data products from the API.
40+
41+
![Screenshot](doc/images/1.5.1.png)
42+
43+
6. The project is now setup and can be ran through one of the two methods below. See `Products` for additional details on how to extract flood data products from the API.
3444
```sh
3545
Example File Structure:
3646
@@ -42,36 +52,62 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
4252
## Method 1: Through the Client
4353
**[Reminder] Keep your API key safe, and do not share it with others!**
4454
45-
1. Create a new First Street Foundation API Client in a Python Script.
55+
1. Create a new Python script and initialize a First Street Foundation API Client.
4656
```python
4757
# Contents of my_script.py
4858
import firststreet
4959
fs = firststreet.FirstStreet("api-key")
5060
```
51-
52-
2. Call one of the methods described below in the `Products` section. See the `Examples` section for examples.
61+
62+
2. Call one of the methods described below in the `Products` section with the required arguments. See the `Examples` section for more examples.
5363
```python
5464
fs.<product>.<product_subtype>(<fsids: list>, <lookup_type: string>)
5565
```
66+
67+
![Screenshot](doc/images/2.2.1.png)
68+
69+
3. Run the python script.
70+
71+
![Screenshot](doc/images/2.3.1.png)
5672

5773
## Method 2: Through the Command Line
5874
**[Reminder] Keep your API key safe, and do not share it with others!**
5975

6076
1. [Required] Set an Environmental Variable with the variable_name as `FSF_API_KEY` and the variable_value with the API_KEY.
77+
78+
![Screenshot](doc/images/3.1.1.png)
79+
80+
![Screenshot](doc/images/3.1.2.png)
81+
82+
![Screenshot](doc/images/3.1.3.png)
6183

62-
2. In the project directory, call one of the methods described below in the `Products` section through the command line. See the `Examples` section for examples.
84+
2. Open a new console and navigate to the project directory. Next, call one of the methods described below in the `Products` section through the command line. See the `Examples` section for more examples.
6385
```sh
6486
cd /path/to/project
65-
python -m firststreet -p <product>.<product_subtype> -i <fsids> -l <lookup_type>
87+
python -m firststreet -p <product>.<product_subtype> -i <fsids> -f <file_name> -l <lookup_type>
6688
```
89+
90+
![Screenshot](doc/images/3.2.1.png)
91+
6792

6893
##### Command Line Arguments:
6994

7095
- `-p/--product PRODUCT`: [REQUIRED] The product to call from the API
96+
97+
Example: ```-p location.get_detail```
98+
7199
- `[-i/--fsids FSIDS]`: [OPTIONAL] The FSIDs to search for with the product
100+
101+
Example: ```-i 541114211,541229206```
102+
72103
- `[-l/--location LOOKUP_TYPE]`: [OPTIONAL] The lookup location type (property, neighborhood, city, zcta, tract, county, cd, state)
104+
105+
Example: ```-l property```
106+
73107
- `[-f/--file FILE]`: [OPTIONAL] A file of FSIDs (one per line) to search for with the product
74108

109+
Example: ```-f sample.txt```
110+
75111
Content of a sample text file:
76112
```text
77113
541114211
@@ -81,6 +117,38 @@ The First Street Foundation API Access (Python) is a wrapper used to bulk extrac
81117
541262690
82118
540651172
83119
```
120+
121+
![Screenshot](doc/images/4.4.1.png)
122+
123+
## CSV File Output:
124+
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).
125+
126+
127+
### CSV File Name:
128+
The file name will be in the format of `YYYY_MM_DD_HH_mm_SS_product_subtype_lookup.csv`.
129+
130+
Ex:
131+
- `2020_06_10_17_29_49_adaptation_detail.csv`
132+
- `2020_06_10_17_33_56_adaptation_summary_property.csv`
133+
134+
### CSV File Content
135+
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.
136+
137+
Ex:
138+
```csv
139+
fsid,year,returnPeriod,bin,low,mid,high
140+
7935,2020,20,20,<NA>,2,<NA>
141+
7935,2020,20,50,<NA>,1,<NA>
142+
7935,2020,20,55,<NA>,2,<NA>
143+
7935,2020,20,65,<NA>,2,<NA>
144+
7935,2020,20,75,<NA>,2,<NA>
145+
7935,2020,20,95,<NA>,1,<NA>
146+
7935,2020,20,100,<NA>,1,<NA>
147+
...
148+
```
149+
![Screenshot](doc/images/5.2.1.png)
150+
151+
![Screenshot](doc/images/5.2.2.png)
84152

85153
## Products
86154
### Location
@@ -149,33 +217,6 @@ environmental.<method>
149217
```
150218

151219
* `get_precipitation`(fsids `list`, csv `bool`) - Returns an array of `Environmental Precipitation` product for the given county IDs, and optionally creates a csv file
152-
153-
## CSV File Output:
154-
Any product above can be additionally exported to a CSV file for further usage if the csv boolean is set during the product call. The extracted can be found in the `data_csv` directory of the project folder (if at least one CSV has been extracted).
155-
156-
157-
### CSV File Name:
158-
The file name will be in the format of `YYYY_MM_DD_HH_mm_SS_product_subtype_lookup.csv`.
159-
160-
Ex:
161-
- `2020_06_10_17_29_49_adaptation_detail.csv`
162-
- `2020_06_10_17_33_56_adaptation_summary_property.csv`
163-
164-
### CSV File Content
165-
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.
166-
167-
Ex:
168-
```csv
169-
fsid,year,returnPeriod,bin,low,mid,high
170-
7935,2020,20,20,<NA>,2,<NA>
171-
7935,2020,20,50,<NA>,1,<NA>
172-
7935,2020,20,55,<NA>,2,<NA>
173-
7935,2020,20,65,<NA>,2,<NA>
174-
7935,2020,20,75,<NA>,2,<NA>
175-
7935,2020,20,95,<NA>,1,<NA>
176-
7935,2020,20,100,<NA>,1,<NA>
177-
...
178-
```
179220

180221

181222
## Examples

doc/images/1.2.1.png

5.71 KB
Loading

doc/images/1.2.2.png

11.3 KB
Loading

doc/images/1.3.1.png

17.8 KB
Loading

doc/images/1.4.1.png

11.9 KB
Loading

doc/images/1.4.2.png

9.96 KB
Loading

doc/images/1.5.1.png

83.1 KB
Loading

doc/images/2.2.1.png

11.1 KB
Loading

doc/images/2.3.1.png

10.3 KB
Loading

doc/images/3.1.1.png

21.3 KB
Loading

0 commit comments

Comments
 (0)