Skip to content

Commit fdd8736

Browse files
Updated IUCN to use secrets instead of api key file
1 parent 17396cd commit fdd8736

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

dataSources/iucn/api/config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"path": "./processing.py",
55
"function": "retrieve",
66
"args": [
7-
"./apiKey.txt",
87
"{OUT-PATH}"
98
],
109
"output": "iucn.csv"

dataSources/iucn/api/scripts/processing.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
from lib.bigFiles import RecordWriter
55
import time
66
import lib.dataframes as dff
7+
from lib.secrets import secrets
78

8-
def retrieve(apiKeyPath: Path, outputFilePath: Path):
9-
with open(apiKeyPath) as fp:
10-
apiKey = fp.read().rstrip(" \n")
11-
9+
def retrieve(outputFilePath: Path):
1210
baseURL = "https://api.iucnredlist.org/api/v4"
1311
headers = {
1412
"accept": "application/json",
15-
"Authorization": apiKey
13+
"Authorization": secrets.iucn.key
1614
}
1715

1816
session = requests.Session()

0 commit comments

Comments
 (0)