Ask HN: How do you organise PDFs/eBooks?

12 points by p0llard ↗ HN
I try to obtain a digital copy of every physical book I buy, and I have quite a lot of books in digital format only; recently I decided to try and organise the mess.

I practically live in the terminal, and I use very few GUI programs these days, so I'm reluctant to use something like Calibre which I think is too bloated for my purposes. Essentially my requirements are a system that allows for hierarchical categorisation of books, and is easily navigable from the terminal.

The solution I've come up with is to use the filesystem as a "category tree" (so I might have "./Computer Science/Abstract Interpretation/...", or "./Mathematics/Mathematical Logic/...") with softlinks to directories in a hidden "store" which actually contain the books as the leaf nodes; this way I can have the same book in multiple categories, and I find it very easy to find whatever I'm looking for. I've found this works particularly well when combined with a terminal file manager such as ranger, and a fuzzy searcher such as fzf.

I've written a small tool which parses YAML metadata files inside the store and automatically generates the library structure based on the categories I assign.

I'd be interested to hear if anyone else has come up with a solution to this problem, or is aware of a pre-existing solution?

5 comments

[ 5.5 ms ] story [ 26.1 ms ] thread
Why not a terminal interface to calibre?
I'm really quite reluctant to touch it at all; on my Arch machine the installation will take up 366.38 MiB (including dependencies), which feels horribly bloated; my understanding is that it "does everything", but I prefer to subscribe to the UNIX philosophy.

Does Calibre come with a fully fledged command line interface? I wasn't able to find much in the documentation, and I'm reluctant to touch the codebase having heard various horror stories.

It does have a cli calibredb BUT it really isn't designed for interactive use and comes with a few caveats.

You need to pass --for-machine to get json output.

It keeps all its data in a sqlite database. Its built in cli refuses to interact with the database even for read only operations when calibre is running. You CAN pass a flag to interact with the running instance but THAT will fail if it isn't running so you basically have to see if its running to see how you ought to talk to it.

Talking to the running instance over localhost is subject to the same limitations as talking to a remote instance. In particular it returns $format in place of /path/to/book.$format a limitation the author says is for security.

Since the naming structure is consistent you can replace format with /path/to/library///.format when talking to the running instance.

Realistically worrying about 400MB for an app when 1TB ssds are cheap seems a contextually odd choice. Calibre does a LOT and actually does it pretty well. Replicating even just the most important functions would appear to be a fair bit of work.

(comment deleted)
I practically live in the terminal too. Most of my virtual desktops have at least two xterms, and usually more.

But I recognise that calibre does such a good job that I wouldn't be without it.

These are my calibre libraries:

   1.5G    amazon_bought
   1.9G    calibre_library
   9.6M    calibre_porn
   4.0K    comics
   2.8G    computing
   4.3G    fiction_collection
   7.4G    julie_books
   1.2G    pdf_books