π Libro: A simple command-line tool to track your reading history, with your data stored locally in a SQLite database.
Add new book: libro add
Show books read by year: libro show --year 2024
Show book details by id: libro show 123
Show books read by year: libro report
Show books read by author: libro report --author
Books Read in 2025
ββββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββ³βββββββββββββββββββββββ³βββββββββ³βββββββββββββββ
β id β Title β Author β Rating β Date Read β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β Fiction β β β β β
β 1 β Cujo β Stephen King β 3 β Jan 05, 2025 β
β 585 β The Midnight Library β Matt Haig β 5 β Jan 13, 2025 β
β 587 β The Maid β Nita Prose β 4 β Jan 20, 2025 β
β 589 β Into the Water β Paula Hawkins β 2 β Feb 02, 2025 β
β 591 β My Grandmother Asked Me to Tell You She's Sorry β Fredrik Backman β 3 β Feb 15, 2025 β
β 584 β Salem's Lot β Stephen King β 3 β Mar 12, 2025 β
β 595 β The Thursday Murder Club β Richard Osman β 3.5 β Mar 20, 2025 β
β 596 β Remarkably Bright Creatures β Shelby Van Pelt β 5 β Mar 27, 2025 β
β 598 β Colorless Tsukuru Tazaki β Haruki Murakami β 3 β Apr 09, 2025 β
β 599 β Ten β Gretchen McNeil β 3 β Apr 16, 2025 β
β β β β β β
β Nonfiction β β β β β
β 586 β The Art Thief β Michael Finkel β 4 β Jan 14, 2025 β
β 588 β All the Pieces Matter β Jonathan Abrams β 3 β Jan 27, 2025 β
β 590 β Supercommunicators β Charles Duhigg β 4 β Feb 04, 2025 β
β 592 β HBR Guide to Generative AI for Managers β Elisa Farri β 4 β Feb 16, 2025 β
β 593 β Leonardo da Vinci β Walter Isaacson β 3 β Mar 02, 2025 β
β 594 β The Leap to Leader β Adam Bryant β 3 β Mar 08, 2025 β
β 597 β Team of Rivals β Doris Kearns Goodwin β 3 β Apr 06, 2025 β
ββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββ΄βββββββββββββββ
β― libro report
Books Read by Year
Year Count Bar
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2013 3 ββββ
2014 4 ββββββ
2015 11 βββββββββββββββββ
2016 30 ββββββββββββββββββββββββββββββββββββββββββββββ
2017 21 ββββββββββββββββββββββββββββββββ
2018 27 ββββββββββββββββββββββββββββββββββββββββββ
2019 29 βββββββββββββββββββββββββββββββββββββββββββββ
2020 27 ββββββββββββββββββββββββββββββββββββββββββ
2021 28 βββββββββββββββββββββββββββββββββββββββββββ
2022 27 ββββββββββββββββββββββββββββββββββββββββββ
2023 32 ββββββββββββββββββββββββββββββββββββββββββββββββββ
2024 30 ββββββββββββββββββββββββββββββββββββββββββββββ
2025 17 ββββββββββββββββββββββββββ
β― libro report --author
Most Read Authors
Author Books Read
ββββββββββββββββββββββββββββββββββ
Stephen King 15
George R.R. Martin 5
Timothy Zahn 4
Grady Hendrix 4
Andy Weir 4
William Zinsser 3
Roald Dahl 3
Riley Sager 3
Philip K. Dick 3
Neil Gaiman 3
Natalie D. Richards 3
Lucy Foley 3
Cory Doctorow 3
Libro is packaged as libro-book on PyPI.
pip install libro-book
You can also clone this repository and install it locally:
git clone https://github.com/mkaz/libro.git
cd libro
pip install -e .
On first run, libro will create a libro.db database file based on database location. It will prompt for confirmation to proceed which also shows the location where the file will be created.
Database locations:
The following order is used to determine the database location:
-
Using the
--dbflag on command-line. -
libro.dbin current directory -
Environment variable
LIBRO_DBto specify custom file/location -
Finally, the user's platform-specific data directory
- Linux:
~/.local/share/libro/libro.db - macOS:
~/Library/Application Support/libro/libro.db - Windows:
%APPDATA%\libro\libro.db
- Linux:
For example, if you want to create a new database file in the current directory, you can use the following command:
libro --db ./libro.db
Libro can import your reading history from a Goodreads export CSV file.
libro import goodreads_library_export.csv
There is a genre field for fiction and nonfiction, but this data is not available in the Goodreads export. I still need to build the edit book functionality to change the genre.
| Field | Type | Description |
|---|---|---|
| id | primary key | Unique identifier |
| title | string | Book title |
| author | string | Book author |
| pages | int | Number of pages in book |
| pub_year | int | Year book was published |
| genre | string | Fiction or nonfiction |
| Field | Type | Description |
|---|---|---|
| id | primary key | Unique identifier |
| book_id | foreign key | Book identifier |
| date_read | date | Date book was read |
| rating | float | Number between 0 and 5 |
| review | text | Review of book |
Notes to self, I forget how to do this stuff.
Libro is packaged as libro-book on PyPI.
Packaging is done with hatchling, see Guide
# install tools
py -m pip install --upgrade build twine
# build
py -m build
# upload
py -m twine upload dist/*