Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nithinbekal/openlibrary
Elixir client for Open Library Rest API
https://github.com/nithinbekal/openlibrary
books elixir elixir-client elixir-lang isbn openlibrary
Last synced: 2 months ago
JSON representation
Elixir client for Open Library Rest API
- Host: GitHub
- URL: https://github.com/nithinbekal/openlibrary
- Owner: nithinbekal
- Created: 2016-11-23T19:59:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-14T03:42:33.000Z (11 months ago)
- Last Synced: 2024-10-11T01:49:01.890Z (3 months ago)
- Topics: books, elixir, elixir-client, elixir-lang, isbn, openlibrary
- Language: Elixir
- Size: 21.5 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Openlibrary
Elixir client for [Open Library Rest API](https://openlibrary.org/dev/docs/restful_api).
Work in progress. Currently only supports fetching book information for a given ISBN, LCCN or OCLC.
## Installation
Add `openlibrary` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:openlibrary, "~> 0.2.2"}]
end
```Ensure `openlibrary` is started before your application:
```elixir
def application do
[applications: [:openlibrary]]
end
```## Usage
The most common case is to look up books by ISBN:
```elixir
Openlibrary.Book.find_by_isbn("1408845644")%{"authors" => [%{"name" => "Robert Jordan",
"url" => "https://openlibrary.org/authors/OL2645644A/Robert_Jordan"}],
"by_statement" => "Robert Jordan",
"classifications" => %{"dewey_decimal_class" => ["823.914"],
"lc_classifications" => ["PS3560.O7617 E94 1990"]},
"cover" => %{...},
"ebooks" => [...],
"identifiers" => %{
"isbn_10" => ["0812511816", "081257995X", "0613176340", "0812500482"],
"isbn_13" => ["9780812511819", "9780812579956", "9780613176347", "9780812500486"],
"lccn" => ["89007939"], "oclc" => ["22671036"],
"openlibrary" => ["OL24934473M"]
},
"key" => "/books/OL24934473M",
"number_of_pages" => 814, "pagination" => "814 p. :",
"publish_date" => "1990", "publish_places" => [%{"name" => "New York"}],
"publishers" => [%{"name" => "T. Doherty Associates"}],
"subjects" => [%{"name" => "Fantasy .", "url" => "https://openlibrary.org/subjects/fantasy_."}]}
```You can also look up books by other keys:
```elixir
# Using Library of Congress catalog number:
Openlibrary.Book.find_by_lccn("96072233")# Using Worldcat Control Number:
Openlibrary.Book.find_by_oclc("36792831")
```## Credits
Reading through the source of the [openlibrary gem](https://github.com/jayfajardo/openlibrary)
by [jayfajardo](https://github.com/jayfajardo) has been a massive help in
creating this package.