Skip to content

riipen/lightcast-ruby

Repository files navigation

Gem Version CircleCI

Lightcast Ruby

An API client for the Lightcast REST APIs in ruby.

Lightcast Classification APIs documentation can be found here:

https://docs.lightcast.dev/apis/classification

Installation

Add to your Gemfile:

gem 'lightcast-ruby'

Then bundle install.

Usage

Quick Start

Create your client

client = Lightcast::Client.new(
  client_id: '123ABC'
  client_secret: '456DEF'
  scope: 'classifications_api',
)

and then create an authentication token that lasts 1 hour

client.authenticate

Now you can make use of any of your available APIs for your client.

Skills API

You can access the skills API via

client.skills(version: '9.0.0', release: '2024.7')

where the optional version is any valid version.

Skills Extract

Extract skills from plain text.

skills.extract(text:'computer science is a cool thing to study')

API docs

Skills Get

Get a single skill.

client.skills.get(123)

API docs

Skills List

List skills.

client.skills.post(
   fields: ['name'],
   filter: {
     level: ['2'],
     id: [
      "someId",
      "anotherId"
     ]
   },
   limit: 5)

API docs

Skills Related

Get related skills from provided skills.

client.related.get(ids: ['12345', 'abcde'], relationType: 'sibling')

API docs

Skills Status

Get the status of the classifications API.

client.skills.status

API docs

Errors

Any error code returned by the Lightcast API will result in one of the following expections

Code Exception
400 Lightcast::BadRequest
401 Lightcast::Unauthorized
403 Lightcast::Forbidden
404 Lightcast::NotFound
410 Lightcast::Gone
4xx Lightcast::ClientError
500 Lightcast::InternalServerError
503 Lightcast::ServiceUnavailable
5xx Lightcast::ServerError

License

Copyright (C) 2023 Riipen. See LICENSE for details.

About

A ruby client for the Lightcast API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published