A CKAN plugin to import multiple JSON-based datasets in bulk by uploading a ZIP file through a user-friendly form interface. Supports real-time status tracking and controlled access (admin-only).
Only admin users can access the DatasetImporter interface. You'll find a new button near the "Batch Import" button.
You will need to:
- 📁 Upload a ZIP file: containing one or more JSON dataset metadata files.
- 🏢 Select an organization: this will be the owner of all datasets.
- 🏷️ Enter a prefix: added before each dataset name to ensure uniqueness.
- 🗂️ Enter repository name: to tag all datasets accordingly.
After clicking Submit:
- You’ll see a unique status link.
- Copy and bookmark it if needed.
- Visit it anytime to see how your upload is progressing.
- CKAN 2.9+
- Docker-based CKAN setup recommended
-
Clone this plugin into your extensions directory:
git clone https://github.com/SDM-TIB/ckanext-datasetimporter ckanext-datasetimporter
-
Install the plugin:
pip install -e .
-
Enable it in your CKAN config:
ckan.plugins = datasetimporter
-
Rebuild the CKAN container:
docker compose restart ckan
-
(Optional) Create the
/srv/app/tmp
andLOG/
folders if not present. -
Overwrite the following file to integrate the DatasetImporter button: Replace:
src/ckanext-gitImport/ckanext/gitimport/templates/snippets/add_dataset.html
with:
additions/add_dataset.html
ckanext-datasetimporter/
│
├── templates/
│ └── datasetimporter/
│ ├── form.html # The upload form
│ └── status.html # The status tracker
│
├── public/
│ └── js/
│ └── form_logic.js # JS logic for frontend updates
│
├── logic/
│ └── insert.py # Core logic to process and insert datasets
│
├── views.py # Flask Blueprint endpoints
└── plugin.py # CKAN plugin class
- The plugin checks that only sysadmin users can access the form.
- Non-admins will receive a 403 message with instructions to contact the site admin.
Contributions are welcome. Fork the repo and open a pull request.