![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Mar 2025
Device: KT4 (kindle 10th generation)
|
![]()
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. ![]() |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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() |
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() 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? |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Mar 2025
Device: KT4 (kindle 10th generation)
|
I see. Thanks again.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |