GovData.de specific CKAN extension contains some helpful tools, e.g. a link checker for testing the availability of the provided links in the resources.
If you are using Python virtual environment (virtualenv), activate it.
# use project on GitHub
$ cd /path/to/virtualenv
$ /path/to/virtualenv/bin/pip install -e git+git://github.com/GovDataOfficial/ckanext-govdatade.git#egg=ckanext-govdatade
$ cd src/ckanext-govdatade
$ /path/to/virtualenv/bin/pip install -r base-requirements.txt -f requirements
$ python setup.py develop
or
# use project on Open CoDE
$ cd /path/to/virtualenv
$ /path/to/virtualenv/bin/pip install -e git+git://gitlab.opencode.de/fitko/govdata/ckanext-govdatade.git#egg=ckanext-govdatade
$ cd src/ckanext-govdatade
$ /path/to/virtualenv/bin/pip install -r base-requirements.txt -f requirements
$ python setup.py develop
Add the following plugins to your CKAN configuration file:
ckan.plugins = govdatade
The following operations can be run from the command line as described underneath:
(pyenv) $ ckan --config=/etc/ckan/default/production.ini cleanupdb activities
(pyenv) $ ckan --config=/etc/ckan/default/production.ini delete datasets title:"to delete"
(pyenv) $ ckan --config=/etc/ckan/default/production.ini purge deleted
(pyenv) $ ckan --config=/etc/ckan/default/production.ini linkchecker
(pyenv) $ ckan --config=/etc/ckan/default/production.ini report
The commands should be run with the pyenv activated and refer to your CKAN configuration file.
Unit tests are placed in the ckanext/govdatade/tests
directory and can be run with the pytest unit testing framework:
$ cd /path/to/virtualenv/src/ckanext-govdatade
$ pytest