A CKAN extension for assigning Archival Resource Key (ARK) identifiers to datasets.
Project description
ckanext-ark
This extension provides minter and resolver of the ARK Identifier. Inspired by ckanext-doi.
Requirements
Compatibility with core CKAN versions:
CKAN version | Compatible? |
---|---|
2.8 and earlier | no |
2.9 | yes |
2.10 | yes |
This extension is compatible with Python 3.8, 3.9, and 3.10.
Installation
To install ckanext-ark:
- Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
- Install the ckanext-ark Python package into your virtual environment:
pip install ckanext-ark
-
Add
ark
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini
). -
Add a file
templates/package/read_base.html
in your custom extension (or modify/usr/lib/ckan/default/src/ckan/ckan/templates/package/read_base.html
if you are not using a custom extension):
{% ckan_extends %}
{% block secondary_content %}
{{ super() }}
{% snippet "ark/snippets/ark.html" %}
{% endblock %}
- Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
- Initialize the database:
ckan -c /etc/ckan/default/ckan.ini ark initdb
Development Installation
To install ckanext-ark for development, activate your CKAN virtualenv and do:
git clone https://github.com/depositar/ckanext-ark.git
cd ckanext-ark
python setup.py develop
pip install -r dev-requirements.txt
Config settings
ARK NAAN [REQUIRED]
You can request a Name Assigning Authority Number (NAAN) through this form.
ckanext.ark.naan = 99999 # This NAAN is for test purpose only
Other ARK configs
Name | Description | Default |
---|---|---|
ckanext.ark.nma_url |
The URL of NMA (Name Mapping Authority) | The same URL as ckan.site_url |
ckanext.ark.shoulder |
The Shoulder for subdividing a NAAN namespace | |
ckanext.ark.template |
The template for generating ARKs | zek |
ERC record (ARK metadata) configs
Name | Description | Default |
---|---|---|
ckanext.ark.erc_mappings |
A mapping from ERC record to CKAN fields[^mapping_when] | {"who": "author", "what": "title", "when": ""} |
ckanext.ark.allow_missing_erc |
This controls if still assigning ARKs even if the fields defined in the ckanext.ark.erc_mappings is missing or empty[^missing_when] |
True |
ckanext.ark.erc_support.who |
Who made the ARK support commitment | |
ckanext.ark.erc_support.what |
What the nature of the ARK support commitment was | |
ckanext.ark.erc_support.when |
When the ARK support commitment was made | |
ckanext.ark.erc_support.commitment |
A fuller explanation of the ARK support commitment |
[^mapping_when]: For the mapping of when
field, the ISO 8601 YYYY-MM-DD is recommended. The date string will be converted to Temporal Enumerated Ranges (TEMPER) format (YYYYMMDD-YYYYMMDD). Note that the date validation is omitted.
[^missing_when]: For the when
field, a list containing a single value is not viewed as an empty value.
Commands
ark
delete-ark
: delete ARK identifier for existed dataset. Accept package's id (name) and ARK identifier (with and withoutark:
).
ckan -c /etc/ckan/default/ckan.ini ark delete-ark [NAME]
update-ark
: give ARK identifiers to existed datasets.
ckan -c /etc/ckan/default/ckan.ini ark update-ark
Tests
To run the tests, do:
pytest --ckan-ini=test.ini
Releasing a new version of ckanext-ark
ckanext-ark is available on PyPI as https://pypi.python.org/pypi/ckanext-ark. You can follow these steps to publish a new version:
-
Update the version number in the
setup.py
file. See PEP 440 for how to choose version numbers. -
Make sure you have the latest version of necessary packages:
pip install --upgrade build twine
- Create a source and binary distributions of the new version:
python -m build
Fix any errors you get.
- Upload the source distribution to PyPI:
twine upload dist/*
- Commit any outstanding changes:
git commit -a
git push
- Tag the new release of the project on GitHub with the version number from
the
setup.py
file. For example if the version number insetup.py
is 1.0.1 then do:
git tag v1.0.1
git push --tags
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ckanext_ark-1.0.3.tar.gz
.
File metadata
- Download URL: ckanext_ark-1.0.3.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e7ccbb07cbf6f941eb73018f27240823eb044fbb447a6d6a52c9dc48b4c1245 |
|
MD5 | 8af20f1860ed7788673cd96173520619 |
|
BLAKE2b-256 | 971b6ef82b5b90d7e86f9f892817a75a3aec3e974a36e0179ed031039bd0424a |
File details
Details for the file ckanext_ark-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: ckanext_ark-1.0.3-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859b961571a0fb3faecc6351515bdb1629418b30397cac24620819c196640e1b |
|
MD5 | 20d56bf4b3d0921fed6dbd8fc4c5458a |
|
BLAKE2b-256 | 7ec27f707cc1029396e2cb61d0a0dec11c84e95b3d957a580dc3352130d5c48c |