zxiex / kobo-book-collections-dbt

Create book collections on kobo eReader with DBT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kobo eReader has a nice feature to organize books by collection. https://help.kobo.com/hc/en-us/articles/360033887953-Organize-your-eBooks-on-your-Kobo-eReader For example:

However, if there are too many books, creating collection and adding books to the collection can be tedious.

This project is to create book collections by the directory name using dbt.

How to use this tool

  1. suppose python3, git, pipenv and make are all installed
  2. Checkout this repo
git clone https://github.com/zxiex/kobo-book-collections-dbt.git
cd kobo-book-collections-dbt

Note that dbt-sqlite will be checked out and installed. https://github.com/zxiex/dbt-sqlite is a Fork of https://github.com/codeforkjeff/dbt-sqlite to fix an issue.

  1. Prepare the virtual env (suppose pipenv is installed)
make install
  1. Plug the Kobo eReader into Computer (Suppose all the books are put into folders as the expected collection)
  2. Copy the sqlite database file from eReader to ./data folder (Better to have a backup copy of the file) On Mac, the file is /Volumes/KOBOeReader/.kobo/KoboReader.sqlite
cp /Volumes/KOBOeReader/.kobo/KoboReader.sqlite data/
  1. run dbt
make run
pipenv run dbt run                                                                                                                                                  
20:47:41  Running with dbt=1.6.1                                                                                                                                    
20:47:41  Registered adapter: sqlite=1.4.0                                                                                                                          
20:47:41  Unable to do partial parsing because saved manifest not found. Starting full parse.                                                                       
20:47:41  Found 2 models, 1 test, 1 source, 0 exposures, 0 metrics, 343 macros, 0 groups, 0 semantic models                                                         
20:47:41                                                                                                                                                            
20:47:41  Concurrency: 1 threads (target='dev')                                                                                                                     
20:47:41                                                                                                                                                            
20:47:41  1 of 2 START sql incremental model main.ShelfContent ........................... [RUN]                                                                    
20:47:41  1 of 2 OK created sql incremental model main.ShelfContent ...................... [OK in 0.08s]                                                            
20:47:41  2 of 2 START sql incremental model main.Shelf .................................. [RUN]                                                                    
20:47:41  2 of 2 OK created sql incremental model main.Shelf ............................. [OK in 0.04s]                                                            
20:47:41                                                                                                                                                            
20:47:41  Finished running 2 incremental models in 0 hours 0 minutes and 0.16 seconds (0.16s).                                                                      
20:47:41                                                                                                                                                            
20:47:41  Completed successfully                                                                                                                                    
20:47:41                                                                                                                                                            
20:47:41  Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2    
  1. Copy the updated KoboReader.sqlite back to eReader
cp data/KoboReader.sqlite  /Volumes/KOBOeReader/.kobo/KoboReader.sqlite
  1. eject the eReader and done
diskutil eject /Volumes/KOBOeReader 

About

Create book collections on kobo eReader with DBT

License:MIT License


Languages

Language:Makefile 100.0%