0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby interface to the Infermedica REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 1.8.3, ~> 1.8
 Project Readme

Gem Version

infermedica

Ruby interface to the infermedica REST API

Description

This is a Ruby interface to the Infermedica REST API: https://developer.infermedica.com/docs/api

It is (very) loosely based on the Python library: https://github.com/infermedica/python-api.

Installation

gem install infermedica

Dependencies

  • json. I have tested with 1.8.x
  • Ruby 2.x

Quick Start

You will first need to get an API Id and Key from the Infermedica site https://developer.infermedica.com/docs/api

To start using the API, require the infermedica gem and create an Infermedica::Api object, passing the api_id and api_key to the constructor.

The constructor takes a hash as argument, so you have different options to pass the id and key:

require 'infermedica'
api = Infermedica::Api.new(api_id: 'xxxxx', api_key: 'xxxxxxxxxxx')

Or put the key and id in a .yaml file, read it, and pass the resulting hash to the constructor

In config.yaml

:api_id: xxxxx
:api_key: xxxxxxxxxxxxxx
:dev_mode: true

In your script

require 'infermedica'
require 'yaml'

access = YAML.load(File.read('./config.yaml'))
api = Infermedica::Api.new(access)

Examples

The examples directory has some examples to get you started. They all assume that you have a config.yaml in the same directory. Just create one with your own api_id and api_key and you should be able to just invoke ruby on each example.

Legal

The Infermedica REST API is copyrighted by Infermedica.

The Ruby code itself is released under the MIT license.