Created
June 17, 2016 21:00
-
-
Save urkonn/db1d7fad9a57f2dac32384f4a19f1bfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bulk insert organizations logos in CKAN | |
import os | |
import ckanapi | |
HOST = os.getenv('CKAN_HOST') | |
TOKEN = os.getenv('CKAN_API_TOKEN') | |
LOGOS_URL = os.getenv('IMAGE_HOST') | |
remote = ckanapi.RemoteCKAN(HOST, user_agent='ckanops/1.0', apikey=TOKEN) | |
org_list = remote.action.organization_list() | |
for org in org_list: | |
remote.action.organization_patch(id=org, image_url=LOGOS_URL+org+'.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment