Giter VIP home page Giter VIP logo

ckan_connect's Introduction

CKAN Connect

CKAN connect is a Drupal 8/9 companion module for the Data Visualisation Framework (DVF) module. Its goal is to provide CKAN connectivity and abstract API calls. Other modules can use CKAN connect if they need CKAN connectivity from Drupal and it does not require DVF to function.

CKAN is the industry standard for large dataset storage and is used by most governments for public data storage. It provides a robust API for retrieving data records with support for filtering, searching and more.

Examples of CKAN instances:

Install and configure

Install

CKAN connect is ideally installed via composer

composer require drupal/ckan_connect

Then enabled via Drupal UI or drush

drush en ckan_connect

Configure

Once installed you must set the Base URL for the CKAN instance.

  • Visit: Admin > Configuration > Webservices > CKAN Connect (/admin/config/services/ckan-connect)
  • Set the API url to match your CKAN instance eg. https://data.gov.au/api/3
  • If you need write access to CKAN or you need to view private datasets then you can also add an API key. Note the security implications here, you could potentially expose private data on your Drupal site when an API key is used

CKAN Connect API

Add as dependency

If your module requires CKAN Connect, ensure dependencies are added

composer.json

"require": {
    "drupal/ckan_connect": "*"
}

module.info.yml

dependencies:
  - ckan_connect:ckan_connect

Usage

The CkanClientInterface documents available methods, but most of the time you will only need the get() method. This will make an API call to a specific endpoint with the appropriate query parameters added.

Example of querying the action/datastore_search endpoint:

use Drupal\ckan_connect\Client\CkanClientInterface;

$client = new CkanClientInterface();

$response = $client->get('action/datastore_search', [
  'id' => 'da675507-10b5-4825-8e79-09dcbb577ece',
  'limit' => 10,
  'offset' => 0,
]);

if ($response->success === TRUE) {
  var_dump($response->result);
}

View the CKAN API docs for more information on available endpoints and query parameters.

Issues and feature suggestions

Development of CKAN Connect is currently occurring over at GitHub

Issues are ideally logged in the Github issue queue but we also monitor the Drupal issue queue

Contributing and extending CKAN Connect

We welcome (and appreciate) improvements and fixes to CKAN Connect, so if you have something to add please submit a Github pull request.

Supporting organizations

Primary Developers

Doghouse Agency

Sponsors

ckan_connect's People

Contributors

jez500 avatar suhyeonh avatar thery-dh avatar wilsonwu2100 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckan_connect's Issues

Make ckan_connect able to handle multiple ckan instances

Currently we're able to use one ckan at a time - what if a site needs to access data on two different servers - can we implement a way to add more (and more APIs), and then either explictly reference them in the app (dvf) or seamlessly check them against the url's provided?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.