Skip to content

Instantly share code, notes, and snippets.

@urkonn
Created July 9, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save urkonn/67db3a0153e473daa847 to your computer and use it in GitHub Desktop.
Save urkonn/67db3a0153e473daa847 to your computer and use it in GitHub Desktop.
Get the id from all datasets in CKAN
#!/usr/bin/env python
import ckanapi
ckan_instance = ckanapi.RemoteCKAN('http://192.168.33.20:8080',
apikey='XXXXX',
user_agent='ckanapi/1.0')
ds_info = ckan_instance.action.current_package_list_with_resources()
id_list = []
for i in ds_info:
id_list.append(i['id'])
print id_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment