Using_the_API

ammylovetodie edited this page Mar 5, 2017 · 1 revision
Clone this wiki locally

import ckanclient

Instantiate the CKAN client.

ckan = ckanclient.CkanClient(api_key=my_api_key, base_location="http://myckaninstance.com/api")

Describe the package.

package_entity = { 'name': my_package_name, 'url': my_package_url, 'download_url': my_package_download_url, 'tags': my_package_keywords, 'notes': my_package_long_description, }

Register the package.

ckan.package_register_post(package_entity)