I'm happy to announce release 1.0 of Bookaml, a simple library for validating ISBNs, gathering information about a book given its ISBN, or to find any number of books matching given search criteria.

Bookaml is closely tied to the Amazon Product Advertising API, which it uses internally for retrieving book information. Therefore, if you intend to use the library's facilities beyond basic validation of ISBN numbers, you will need an Amazon Web Services account and associated access keys (these are freely obtainable, though registration is required).

(Note that though adding more features related to the Amazon Product Advertising API is an ever-present temptation, this is not the goal of Bookaml. You may find Bookaml's code a good starting point for that purpose, in which case I encourage you to fork the project. Bookaml itself should remain focused on its original goal.)

The core library depends on Batteries, Calendar, Cryptokit, and Ocamlnet's Netstring.

Bookaml is engine-agnostic on the matter of which XML parser and HTTP fetcher are actually used for contacting the Amazon servers and parsing the result. The intention was to be friendly towards monadic libraries such as Lwt or Async. Bookaml ships with two such engines, each having their own set of dependencies:

  • Bookaml_ocamlnet: Tyxml (for the XML parser) and Ocamlnet's Netclient (for HTTP fetching).
  • Bookaml_ocsigen: Tyxml (for the XML parser) and Ocsigenserver (for HTTP fetching). Note that this engine lives in Lwt monad.

The API documentation is available online. Particularly of interest is the Bookaml_ISBN module for handling and validating ISBNs (and which may be used even without an AWS account), and module type ENGINE, which documents the functions used for gathering book information and searching for books.

Another good place to get started is to peruse the small included example, which illustrates the use of the library from within an Ocsigen/Eliom server-side application (note that you will need actual AWS credentials if you intend to run this example).