[librecat-dev] catmandu for simple usecases
Jakob Voß
Jakob.Voss at gbv.de
Wed Mar 28 13:35:51 CEST 2018
Hi Marc,
You wrote:
> description of the tools i need
>
> * query a remote library with CC licenced records. queries
> are simple:
>
> * search a book by matching in title
> * search a book by matching in author
If the library provides any kind of standard API (e.g. SRU) this is no
deal with Catmandu. For instance the Library of Congress has an SRU API
at http://lx2.loc.gov:210/LCDB.
> * search related/suggested books for a book ID
> * search FR translations for a book ID
These tasks are too under-specified to be solvable easily. Anyway it not
depends on Catmadu or any other toolkit but on the query capabilies of
the library databases you need to query to answert these questions.
> * store some some of them into a tiny local storage (a yaml file should be
> perfect)
Writing to files or to different kinds of databases is just a matter of
one or two options in Catmandu.
> * use those storages to maintain bibliographies
This less depends on Catmandu but on the bibliographic data format you
need. Pandoc can directly use MODS, so no problem.
> ideal usecase of an higher level wrapper usable from the CLI should be
>
> $ book search \
> author like Hafner \
> title like Wizard
>
> id: 23424
> title: Where Wizards Stay Up Late
> subtitle: The Origins Of The Internet
> author: Katie Hafner and Matthiew Lyon
> ISBN: 0-684-87216-1
> seealso: 8768
> copy-url: https://monoskop.org/images/e/ee/Hafner_Katie_Lyon_Matthew_Where_Wizards_Stay_Up_Late_The_Origins_Of_The_Internet.pdf
>
> $ book search id is 8768
>
> id: 8768
> title: 50 Years of Army Computing: From ENIAC to MSRC
> author: Army Research Laboratory
> ISBN: 097023161X
> copy-url: http://www.dtic.mil/dtic/tr/fulltext/u2/a431730.pdf
MODS is more verbose than simple key-values so at some point you might
want to simplify. There are XSLT stylesheets to do so
https://www.loc.gov/standards/mods/mods-conversions.html
Catmandu can also do XML processing but has its strength with
JSON/YAML-like structures.
> $ book append computer-history 23424 8768
>
> ~/.books/computer-history.yaml updated
>
> $ book bibliography from computer-history to bibtex > paper.bibtex
Have a look at pandoc-citeproc so you don't need BibTeX.
Cheers,
Jakob
--
Jakob Voß <jakob.voss at gbv.de>
Verbundzentrale des GBV (VZG) / Common Library Network
Platz der Goettinger Sieben 1, 37073 Göttingen, Germany
+49 (0)551 39-10242, http://www.gbv.de/
More information about the librecat-dev
mailing list