A MongoDB DataStoreBackend implementation, that supports data citation.
Project description
.. image:: https://travis-ci.org/fwoerister/ckanext-mongodatastore.svg?branch=master :target: https://travis-ci.org/fwoerister/ckanext-mongodatastore
.. image:: https://coveralls.io/repos/github/fwoerister/ckanext-mongodatastore/badge.svg?branch=master :target: https://coveralls.io/github/fwoerister/ckanext-mongodatastore?branch=master
.. image:: https://pypip.in/version/ckanext-mongodatastore/badge.svg :target: https://pypi.python.org/pypi/ckanext-mongodatastore/ :alt: Latest Version
.. image:: https://pypip.in/py_versions/ckanext-mongodatastore/badge.svg :target: https://pypi.python.org/pypi/ckanext-mongodatastore/ :alt: Supported Python versions
.. image:: https://pypip.in/status/ckanext-mongodatastore/badge.svg :target: https://pypi.python.org/pypi/ckanext-mongodatastore/ :alt: Development Status
.. image:: https://pypip.in/license/ckanext-mongodatastore/badge.svg :target: https://pypi.python.org/pypi/ckanext-mongodatastore/ :alt: License
====================== ckanext-mongodatastore
The MongoDatastore is a datastore implementation for CKAN <https://www.ckan.org>
, that uses MongoDB for storing data records. One aspect of this implementation is, that it follows the RDA Recommendations for Data Citation <https://doi.org/10.15497/RDA00016>
. This guarantiees citability for every query that is submited to the datastore. In addition this extension is capable of pulling datasets from an existing datasource (e.g. a relational database) into the datastore. A IDatasource Interface enables ckan extension developers to implement their own DataSource. This extension comes with an Postgre DataSource implementation as a proof of concept. For a more detailed explanation check out the Wiki <https://github.com/fwoerister/ckanext-mongodatastore/wiki>
_.
.. image:: images/BigPicture.png :align: center
As this extension provides an implementation of the IDatastoreBackend <https://docs.ckan.org/en/latest/maintaining/datastore.html#extending-datastore>
_, therefore the DataStore API can be used as before.
Although after installation of this extension the result sets will contain a PID, the resource view needs to be able to show this PID in the UI. The default DataExplorer is not capable of showing PIDs, please checkout my PoC implementation on github <https://github.com/fwoerister/ckanext-datacitator>
_.
Requirements
This CKAN extension is tested with CKAN 2.7 running on Python 2.7.
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
.. Add any additional install steps to the list below. For example installing any non-Python dependencies or adding any required config settings.
To install ckanext-mongodatastore:
-
Install MongoDB <https://docs.mongodb.com/manual/installation/>
_ -
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
). -
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::
ckan.datastore.write_url = mongodb://[datastorehost]:27017
ckan.querystore.url = [URL to your query store database]
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
Releasing a New Version of ckanext-mongodatastore
ckanext-mongodatastore is availabe on PyPI as https://pypi.python.org/pypi/ckanext-mongodatastore. To publish a new version to PyPI follow these steps:
-
Update the version number in the
setup.py
file. SeePEP 440 <http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers>
_ for how to choose version numbers. -
Create a source distribution of the new version::
python setup.py sdist
-
Upload the source distribution to PyPI::
python setup.py sdist upload
-
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 0.0.2 then do::git tag 0.0.2 git push --tags
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.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a39b7b8fe997d86f3fe8067d6892a727d036da35981261a72ef7d0632ad01694 |
|
MD5 | 3bb404fa2851a6f4fdc9967ceeec74b9 |
|
BLAKE2b-256 | 9982d7b84d328cb4b9a1090a3fb6b84c80850adbbf61f1d13abb0f951f8442ae |
Hashes for ckanext_mongodatastore-0.0.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5f7452b004776f116e80c92162412d9f55fe5e4dae64f62e87bbce28644463 |
|
MD5 | 764a5ff0c1dcec87474c0710f79eeb74 |
|
BLAKE2b-256 | 37cf2ac4b0bbe688013214e863555c430334568c3790a8bfe33055b01187c42e |