Extension DIA New Zealand CKAN Extensions


Extension Basics

Title
DIA New Zealand CKAN Extensions
Name
ckanext-dia
Type
Public extension
Description
This extension holds all overrides to CKAN required by the DIA (Department of Internal Affairs) for New Zealand's data.govt.nz portal. It provides multiple plugins: 'diavalidation' exposes extra validators like natural_num_or_missing, 'diaschema' provides DIA-related changes to CKAN schema, 'diaharvester' provides overrides for CSW harvester (must be enabled before csw_harvester), 'diadcatjsonharvester' provides overrides for DCAT JSON harvester (replaces dcat_json_harvester), 'dianohomepage' redirects CKAN homepage to /dataset, 'diacommands' provides CLI commands for CKAN 2.9+, and 'diauriminting' provides URI minting functionality for linked datasets (CKAN 2.9+ only). Includes datastore cleanup command. As of version 1.3.0 the extension works with CKAN 2.9+, for older versions use tag 1.2.0.
CKAN versions
Download-Url (zip)
Last commit
25 days ago (2026-02-12 00:56:29)
Url to repo
Category
Regional Government Themes


Background Infos

Description (long)
Show details

CKANEXT-DIA

CKAN < 2.9 support

As of 1.3.0 this extention has been made to work with CKAN 2.9. While attempts have been made to maintain compatibility with prior version of CKAN, there may be issues. If any issues are discovered we are happy to accept PRs. Alternatively for compatibility <2.9 the 1.2.0 tag can be used.

What am I?

A simple CKAN extension to hold all overrides to CKAN required by the DIA (Department of Internal Affairs).

How to install?

It is expected that you will have these other CKAN extensions installed:

  • ckanext-spatial
  • ckanext-dcat
  • ckanext-harvester

You can use pip to install this plugin into your virtual environment:

pip install -e 'https://github.com/data-govt-nz/ckanext-dia.git#egg=ckanext-dia==1.0.0'

You can also install the specific dependencies using the appropriate requirements.txt file for your version of Python.

Manual Testing for Harvesting Modifications

When working on the dcat.json or CSW harvesting extensions you often need to load testing data, you can use the following paster command to re-harvest an existing dataset:

docker compose run ckan-fetch ckan harvester import -p 'reefton-goldfield-sheet-12-part-of-waitahu-survey-district-and-pohaturoa-survey-district-field-1'

where reefton-goldfield... is the dataset id in the url, this may also look like a guid, both will work.

How to activate plugins?

All plugins need to be added to ckan.plugins in your config file. Available plugins are:

  • diavalidation – Exposes extra validators, such as natural_num_or_missing
  • diaschema – DIA-related changes to CKAN schema
  • diaharvester – Overrides for the CSW harvester, needs to be enabled before csw_harvester
  • diadcatjsonharvester – Overrides for the DCAT JSON harvester, needs to be enabled instead of dcat_json_harvester
  • dianohomepage – Redirect the CKAN homepage to /dataset
  • diacommands – Provides cli commands (only needed on ckan >= 2.9)
  • `diaur
Version
1.3.0
Version release date
(not set)
Contact name
data-govt-nz
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints
Plugins to configure (ckan.ini)
dia
CKAN Settings (ckan.ini)
DB migration to be executed
(not set)
<< back to Extensions