Project

nice

0.0
No release in over 3 years
A Ruby gem for accessing and managing OpenData from Nice Côte d'Azur metropolitan area via CKAN API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 0.14
~> 3.10
~> 13.0
~> 3.12
~> 1.50
~> 6.0
~> 3.0

Runtime

>= 0
~> 0.21
~> 2.6
 Project Readme

nice

A Ruby gem for accessing and managing OpenData from Nice Côte d'Azur (NCA) metropolitan area via CKAN API.

Installation

Add this line to your application's Gemfile:

gem 'nice'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install nice

Configuration

Configure the gem with your CKAN instance URL and API key:

require 'nice'

Nice.configure do |config|
  config.ckan_url = "https://opendata.nicecotedazur.org/data/"
  config.api_key = "your-api-key-here"
end

Alternatively, set environment variables:

export NICE_CKAN_URL="https://opendata.nicecotedazur.org/data/"
export NICE_CKAN_API_KEY="your-api-key-here"

Usage

Create a client

client = Nice::Client.new

Or with direct credentials:

client = Nice::Client.new(
  ckan_url: "https://opendata.nicecotedazur.org/data/",
  api_key: "your-api-key-here"
)

List packages (datasets)

packages = client.list_packages
puts "Found #{packages.count} packages"

Search for datasets

results = client.search_packages("transport")
puts "Found #{results['count']} matches"

Get package details

package = client.get_package("package-id")
puts package['title']

List organizations

organizations = client.list_organizations

Get organization details

org = client.get_organization("organization-id")

List groups

groups = client.list_groups

Get resource details

resource = client.get_resource("resource-id")

Development

After checking out the repo, run bundle install to install dependencies.

Running Tests

Run the test suite:

bundle exec rspec

Run tests with detailed output:

bundle exec rspec --format documentation

Run a specific test file:

bundle exec rspec spec/nice/client_spec.rb

Linting

Check code style with RuboCop:

bundle exec rubocop

Contributing

Bug reports and pull requests are welcome.

License

The gem is available as open source under the terms of the MIT License.