ckanext-statsresources |
Reports with different stats from your CKAN instance
https://github.com/datagovuk/ckanext-report
To install ckanext-statsresources for development, activate your CKAN virtualenv and do:
git clone https://github.com/smotornyuk/ckanext-statsresources.git
cd ckanext-statsresources
python setup.py develop
pip install -r dev-requirements.txt
reports.strict_access = true|false
- if set to True, then just sysadmin allowed to visit /reports pages. Default value: False
statsresources.report_map = REPORT_NAME:FORMAT:PACKAGE_ID:RESOURCE_TITLE
- allows multiple values(each from new line). Configure endpoints of paster statsresources generate command For example:: statsresources.report_map = dataset_creation:json:1234-1234-1234-1234:Dataset creation dates JSON dataset_creation:csv:1234-1234-1234-1234:Dataset creation dates CSV
By default, reports are generated with default options(as report without any additional option checked). This can be configured by specifying directive _statsresources.{report-name}.options with options in format _option:value (every option from new line):
- statsresources.dataset_creation.options =
include_private:false include_draft:true
Run:
paster statsresources list -c path/to/config/file.ini #show list of all stat resoruces that will be generated
paster statsresources generate -c path/to/config/file.ini #create/update corresponding resources
To run the tests, do:
nosetests --nologcapture --with-pylons=test.ini
To run the tests and produce a coverage report, first make sure you have coverage installed in your virtualenv (pip install coverage
) then run:
nosetests --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.statsresources --cover-inclusive --cover-erase --cover-tests