ckanext-nhm
A CKAN extension for the Natural History Museum's Data Portal.
Science Score: 52.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
-
○Academic email domains
-
✓Institutional organization owner
Organization naturalhistorymuseum has institutional domain (www.nhm.ac.uk) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Keywords
Repository
A CKAN extension for the Natural History Museum's Data Portal.
Basic Info
Statistics
- Stars: 30
- Watchers: 9
- Forks: 3
- Open Issues: 56
- Releases: 0
Topics
Metadata Files
README.md
ckanext-nhm
A CKAN extension for the Natural History Museum's Data Portal.
Overview
This extension provides theming and specific functionality for the Natural History Museum's Data Portal.
The codebase shows how to implement various plugins created by the Museum's developers; notably our new ElasticSearch datastore with versioned records.
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
Pre-install setup
This package depends on ckanext-dcat==1.3.0, but since that isn't available on PyPI it's not listed in the package dependencies.
Install it with:
shell
pip install git+https://github.com/ckan/ckanext-dcat@v1.3.0#egg=ckanext-dcat
Installing from PyPI
shell
pip install ckanext-nhm
Installing from source
Clone the repository into the
srcfolder:shell cd $INSTALL_FOLDER/src git clone https://github.com/NaturalHistoryMuseum/ckanext-nhm.gitActivate the virtual env:
shell . $INSTALL_FOLDER/bin/activateInstall via pip:
shell pip install $INSTALL_FOLDER/src/ckanext-nhm
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 'nhm' to the list of plugins in your
$CONFIG_FILE:ini ckan.plugins = ... nhmInstall
lesscglobally:shell npm install -g "less@~4.1"
Configuration
Usage
Actions
record_show
Retrieve an individual record.
```python from ckan.plugins import toolkit
datadict = { 'resourceid': RESOURCEID, 'recordid': RECORDID, 'version': OPTIONALRECORD_VERSION }
toolkit.getaction('recordshow')( context, data_dict ) ```
object_rdf
Get record RDF from its occurrence ID.
```python from ckan.plugins import toolkit
datadict = { 'uuid': OCCURRENCEID, 'version': OPTIONALRECORDVERSION }
toolkit.getaction('objectrdf')( context, data_dict ) ```
Commands
create-dataset-vocabulary
Ensures the default dataset vocabulary and categories exists.
bash
ckan -c $CONFIG_FILE nhm create-dataset-vocabulary
add-dataset-category
Adds the given category to the dataset category vocabulary.
bash
ckan -c $CONFIG_FILE nhm delete-dataset-category $NAME
delete-dataset-category
Deletes the given dataset category from the vocabulary.
bash
ckan -c $CONFIG_FILE nhm create-dataset-vocabulary $NAME
replace-resource-file
Replaces the file associated with $RESOURCE_ID with $PATH, e.g. to replace a small dummy file
with a large one that was too big to upload initially.
bash
ckan -c $CONFIG_FILE nhm replace-resource-file $RESOURCE_ID $PATH
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 --rm 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 Nhm 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-nhm'
abstract: A CKAN extension for the Natural History Museum's Data Portal.
keywords:
- ckan
- ckanext
- nhm
license: GPL-3.0-or-later
version: 7.1.1
GitHub Events
Total
- Create event: 16
- Release event: 9
- Issues event: 16
- Watch event: 5
- Delete event: 11
- Issue comment event: 7
- Push event: 68
- Pull request event: 32
- Fork event: 1
Last Year
- Create event: 16
- Release event: 9
- Issues event: 16
- Watch event: 5
- Delete event: 11
- Issue comment event: 7
- Push event: 68
- Pull request event: 32
- Fork event: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 38
- Total pull requests: 146
- Average time to close issues: 3 months
- Average time to close pull requests: about 19 hours
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.21
- Average comments per pull request: 0.37
- Merged pull requests: 140
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 13
- Pull requests: 41
- Average time to close issues: 25 days
- Average time to close pull requests: about 9 hours
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 0.23
- Average comments per pull request: 0.32
- Merged pull requests: 35
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- alycejenni (28)
- jrdh (12)
Pull Request Authors
- alycejenni (170)
- jrdh (17)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 623 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 77
- Total maintainers: 1
pypi.org: ckanext-nhm
A CKAN extension for the Natural History Museum's Data Portal.
- Documentation: https://ckanext-nhm.readthedocs.io/
- License: GPL-3.0-or-later
-
Latest release: 7.1.1
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- cachetools >=4.2.4
- elasticsearch-dsl >=6.0.0,<7.0.0
- extensions *
- lxml >=4.4.2
- @babel/core ^7.18.2 development
- @babel/plugin-transform-runtime ^7.18.2 development
- @babel/preset-env ^7.18.2 development
- babel-loader ^8.2.5 development
- babel-preset-minify ^0.5.2 development
- css-loader ^3.4.2 development
- file-loader ^4.3.0 development
- less ^3.11.1 development
- less-loader ^5.0.0 development
- style-loader ^1.1.3 development
- vue-loader ^15.9.1 development
- vue-style-loader ^4.1.2 development
- vue-template-compiler ^2.6.11 development
- webpack ^4.46.0 development
- axios ^0.19.2
- babel-runtime ^6.26.0
- json-bigint ^0.3.0
- openseadragon ^2.4.2
- vue ^2.6.11
- vuex ^3.1.2
- @babel/core ^7.8.7 development
- @babel/plugin-transform-runtime ^7.8.3 development
- @babel/preset-env ^7.8.7 development
- babel-loader ^8.0.6 development
- babel-plugin-syntax-dynamic-import ^6.18.0 development
- babel-preset-minify ^0.5.1 development
- css-loader ^3.2.0 development
- file-loader ^4.2.0 development
- style-loader ^1.0.0 development
- vue-loader ^15.8.3 development
- vue-style-loader ^4.1.2 development
- vue-template-compiler ^2.6.11 development
- webpack ^4.41.2 development
- webpack-cli ^3.3.10 development
- webpack-dev-server ^3.9.0 development
- @babel/runtime ^7.8.7
- axios ^0.19.2
- core-js ^3.4.7
- d3-collection ^1.0.7
- flatted ^2.0.1
- imagesloaded ^4.1.4
- json-schema-ref-parser ^7.1.2
- leaflet ^1.6.0
- lz-string ^1.4.4
- masonry-layout ^4.2.2
- pako ^1.0.11
- regenerator-runtime ^0.13.7
- shortid ^2.2.15
- spark-md5 ^3.0.1
- vue ^2.6.11
- vue-clipboard2 ^0.3.1
- vue-images-loaded ^1.1.2
- vue-router ^3.1.6
- vuex ^3.1.2
- vuex-persist ^2.2.0
- 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
- elasticsearch 6.8.13
- mongo 4.2
- redis latest
- 783 dependencies
- beetle-iiif file:assets/scripts/apps/beetle-iiif
- search file:assets/scripts/apps/search
- mkdocs *
- mkdocs-gen-files *
- mkdocs-include-markdown-plugin *
- mkdocs-material *
- mkdocs-section-index *
- mkdocstrings *