Closed jodiegardiner closed 4 years ago
One of the partners has a script which they run at regular intervals to update this dataset:
https://energydata.info/dataset/cd3f689a-7c04-4f7c-91c0-1037d033a872
The script is here:
import os import requests import json import pprint API_KEY = '***' CKAN_URL = 'https://energydata.info' url = CKAN_URL + '/api/action/resource_create' Path= r'I:\RWD_WindDevelopment\PR108103_WorldBank_Ethiopia_WindMapping_NDA\3.ProjectExecution\2.Phase2\T2.5_MonthlyData\upload' for filename in os.listdir(Path): if not filename.endswith('.py'): response = requests.post(url, data={"package_id": "cd3f689a-7c04-4f7c-91c0-1037d033a872", "url": '', "url_type": "upload", "name": filename}, headers={"Authorization": API_KEY}, files=[('upload', file(filename))]) assert response.status_code == 200 response_dict = json.loads(response.content) pprint.pprint(response_dict['result'])
When they currently run this script, everything appears to work, the response is correct. But the resource files are not available.
see #289 for more info
One of the partners has a script which they run at regular intervals to update this dataset:
https://energydata.info/dataset/cd3f689a-7c04-4f7c-91c0-1037d033a872
The script is here:
When they currently run this script, everything appears to work, the response is correct. But the resource files are not available.