A ckan extension to showcase datasets in use
Project description
ckanext-showcase
Showcase and link to datasets in use. Datasets used in an app, website or visualization, or featured in an article, report or blog post can be showcased within the CKAN website. Showcases can include an image, description, tags and external link. Showcases may contain several datasets, helping users discover related datasets being used together. Showcases can be discovered by searching and filtered by tag.
Site sysadmins can promote selected users to become ‘Showcase Admins’ to help create, populate and maintain showcases.
ckanext-showcase is intended to be a more powerful replacement for the ‘Related Item’ feature.
Requirements
Compatible with CKAN 2.3+.
Installation
To install ckanext-showcase:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Install the ckanext-showcase Python package into your virtual environment:
pip install ckanext-showcase
Add showcase to the ckan.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
Development Installation
To install ckanext-showcase for development, activate your CKAN virtualenv and do:
git clone https://github.com/ckan/ckanext-showcase.git cd ckanext-showcase python setup.py develop pip install -r dev-requirements.txt
API
All actions in the Showcase extension are available in the CKAN Action API.
Showcase actions:
- create a new showcase (sysadmins and showcase admins only) curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_create -H "Authorization:{YOUR-API-KEY}" -d '{"name": "my-new-showcase"}' - delete a showcase (sysadmins and showcase admins only) curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_delete -H "Authorization:{YOUR-API-KEY}" -d '{"name": "my-new-showcase"}' - show a showcase curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_show -d '{"id": "my-new-showcase"}' - list showcases curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_list -d ''
Dataset actions:
- add a dataset to a showcase (sysadmins and showcase admins only) curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_package_association_create -H "Authorization:{YOUR-API-KEY}" -d '{"showcase_id": "my-showcase", "package_id": "my-package"}' - remove a dataset from a showcase (sysadmins and showcase admins only) curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_package_association_delete -H "Authorization:{YOUR-API-KEY}" -d '{"showcase_id": "my-showcase", "package_id": "my-package"}' - list datasets in a showcase curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_package_list -d '{"showcase_id": "my-showcase"}' - list showcases featuring a given dataset curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_package_showcase_list -d '{"package_id": "my-package"}'
Showcase admin actions:
- add showcase admin (sysadmins only) curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_admin_add -H "Authorization:{YOUR-API-KEY}" -d '{"username": "bert"}' - remove showcase admin (sysadmins only) curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_admin_remove -H "Authorization:{YOUR-API-KEY}" -d '{"username": "bert"}' - list showcase admins (sysadmins only) curl -X POST http://127.0.0.1:5000/api/3/action/ckanext_showcase_admin_list -H "Authorization:{YOUR-API-KEY}" -d ''
Running the Tests
To run the tests, do:
nosetests --ckan --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 --ckan --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.showcase --cover-inclusive --cover-erase --cover-tests
Registering ckanext-showcase on PyPI
ckanext-showcase should be availabe on PyPI as https://pypi-hypernode.com/pypi/ckanext-showcase. If that link doesn’t work, then you can register the project on PyPI for the first time by following these steps:
Create a source distribution of the project:
python setup.py sdist
Register the project:
python setup.py register
Upload the source distribution to PyPI:
python setup.py sdist upload
Tag the first release of the project on GitHub with the version number from the setup.py file. For example if the version number in setup.py is 0.0.1 then do:
git tag 0.0.1 git push --tags
Releasing a New Version of ckanext-showcase
ckanext-showcase is availabe on PyPI as https://pypi-hypernode.com/pypi/ckanext-showcase. To publish a new version to PyPI follow these steps:
Update the version number in the setup.py file. See PEP 440 for how to choose version numbers.
Create a source distribution of the new version:
python setup.py sdist
Upload the source distribution to PyPI:
python setup.py sdist upload
Tag the new release of the project on GitHub with the version number from the setup.py file. For example if the version number in setup.py is 0.0.2 then do:
git tag 0.0.2 git push --tags
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ckanext-showcase-1.0.2.tar.gz
.
File metadata
- Download URL: ckanext-showcase-1.0.2.tar.gz
- Upload date:
- Size: 39.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a0f32453da235a100e3ea2712cb743f8677228ea4d6d1a7cc912102d72bce98 |
|
MD5 | 4bbde6039b084a1b298a2aa8d48f1c96 |
|
BLAKE2b-256 | 9b7edc9e80ee91891bc3204a1a4f3305cf7509dd666a2df44a5c2ae106651994 |