Skip to content

Commit 542eca2

Browse files
committed
better match variable to documentation
1 parent d0f83c1 commit 542eca2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343

4444
# https://edan.si.edu/openaccess/apidocs/
4545

46-
# API_DATA_GOV_TOKEN =
46+
# DATA_GOV_API_KEY =

scripts/1-fetch/smithsonian_fetch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
LOGGER, PATHS = shared.setup(__file__)
2929

3030
# Constants
31-
API_DATA_GOV_TOKEN = os.getenv("API_DATA_GOV_TOKEN")
31+
DATA_GOV_API_KEY = os.getenv("DATA_GOV_API_KEY")
3232
FILE_1_METRICS = os.path.join(PATHS["data_phase"], "smithsonian_1_metrics.csv")
3333
FILE_2_UNITS = os.path.join(PATHS["data_phase"], "smithsonian_2_units.csv")
3434
HEADER_1_METRICS = [
@@ -122,15 +122,15 @@ def write_data(args, data_metrics, data_units):
122122

123123

124124
def query_smithsonian(args, session):
125-
if not API_DATA_GOV_TOKEN:
125+
if not DATA_GOV_API_KEY:
126126
raise shared.QuantifyingException(
127-
"Authentication (API_DATA_GOV_TOKEN) required. Please ensure your"
127+
"Authentication (DATA_GOV_API_KEY) required. Please ensure your"
128128
" API key is set in .env",
129129
1,
130130
)
131131
LOGGER.info("Fetch data from API")
132132
url = "https://api.si.edu/openaccess/api/v1.0/stats"
133-
params = {"api_key": API_DATA_GOV_TOKEN}
133+
params = {"api_key": DATA_GOV_API_KEY}
134134
try:
135135
with session.get(url, params=params) as response:
136136
response.raise_for_status()

0 commit comments

Comments
 (0)