A harvester to import datasets from the City of Zürich's LOSD portal to its CKAN instance (https://data.stadt-zuerich.ch/).
This harvester was developed against CKAN 2.10.
To install ckanext-stadtzh_losdharvest:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-stadtzh_losdharvest Python package into your virtual environment:
pip install ckanext-stadtzh_losdharvest
Add
stadtzh_losdharvest
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
).Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Add the profile to the CKAN config as below. If you have multiple profiles, separate them with spaces:
ckanext.dcat.rdf.profiles = stadtzh_losdharvest_dcat
The RDF format of the data to be harvested can be set in the harvester configuration. If it is not set, the default value is "text/turtle":
{ "rdf_format":"text/turtle" }
To install ckanext-stadtzh_losdharvest for development, activate your CKAN virtualenv and do:
git clone https://github.com/opendatazurich/ckanext-stadtzh_losdharvest.git cd ckanext-stadtzh_losdharvest python setup.py develop pip install -r dev-requirements.txt
To run the tests, do:
pytest --ckan-ini=test.ini --disable-warnings ckanext/stadtzhtheme/tests
To run the tests and produce a coverage report, first make sure you have
coverage installed in your virtualenv (pip install coverage
) then run:
pytest --ckan-ini=test.ini --cov=ckanext.stadtzh_losdharvest --disable-warnings ckanext/stadtzh_losdharvest/tests