Skip to content

Mazen-B/ckanext-gitimport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate

  2. 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

  3. 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).

  4. 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 plugin:

  1. In your CKAN instance, access the "GitHub Import" button in navigation bar.
  2. Then click on "Add GitHub" where you will find the template.
  3. Enter the GitHub repository name (e.g., Mazen-B/ckanext-gitimport) in the provided template field then press the "Fetch Metadata" button.
  4. The plugin will then fetch and display the repository metadata.

Note

This plugin is designed to work with the "GitHub" template, which is created using the ckanext-scheming extension. The template consists of a YAML file that details the schema and the necessary HTML files. Ensure that ckanext-scheming is also installed and properly configured in your CKAN instance.

About

This plugin imports metadata from GitHub into CKAN

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors