ckanext-gbif
A CKAN extension that connects with the GBIF API.
Overview
This extension retrieves additional data (e.g. DQIs) from the GBIF API for a record with an associated GBIF ID.
This extension also provides some templates for displaying these data.
Installation
Installing from PyPI
pip install ckanext-gbif
Installing from source
Clone the repository into the src folder:
cd $INSTALL_FOLDER/src
git clone https://github.com/NaturalHistoryMuseum/ckanext-gbif.git
Activate the virtual env:
. $INSTALL_FOLDER/bin/activate
Install via pip:
pip install $INSTALL_FOLDER/src/ckanext-gbif
Post-install setup
Add ‘gbif’ to the list of plugins in your config:
ckan.plugins = ... gbif
Install lessc globally:
npm install -g "less@~4.1"
Configuration
Template variables [REQUIRED]
| Option |
Description |
| ckanext.gbif.organisation_key |
For linking to the dataset publisher (https://gbif.org/publisher/ORG_KEY) |
| ckanext.gbif.dataset_key |
For linking to the dataset itself (https://gbif.org/dataset/DATA_KEY) |
Usage
Actions
gbif_record_show
Get the associated GBIF data for a record.
from ckan.plugins import toolkit
gbif_record = toolkit.get_action(u'gbif_record_show')(context, {
u'occurrence_id': record_gbif_occurrence_id
})
Templates
The templates inherit from record/specimen.html and record/dwc.html and will insert a link to the GBIF view in the content_primary_nav block.