Skip to content

okfn/ckanext-ddi

 
 

Repository files navigation

DDI

The Data Documentation Initiative (DDI) is an international standard available at ddialliance.org

ckanext-ddi

Tests codecov

NOTE: This is a heavily customized version for a specific project. If you want more generic support check out the upstream repo: https://github.com/liip/ckanext-ddi


DDI extension for CKAN.

Features:

Installation

Requirement: This extensions runs on CKAN 2.8 or higher.

Use pip to install this plugin. This example installs it in /home/www-data

source /home/www-data/pyenv/bin/activate
pip install -e git+https://github.com/liip/ckanext-ddi.git#egg=ckanext-ddi --src /home/www-data
cd /home/www-data/ckanext-ddi
pip install -r requirements.txt
python setup.py develop

Make sure to add ddi_import to ckan.plugins in your config file.

Make sure

are installed as well.

Configuration

CKAN configuration (production.ini)

Available options are:

ckanext.ddi.default_license = CC0-1.0
ckanext.ddi.allow_duplicates = True
ckanext.ddi.override_datasets = False
ckanext.ddi.default_country_code = UNSPECIFIED

The config_file is simply the path to the DDI-specific configuration of this extension (see below). The default_license allows a user to configure a license that is used for all DDI imports, if the license is not specified explicitly. The allow_duplicates option is used to determine, if duplicate datasets are allowed or not. Duplicates are determined by the unique id_number attribute (defaults to False). With override_datasets you can specify, if you import a dataset that already exists, if a new dataset should be created or if the existing one should be overridden (defaults to False). The default_country_code option will force all datasets to have a country code (defaults to UNSPECIFIED because UNHCR extension use it).

Web interface

Import

If you are logged in and you have the appropriate permissions, you find a new button "Import Dataset from DDI/XML" on the dataset page.

Import Dataset from DDI/XML button

This buttons leads you to an import page, where a DDI XML can either be uploaded or specified as URL.

Import Dataset page

Development

This CKAN extensions uses flake8 to ensure basic code quality.

You can add a pre-commit hook when you have installed flake8:

flake8 --install-hook

Travis CI is used to check the code for all PRs.

Acknowledgements

This module was developed with support from the World Bank to provide a solution for National Statistical Offices (NSOs) that need to publish data on CKAN platforms.

About

CKAN extension for DDI, developed for the World Bank

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 72.2%
  • JavaScript 14.1%
  • HTML 13.7%