Project

nlbsg

0.0
No commit activity in last 3 years
No release in over 3 years
A ruby wrapper for the NLB SG API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 2.12.0
 Project Readme

NLBSG

Welcome to NLBSG!

This gem interacts with the Singapore National Library (NLB) API.

More information on accepted parameters and responses are available at https://opendata.nlb.gov.sg/content/SkillsFuture/NLB_Labs_TechDoc-V3.6.pdf

Obtain an API key at

https://www.nlb.gov.sg/GetInvolved/ContributeCreate/NLBlabs.aspx

Installation

Add this line to your application's Gemfile:

gem 'nlbsg'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install nlbsg

Usage

Initialize

Use your own API Key as NLBSG_KEY

client = NLBSG.client(key: NLBSG_KEY, env: :production)

Search

The Search method requires at least one parameter below and looks for books in the NLB database matching the search criteria.

client.search(title: "search string")
Parameter Data Type Usage
title String title: "search string"
keywords String keywords: "keyword string"
author String author: "author string"
subject String subject: "subject string"

Get Availability Info

The Get Availability Info method requires at least one parameter below and checks whether a book is available for loaning.

client.get_availability_info(BID: "BID string")
Parameter Data Type Usage
BID String BID: "BID string"
ISBN String ISBN: "ISBN string"

Get Title Details

The Get Title Details method requires at least one parameter below and returns with more details on the specified title.

client.get_title_details(BID: "BID string")
Parameter Data Type Usage
BID String BID: "BID string"
ISBN String ISBN: "ISBN string"

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pest-control/nlbsg.


License

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