File tree 1 file changed +3
-3
lines changed
upload_worldbank_data/contents/src
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ def fetch_wb_data(table):
135
135
try :
136
136
# fetch data for this indicator (only the first 10,000 entries will be returned)
137
137
res = requests .get (
138
- "http ://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000" .format (indicator ))
138
+ "https ://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000" .format (indicator ))
139
139
# check how many pages of data there are for this indicator
140
140
pages = int (res .json ()[0 ]['pages' ])
141
141
break
@@ -151,7 +151,7 @@ def fetch_wb_data(table):
151
151
while try_num <= 5 :
152
152
try :
153
153
res = requests .get (
154
- "http ://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000&page={}" .format (
154
+ "https ://api.worldbank.org/v2/countries/all/indicators/{}?format=json&per_page=10000&page={}" .format (
155
155
indicator , page + 1 ))
156
156
json = json + res .json ()[1 ]
157
157
break
@@ -269,7 +269,7 @@ def main():
269
269
# pull the CSVs for each indicator
270
270
for indicator in indicators :
271
271
# insert the url used to download the data from the source website
272
- url = f'http ://api.worldbank.org/v2/en/indicator/{ indicator } ?downloadformat=csv'
272
+ url = f'https ://api.worldbank.org/v2/en/indicator/{ indicator } ?downloadformat=csv'
273
273
# download the data from the source
274
274
raw_data_file = os .path .join (data_dir , f'{ indicator } _DS2_en_csv_v2' )
275
275
urllib .request .urlretrieve (url , raw_data_file )
You can’t perform that action at this time.
0 commit comments