ckanext-gallery
CKAN extension for a dataset gallery view.
Science Score: 62.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 7 committers (28.6%) from academic institutions -
✓Institutional organization owner
Organization naturalhistorymuseum has institutional domain (www.nhm.ac.uk) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.6%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
CKAN extension for a dataset gallery view.
Basic Info
Statistics
- Stars: 4
- Watchers: 10
- Forks: 4
- Open Issues: 1
- Releases: 22
Topics
Metadata Files
README.md
ckanext-gallery
A CKAN extension for a dataset gallery view.
Overview
Adds a gallery view for resources on a CKAN instance. Three plugins are included in this extension: the main plugin (gallery) and two view plugins for specific image/data types (gallery_image and gallery_iiif).
Based on blueimp Gallery.
Installation
Path variables used below:
- $INSTALL_FOLDER (i.e. where CKAN is installed), e.g. /usr/lib/ckan/default
- $CONFIG_FILE, e.g. /etc/ckan/default/development.ini
Installing from PyPI
shell
pip install ckanext-gallery
Installing from source
Clone the repository into the
srcfolder:shell cd $INSTALL_FOLDER/src git clone https://github.com/NaturalHistoryMuseum/ckanext-gallery.gitActivate the virtual env:
shell . $INSTALL_FOLDER/bin/activateInstall via pip:
shell pip install $INSTALL_FOLDER/src/ckanext-gallery
Installing in editable mode
Installing from a pyproject.toml in editable mode (i.e. pip install -e) requires setuptools>=64; however, CKAN 2.9 requires setuptools==44.1.0. See our CKAN fork for a version of v2.9 that uses an updated setuptools if this functionality is something you need.
Post-install setup
Add 'gallery' to the list of plugins in your
$CONFIG_FILE:ini ckan.plugins = ... galleryInstall
lesscglobally:shell npm install -g "less@~4.1"
Configuration
There's only one option that can be specified in the .ini file:
| Name | Description | Default |
|------------------------------------|---------------------------------------|---------|
| ckanext.gallery.records_per_page | Number of images to display on a page | 32 |
Usage
To use as a view, no further setup is needed; the 'Gallery' type should be available for resources after installing the plugin.
Interfaces
The IGalleryImage interface allows plugins to override settings.
```python from ckan.plugins import SingletonPlugin, implements from ckanext.gallery.plugins.interfaces import IGalleryImage
class YourPlugin(SingletonPlugin): implements(IGalleryImage)
def imageinfo(self): ''' Return info for this plugin. If resource type is set, only datasets of that type will be available. ''' return {u'title': u'Text', u'resourcetype': [u'csv', u'tsv'], u'field_type': [u'text']}
def getimages(self, fieldvalue, record, datadict): ''' Process images from a single record to return custom metadata. The fieldvalue depends on the image field you choose. ''' images = [{ u'href': fieldvalue[u'url'], u'thumbnail': fieldvalue[u'url'].replace(u'preview', u'thumbnail'), u'recordid': record[u'id'] } for img in field_value] return image ```
Templates
Gallery block snippet
html+jinja
{% snippet 'gallery/snippets/gallery.html', images=g.images, resource_id=res.id %}
Testing
There is a Docker compose configuration available in this repository to make it easier to run tests. The ckan image uses the Dockerfile in the docker/ folder.
To run the tests against ckan 2.9.x on Python3:
Build the required images:
shell docker compose buildThen run the tests. The root of the repository is mounted into the ckan container as a volume by the Docker compose configuration, so you should only need to rebuild the ckan image if you change the extension's dependencies.
shell docker compose run ckan
Owner
- Name: Natural History Museum
- Login: NaturalHistoryMuseum
- Kind: organization
- Location: London
- Website: https://www.nhm.ac.uk
- Repositories: 171
- Profile: https://github.com/NaturalHistoryMuseum
Citation (CITATION.cff)
cff-version: 1.2.0
title: CKAN Gallery extension
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- name: Natural History Museum
city: London
country: GB
alias: NHM
email: data@nhm.ac.uk
repository-code: 'https://github.com/NaturalHistoryMuseum/ckanext-gallery'
abstract: A CKAN extension for a dataset gallery view.
keywords:
- ckan
- ckanext
- gallery
license: GPL-3.0-or-later
version: 3.0.5
GitHub Events
Total
- Create event: 5
- Issues event: 2
- Release event: 3
- Delete event: 5
- Member event: 1
- Issue comment event: 4
- Push event: 24
- Pull request event: 16
Last Year
- Create event: 5
- Issues event: 2
- Release event: 3
- Delete event: 5
- Member event: 1
- Issue comment event: 4
- Push event: 24
- Pull request event: 16
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 139
- Total Committers: 7
- Avg Commits per committer: 19.857
- Development Distribution Score (DDS): 0.619
Top Committers
| Name | Commits | |
|---|---|---|
| benscott | b****n@b****k | 53 |
| Alice Butcher | a****i@g****m | 48 |
| Josh Humphries | j****s@n****k | 23 |
| github-actions[bot] | g****]@u****m | 7 |
| dependabot[bot] | 4****]@u****m | 4 |
| Alice Heaton | a****n@n****k | 3 |
| vagrant | v****t@c****r | 1 |
Committer Domains (Top 20 + Academic)
Packages
- Total packages: 1
-
Total downloads:
- pypi 197 last-month
- Total dependent packages: 1
- Total dependent repositories: 0
- Total versions: 17
- Total maintainers: 1
pypi.org: ckanext-gallery
A CKAN extension for a dataset gallery view.
- Documentation: https://ckanext-gallery.readthedocs.io/
- License: GPL-3.0-or-later
-
Latest release: 3.0.5
published 9 months ago
Rankings
Maintainers (1)
Dependencies
- less 1.4.2 development
- uglify-js 2.4.0 development
- less 1.5.0-b3 development
- uglify-js 2.4.0 development
- commitplease 2.3.0 development
- grunt 0.4.5 development
- grunt-bowercopy 1.2.4 development
- grunt-cli 0.1.13 development
- grunt-compare-size 0.4.0 development
- grunt-contrib-concat 0.5.1 development
- grunt-contrib-csslint 0.5.0 development
- grunt-contrib-jshint 0.12.0 development
- grunt-contrib-qunit 1.0.1 development
- grunt-contrib-requirejs 0.4.4 development
- grunt-contrib-uglify 0.11.1 development
- grunt-git-authors 3.1.0 development
- grunt-html 6.0.0 development
- grunt-jscs 2.1.0 development
- load-grunt-tasks 3.4.0 development
- rimraf 2.5.1 development
- testswarm 1.1.0 development
- actions/checkout v3 composite
- commitizen-tools/commitizen-action master composite
- softprops/action-gh-release v1 composite
- actions/checkout v3 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- naturalhistorymuseum/ckantest 0.2 build
- ckan/ckan-solr 2.9
- redis latest
- mkdocs *
- mkdocs-gen-files *
- mkdocs-include-markdown-plugin *
- mkdocs-material *
- mkdocs-section-index *
- mkdocstrings *
- ckantools >=0.3.0