ckanext-datastorecsw
PyCSW support for resources uploaded into the CKAN datastore.
The ckanext-spatial extension has support for transferring metadata records harvested from an external CSW into a local PyCSW database, but lacks support for transferring metadata created within CKAN into a local PyCSW database. This extension does two main things:
- Generates ISO 19139 XML metadata records for CKAN packages which contain resources uploaded into the CKAN datastore and makes them available through CKAN’s REST API.
- Interfaces with PyCSW through a command line interface to create/delete/load ISO XML generated from CKAN packages which contain datastored resources into the PyCSW database.
Note - The REST API extension will generate ISO 19139 XML metadata records for all CKAN packages. This ensures that all CKAN packages have a service point where users can access ISO 19139 XML records for every piece of data in the system. The command line interface will only load CKAN packages which contain datastore objects into the PyCSW database. Developers looking to load harvested metadata into PyCSW should use ckanext-spatial.
Dependencies
- CKAN >= v2.0 with datastore extension enabled
- PyCSW >= v1.8.0
Although it’s not required, you should probably also have either the datapusher or datastorer extension installed and enabled.
Installation
git clone https://github.com/ngds/ckanext-datastorecsw.git
cd ckanext-datastorecsw
pip install -r requirements.txt
python setup.py develop
REST API
ISO 19139 metadata for a CKAN package can be found at:
http://ckan.instance.org/package_iso/object/:id
Command Line Interface
# Setup PyCSW table in the database
paster datastore-pycsw setup -p src/ckan/pycsw.cfg
# Remove all records from the PyCSW table
paster datastore-pycsw clear -p src/ckan/pycsw.cfg
# Load datasets into the PyCSW database
paster datastore-pycsw load -p src/ckan/pycsw.cfg -u http://ckan.instance.org