A MongoDB DataStoreBackend implementation, that supports data citation.
Project description
ckanext-mongodatastore
This plugin provides a datastore implementation for CKAN, based on MongoDB for storing data records. One aspect of this implementation is, that it follows the RDA Recommendations for Data Citation. This guarantiees citability for every query that is submited to the datastore.
As this extension provides an implementation of the IDatastoreBackend, therefore the DataStore API can be used as before.
Requirements
This CKAN extension is tested with CKAN 2.9.0 running on Python 3.8.2.
To run this plugin beside an CKAN a mongo and a postgre database is required. The mongo database is needed for storing the data records and the postgre database is used as a querystore, described in the RDA Recommendations. For both instances a connection string has to be set in the CKAN config file.
Installation
To install ckanext-mongodatastore:
-
Install MongoDB
-
If not already existing, a QueryStore database has to be created::
sudo -u postgres createuser -S -D -R -P querystore
sudo -u postgres createdb -O querystore querystore -E utf-8
- Activate your CKAN virtual environment, for example::
. /usr/lib/ckan/default/bin/activate
- Install the ckanext-mongodatastore Python package into your virtual environment:
pip install ckanext-mongodatastore
-
Set the ckanext-mongodatastore specific config settings the CKAN configuration file (by default the config file is located at
/etc/ckan/default/production.ini
). -
Add
mongodatastore
to theckan.plugins
setting in your CKAN config file (by default the config file is located at/etc/ckan/default/production.ini
). -
Initialize the query store with the custom click command
create_schema
ckan -c "/etc/ckan/default/production.ini" create_schema
-
Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu::
sudo service apache2 reload
Config Settings
For running the MongoDb datastore two settings have to configured in your CKAN's configuration file::
Name | Description | Default |
---|---|---|
ckanext.mongodatastore.mongodb_url |
URL pointing to the MongoDB instance | |
ckanext.mongodatastore.querystore_url |
URL pointing to the QueryStore database | |
ckanext.mongodatastore.sharding_enabled |
If a sharded MongoDB instance is used, the sharding feature has to be enabled | False |
ckanext.mongodatastore.database_name |
Name of the MongoDB database, that contains all resource collections | CKAN_Datastore |
Development Installation
To install ckanext-mongodatastore for development, activate your CKAN virtualenv and do::
git clone https://github.com/fwoerister/ckanext-mongodatastore.git
cd ckanext-mongodatastore
python setup.py develop
pip install -r dev-requirements.txt
Running the Tests
To run the tests, do::
nosetests --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 --nologcapture --with-pylons=test.ini --with-coverage --cover-package=ckanext.mongodatastore --cover-inclusive --cover-erase --cover-tests
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
Hashes for ckanext-mongodatastore-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4961e80c61dcc066e582953e3e9d4fc1c765501b585d72575b64183f0b1bd87a |
|
MD5 | a69df8e2debbb52deb0060971912bbee |
|
BLAKE2b-256 | 9e42299a8b4603163919a6d2cdfe5a1122489e6ab6acb7fec73eee0faa0a246f |
Hashes for ckanext_mongodatastore-0.1.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb15ce3b84d2c2ce4a59bd86784ef2be1e7e066e3f64289929824198f7c4d7ce |
|
MD5 | 9159cac17eded92177639b1bf24def98 |
|
BLAKE2b-256 | 04c8e12d988d6d7b5af168e884c96d0da7cb81cb91fca0a80bb8931fec1e74c0 |