ckanext-gitimport
The CKAN GitImport Plugin enables users to fetch and display GitHub repository metadata within a specialized “GitHub” template in the CKAN user interface. After the metadata is displayed, it can be stored within CKAN datasets. This plugin streamlines the process of linking GitHub repositories with CKAN datasets, making it more efficient and user-friendly.
Features
- Fetch GitHub Repository Metadata: Automatically retrieves metadata from GitHub repositories by simply adding the repository name then pressing the “Fetch Metadata” button.
- Dynamic Field Population: Dynamically populates CKAN dataset fields with fetched GitHub metadata, such as contributors, topics, etc., as needed.
- User-Friendly Interface: Seamlessly integrates with CKAN’s UI.
Requirements
Compatibility with core CKAN versions:
| CKAN version |
Compatible? |
| 2.10 |
yes |
| 2.9 and earlier |
not tested |
Installation
To install ckanext-gitimport:
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
Clone the source and install it on the virtualenv
git clone https://github.com/Mazen-B/ckanext-gitimport.git
cd ckanext-gitimport
pip install -e .
pip install -r requirements.txt
Add gitImport to the ckan.plugins setting in your CKAN
config file (by default the config file is located at
/etc/ckan/default/ckan.ini).
Restart CKAN. For example if you’ve deployed CKAN with Apache on Ubuntu:
sudo service apache2 reload
Config settings
The plugin requires a GitHub access token to fetch repository data. Please ensure that the token is valid as they usually expire after a certain time. You will need to regenerate a new token periodically to maintain functionality.
Add your GitHub access token to the CKAN config file:
ckanext.gitimport.github_access_token = YOUR_GITHUB_ACCESS_TOKEN
Usage
To use the plu