Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 03-13-2025, 09:16 AM   #1
wavioto
Junior Member
wavioto began at the beginning.
 
wavioto's Avatar
 
Posts: 8
Karma: 10
Join Date: Mar 2025
Device: KT4 (kindle 10th generation)
Question Question about accessing custom column information

I've created a custom column in Calibre to store the contents of KOReader sidecar files (specifically, the notes generated while reading). I'd like to access the text from these notes and export them to Obsidian.

My initial attempt was to use Python and sqlite3 to directly access the Calibre .calnotes/notes.db file. However, I encountered errors, and after some research, I discovered that Calibre uses a custom tokenizer, which complicates direct SQL queries. I'm also not sure if notes.db is the correct database to be looking at for what I am attempting to do.

I'm a beginner in programming in general and Calibre internals, so I'm a bit lost.

Is .calnotes/notes.db the correct database?
If yes, what do I do for the custom tokenizer?

Is my approach valid or should I change it?

Any help and pointers would be greatly appreciated.

wavioto is offline   Reply With Quote
Old 03-13-2025, 09:18 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,171
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use the database API
https://manual.calibre-ebook.com/db_api.html

In particular here you would use field_for()
kovidgoyal is offline   Reply With Quote
Old 03-13-2025, 09:39 AM   #3
wavioto
Junior Member
wavioto began at the beginning.
 
wavioto's Avatar
 
Posts: 8
Karma: 10
Join Date: Mar 2025
Device: KT4 (kindle 10th generation)
Thank you for the help.

Just curious, why was accessing the database file using sqilte directly not the correct approach?
wavioto is offline   Reply With Quote
Old 03-13-2025, 09:43 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,171
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because its not a simple sqlite database. It uses lots of custom things such as triggers, custom auxiliary functions, views, etc etc etc.
kovidgoyal is offline   Reply With Quote
Old 03-13-2025, 09:45 AM   #5
wavioto
Junior Member
wavioto began at the beginning.
 
wavioto's Avatar
 
Posts: 8
Karma: 10
Join Date: Mar 2025
Device: KT4 (kindle 10th generation)
I see. Thanks again.
wavioto is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Column question - Date field was last modified Comfy.n Calibre 12 09-21-2022 01:10 AM
Custom column icons question ownedbycats Library Management 11 10-22-2020 04:02 PM
Custom Column Question Vallora Library Management 4 10-13-2014 10:57 PM
Custom Column Date Question tarisea Library Management 4 01-13-2014 05:01 PM
Custom column question ice_cracked Library Management 1 11-10-2012 04:54 PM


All times are GMT -4. The time now is 01:25 AM.


MobileRead.com is a privately owned, operated and funded community.