The CKAN client Python package.
Project description
The CKAN client software may be used to make requests on the Comprehensive
Knowledge Archive Network (CKAN) REST API.
## Synopsis ##
The simplest way to make CKAN requests is:
import ckanclient
# Instantiate the CKAN client.
ckan = ckanclient.CkanClient(api_key=my_key)
# Get the package list.
ckan.package_register_get()
package_list = ckan.last_message
print package_list
# Get the tag list.
ckan.tag_register_get()
tag_list = ckan.last_message
print tag_list
# Collect the package metadata.
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)
# Get the details of a package.
ckan.package_entity_get(package_name)
package_entity = ckan.last_message
print package_entity
# Update the details of a package.
ckan.package_entity_get(package_name)
package_entity = ckan.last_message
package_entity['url'] = new_package_url
package_entity['notes'] = new_package_notes
ckan.package_entity_post(package_entity)
Knowledge Archive Network (CKAN) REST API.
## Synopsis ##
The simplest way to make CKAN requests is:
import ckanclient
# Instantiate the CKAN client.
ckan = ckanclient.CkanClient(api_key=my_key)
# Get the package list.
ckan.package_register_get()
package_list = ckan.last_message
print package_list
# Get the tag list.
ckan.tag_register_get()
tag_list = ckan.last_message
print tag_list
# Collect the package metadata.
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)
# Get the details of a package.
ckan.package_entity_get(package_name)
package_entity = ckan.last_message
print package_entity
# Update the details of a package.
ckan.package_entity_get(package_name)
package_entity = ckan.last_message
package_entity['url'] = new_package_url
package_entity['notes'] = new_package_notes
ckan.package_entity_post(package_entity)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ckanclient-0.1.tar.gz
(3.6 kB
view details)
Built Distribution
ckanclient-0.1-py2.5.egg
(8.5 kB
view details)
File details
Details for the file ckanclient-0.1.tar.gz
.
File metadata
- Download URL: ckanclient-0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0283ce5e8ff7bd388e01fb71fc1e8c26796520ad97d131869f6bebabd7b34f6 |
|
MD5 | 83230b5228c5ae77d60c54716e9d3537 |
|
BLAKE2b-256 | ec9614ea6a9a4a2d5276efffb717284552a0e0716c2092d003c8eac475c30646 |
Provenance
File details
Details for the file ckanclient-0.1-py2.5.egg
.
File metadata
- Download URL: ckanclient-0.1-py2.5.egg
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b450b17657a7ad811250214462ee4ed7dd863802d17b736df7578044b11f02fe |
|
MD5 | 4cc9af1950bb8ead749bb4ee993c141a |
|
BLAKE2b-256 | cbdd779c6fd7ccbfe5cdcb572d72669efe62e95b0d0edfc3f6a70a4fa724a24a |