Created
February 29, 2016 19:38
-
-
Save urkonn/29e140b595f8de0319c8 to your computer and use it in GitHub Desktop.
creates a new group in CKAN with existing datasets
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
import os | |
import ckanapi | |
HOST = os.getenv('CKAN_HOST') | |
TOKEN = os.getenv('CKAN_API_TOKEN') | |
remote = ckanapi.RemoteCKAN(HOST, user_agent='ckanops/1.0', apikey=TOKEN) | |
remote.action.group_create(name='group-name', | |
packages=[{'id': 'dataset-name1'}, | |
{'id': 'dataset-name2'}, | |
{'id': 'dataset-name3'}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment