Our Digital Library
I catalogued the ISBN of every book my partner and I own!
Why?
Proximally, because my partner suggested we build a database of all our books.
Distally, because we wanted to be able to check what books we already owned when we were in Dymocks, and track who we've lent books to, and maybe do some neat charts and analytics.
So what did you actually do?
I vibe-coded1 a backend and a webapp that runs off of it and a little ingest tool that takes the ISBN and looks it up on OpenLibrary to get all the information about the book then hands it off to the backend2.
We bought a barcode scanner (specifically a POS-mate wired USB barcode scanner), and then one weekend when my partner was away I went through every bookshelf in the house and scanned everything. It took something like five hours to get through 690 books, graphic novels, periodicals, &c3.
My process was to grab a shelf of books, bring them over to my laptop, scan them all, put them back, then move on to the next shelf. I think that explains the 'wiggliness' of the line. The median scan time was 7.3 seconds/book and I was actively scanning for about 3 hours and 40 minutes - I had to take a few breaks to do things like clean the cat litter trays.
What does it look like?
Boring! The ingest tool is just Python driving a form built with Qt.
And the webapp is currently similarly barebones.
(We're up to 725 books now).
Anything interesting about the process?
A few things!
Firstly, it really surprises me exactly how sparse OpenLibrary is, and also that there's not really anything better at covering everything (that I know of, at least). About 10% of our library did not have an entry. This was mostly Australian books - and keep in mind that doesn't mean "books written by Australians for Australian consumption", this means "the version of widely-available books published in Australia". A lot of the old books were totally fine! My published-in-1979 copy of The Devils of Loudun has an entry on OpenLibrary. Our copy of All That We See or Seem, a 2025 mainstream sci-fi book by well-known author Ken Liu, did not have an entry for the ISBN we had until I added it. I think the most puzzling miss was Habermas' Also a History of Philosophy, Volume 2 - because volumes 1 and 3 are present. The least puzzling miss was our small collection of an Australian periodical called Quarterly Essay; about half of them weren't present (or were present but only with the ebook ISBN, oddly).
Secondly, even when there is an entry for a book, sometimes it's missing author information. My database schema has author as a mandatory field; in retrospect that might have been a mistake and I should have learned from the horrible edge cases when dealing with music not to be so optimistic. This was rare enough that I could just fix it in the ingest tool. I'm going to have to go through and reconcile against OpenLibrary and add things later. I've already added some books and covers; I expect this will be an ongoing chore.
There was exactly one case where I scanned something and OpenLibrary gave me info for definitely the wrong book - Kahneman's Thinking, Fast and Slow; we have ISBN 978 0 14103 357 0; OpenLibrary thought that was New Book, by Michael Jackson. The nature of a user-editable wiki is that sometimes some guy will just have made a mistake. There were a few other interesting cases, like ISBN 978 1 39854 144 3, also known as "Untitled S&S NF JK" - probably a bulk data import from a publisher got some kind of internal working name, rather than the actual title ("War", by Bob Woodward). Some typos in titles, incorrect publishers, general inconsistency over naming convention ("Equal Rites: Discworld: The Witches Collection", or "Discworld Witches Collection Masquerade", or "Discworld Witches Collect Witches Abroad", or "Going Postal: Discworld Novel 33", or many other fascinating variations).
Certainly on reflection it's obvious that there was no reason to expect a comprehensive database of all books ever written to exist; there's no central clearing house. Also it might get sued. It is a bit sad though!
Thirdly, we wanted some kind of "subject" field; mostly for my partner's collection of nonfiction so they could easily search for relevant books for some problem they're thinking through. The best source I could find for that was the Library of Congress, which reports a couple different things that resemble subject info4; the most useful was an ontology called "LCSH" (Library of Congress Subject Headings). The subject headings are a bit all over the place5 but it's the best we've got for now. I also tried to hit up a few other data sources - a State Library of Victoria API, a German library catalogue - and this got us some more info as well.
I would have liked to try using Trove, the National Library of Australia's database, but unfortunately their current API requirements are completely insane. As far as I can tell I couldn't use the Trove API to get names of books, names of authors, or LCSH information without also:
- providing the National Library of Australia an account for our digital library app if they ask (reminder: this is entirely for personal use)
- caching that information for at most 30 days before re-fetching it, and that caching is only if we need it for performance reasons
- removing that information if it's removed on Trove
- specifically attributing all of this information to Trove
- including the Trove logo on our website
It almost seems like they don't want anyone to use the API at all. This is a real pity. If you publish a book in Australia you have to give a copy to the National Library so it might legitimately be the single authoritative source for Australian books. But if they don't make that information available for some bizarre reason there's not much I can do about it. Compare the State Library of Victoria, which is happy to provide the information I'm after without a key at all, and which covered a good 60% of the Australian books OpenLibrary was missing.
Fourthly, wow it is sometimes not obvious what the ISBN of a book is. Stores love putting stickers directly over the top of the barcode (it's already empty space; they don't want employees scanning the wrong barcode). Some books only have a barcode on the dust jacket, which might be missing. Some books - especially old English books - don't have a barcode at all, and also only have an "SBN", a 9-digit UK precursor to ISBNs (and which fortunately converts). One of my books is a much-loved copy of Raymond Feist's Magician which has somehow lost the front and back cover, along with the internal publisher-info page. Front page of it is the acknowledgements. Fortunately I remember what the cover looked like, which was enough of a hook to work out a plausible identifier (and it's certainly an identifier for a copy of Magician, which is probably good enough).
Fifthly, oops, it's entirely possible to have book-shaped objects in your collection that don't have an ISBN, because you only get one if you're published through a publisher. You don't get one if you're a direct-to-customer outfit selling via mail. You also don't get one if you're doing self-publishing via kickstarter. Gonna have to have a think about my ontology for this app, I guess.
Sixthly, my partner and I have multiple library books that obviously just didn't get returned. Oops. Sorry, high-school library! For legal reasons this is not an admission of guilt.
Anything you'd do differently?
Yeah, I think the database schema is the big deal. I don't know what the right design for "anything you think of as book-like in your collection" is; you can just assign everything an arbitrary unique id but for things like self-published books you're going to be doing manual data entry. I guess maybe you just need an escape hatch from an ISBN representation; >99% of things we've got have a perfectly good unique identifier. I'm sure library science and/or librarians more generally have some solutions to this problem.
Part of me feels like the scanning process would've been faster if I scanned in a batch of ISBNs (say a shelf), then did the various lookups and commits to the database with the results. Hitting a button every scan probably wasn't good for speed or, for that matter, ergonomics. This was especially a nuisance when a commit failed and I had to retry; probably the ingest program should've just been doing that.
As it was the scanning process wasn't too bad. I just went shelf by shelf, brought things over to a laptop in piles, and then went pile by pile scanning everything. When books were complicated in some way I usually set them to the side and did them at the end of the shelf; the ingest program allows manually entering an ISBN. I foresee the barcode scanner also having uses for our board game library in future. Perhaps a self-hosted version of BoardGameGeek?
I've no idea how we're going to maintain this; we do legitimately have multiple copies of some ISBNs and I don't really want to re-scan everything anyway so we're going to have to be really good at linking stuff in as it crosses the threshold. Hopefully we'll remember after coming home from the bookshop! I live in fear that I've missed three books in a drawer somewhere. I don't know why that's scary - they already weren't in a database - but now that I've made one it had better be complete and correct, damnit. (In fact, while I was writing this post I realised I'd missed 7 books due to mistakes in the scanning process).
In particular we've got a "location" field, with granularity like "James' Office" or "Jenn's Bedroom". This is definitely useful if you want to figure out where some book was left. It's also going to get out of sync with reality really fast. It'll probably be most useful if and when we lend a book out to someone. I've got a timestamp on the field and we'll just have to treat it like "This is where it was seen on this date" rather than the actual location, as such.
You promised charts and analytics
Good point! I did.
We're getting at fiction/nonfiction via the Library of Congress' data; they've got a "literary form" field. It classifies things as "poetry" or "drama" or "essays"; we crush them to fiction/nonfiction for filtering. We don't have this data for a reasonable chunk of books, so there are a bunch we just haven't categorised; even so you can pretty clearly see that we keep our fiction in our bedrooms and our nonfiction in our offices, in general.
OpenLibrary supplies publication year. Unsurprisingly most of our books were published recently. But what's up with the book published in the 1880s? Do we have a first edition? Nope, it's our copy of Flatland, published in 1992. Somebody has put the date Flatland was written (1884!) into the publish-date field for that ISBN. The allegedly-1960s books have a similar issue; we have a 1998 ISBN of The Art of Computer Programming, Vol. 3, not 1968, and an ISBN of Men in Dark Times that was first published in the 1970s. The remaining book is a copy of Dandelion Wine; the ISBN was legitimately first issued in 1969; this might be the oldest book in our collection (though it's difficult to tell if it's a later reprint).
| Subject heading | Books |
|---|---|
| Discworld (Imaginary place)--Fiction | 36 |
| Life on other planets--Fiction | 15 |
| Magic--Fiction | 14 |
| Japan--Fiction | 13 |
| Clubs--Fiction | 11 |
| Supernatural--Fiction | 10 |
| Science fiction, American | 9 |
| Time travel--Fiction | 9 |
| Friendship--Fiction | 8 |
| Science fiction | 8 |
| Vimes, Samuel (Fictitious character)--Fiction | 8 |
| Australia--Politics and government | 7 |
| Witches--Fiction | 7 |
| Wizards--Fiction | 7 |
There's a long-running fantasy series by a British author that we have a complete collection of. Can you guess what it is?
We also have a complete set of Haruhi Suzumiya books, which accounts for things like "Clubs--Fiction". We do have a fair amount of science fiction that's represented in categories like "Life on other planets--Fiction" though! That's covering Asimov, Le Guin, Becky Chambers, Iain Banks, and Kim Stanley Robinson, among others. The subject-heading data seems more fine-grained for non-fiction than fiction; also fiction tends to come in longer series. This results in series of fiction books dominating the repeated headings.
Four of the "Australia--Politics and government" books are from our collection of Quarterly Essay (the other three are books about... Australian politics). Two other Quarterly Essays have "Australia--Politics and government--21st century", which is a totally different subject of course. Then there are several other issues that don't have any subject headings at all, mostly because they're not in any of the data sources we're hitting up for this information. It's a real problem and I don't have a good solution to it yet. My partner has been experimenting with using LLMs to tag data in large datasets; maybe we can do that here?
So, was it worth it?
I think we've used the setup for its intended purpose - checking if we already own a book while in the high-pressure sales environment of the local bookstore - approximately once. But honestly I've learned a lot and it's just kinda pleasant to have a digital record of everything we own. At least, everything we own that's in the house, and not in my parents' attic in another state. And that I didn't forget in the first scan...
Why vibe code? My technical background has been in systems programming; I actually don't have much experience with web apps. The models - at least, the good ones - are just flatly better at web development than I am. So the question was simply: do I want this tool to exist? Or do I want to have made this tool? In this case it was the former. Maybe I'll write a post about how I think about this later?↩︎
Why a personal app instead of Goodreads/Storygraph/Leafed/Librarything/Whatever? There's apparently a tiny cottage industry of these sorts of book-tracking tools, with various target audiences and features. The most honest reason is that I didn't know about most of them and things like Goodreads are more focussed on reviewing things rather than tracking what you personally own. To some extent I don't know if there is an available tool that has all the properties we'd want - self-hosted, open source, lets us track which books we've lent out. I don't think anything I looked at seemed like it did everything we want. And besides, there's never been a better time for making bespoke software that works exactly the way you want it to!↩︎
Did you know that "&" originated as an abbreviation for "et" - latin for "and"? "&c", of course, is the short version of et cetera, latin for "and other things". "&" just written on its own was pronounced "and"; the name "ampersand" comes from a corruption of "& per se and", meaning "& by itself means 'and'".↩︎
Why not the Dewey Decimal System, or the more European Universal Decimal Classification, or the more American Library of Congress classification number? Well the LoC fields for this sometimes say things like
CPB Box no. 2379, which seems to be where they have their copy of the thing rather than a classification, as such. Also all of these classification schemes can give a book at most one classification; we want multiple overlapping tags, ideally.↩︎Of the 1,363 subject headings that show up on a book in our collection, 1,139 occur on exactly one book. The headings look like "Mediterranean Region--History--To 476", so they're a bit fine-grained. Yes, I realise this is a bit awkward sitting next to "we want multiple overlapping tags". I don't have a good solution for this yet.↩︎