https://github.com/openactive/openactive.rb
Ruby library for working with OpenActive data
https://github.com/openactive/openactive.rb
implementation-support
Last synced: about 1 year ago
JSON representation
Ruby library for working with OpenActive data
- Host: GitHub
- URL: https://github.com/openactive/openactive.rb
- Owner: openactive
- License: mit
- Created: 2017-09-27T19:04:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-05T22:47:06.000Z (over 3 years ago)
- Last Synced: 2025-02-08T07:08:32.684Z (over 1 year ago)
- Topics: implementation-support
- Language: Ruby
- Size: 39.1 KB
- Stars: 1
- Watchers: 9
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](http://theodi.mit-license.org)
# OpenActive Client Library for Ruby
A basic Ruby client library for working with data published as part of the [OpenActive](https://openactive.io) project.
Specifically the code provides support for:
* Listing all datasets that have been published as part of the project
* Fetching and harvesting a [Realtime Paged Data Exchange](https://www.openactive.io/realtime-paged-data-exchange/) (RPDE) containing opportunity data
* Identifying whether a feed conforms to the RPDE specification and/or the [Modelling Opportunity Data](https://www.openactive.io/modelling-opportunity-data/) specification
The project also provides some simple command-line tools to help to illustrate its use.
## Installation
Add this line to your application's Gemfile:
```
gem 'openactive'
```
And then execute:
```
$ bundle
```
Or install it yourself as:
```
$ gem install openactive
```
## Usage Examples
The code includes a couple of example scripts in the `bin` directory that illustrate usage of the library to fetch
metadata and page through feeds.
See:
* `bin/oa_list.rb` -- list all published datasets
* `bin/oa_status.rb` -- create a CSV file summarising current status of published datasets
* `bin/oa_sample.rb` -- dump a random "modified" entry from a feed
* `bin/oa_harvest.rb` -- harvest all data from a feed, storing results in a directory
For a slightly longer example, take a look at this tutorial on [Indexing Opportunity Data Using Elastic Search](https://github.com/openactive/openactive-es-example)
## Handling of items in a feed
The library doesn't currently provide support for manipulating individual items in an [RPDE](https://www.openactive.io/realtime-paged-data-exchange/) feed. It just returns the individual items as Ruby hashes that can then be manipulated by the calling code.