02-14-2024, 01:06 PM | #1 |
Enthusiast
Posts: 37
Karma: 10
Join Date: Oct 2020
Device: Kindle Paperwhite (1)
|
How to get book paths from command linee file
Hello,
I'm trying to analyze my library space usage, I've identified some books take a very large amount of space on my disk. I want to analyze this further and automate some tasks. I went on a first selection of my books and - Create catalog to export / CSV/XML Options But in there there is no option to export each book file path. I've looked into calibredb command and also there could find a way to obtain this information. Have I missed something? I don't need to export the books, I just need to find the folder paths containing those books as I need to further analyze the disk usage. |
02-14-2024, 01:15 PM | #2 |
Well trained by Cats
Posts: 30,447
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Did you grab {id} in your CSV?
Calibre has a pretty consistent path name Library_folder\{author}\{title} (id) eg Code:
xxx MainLib\Martha Carr\Goth Drow Unleashed Boxed Set Two_ (21560) |
Advert | |
|
02-14-2024, 01:19 PM | #3 |
Well trained by Cats
Posts: 30,447
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
BTW You can show / sort on the {size} column in the GUI.
Illustrated PDF's are my big hogs, followed by lots of embedded fonts in EPUB |
02-14-2024, 03:52 PM | #4 | |
Enthusiast
Posts: 37
Karma: 10
Join Date: Oct 2020
Device: Kindle Paperwhite (1)
|
Quote:
Do you if this is just for the main version of the book? I might have several formats for the same book: audiobook as a zip file, pdf, epub and so on. I've made a quick test, it's not completely reliable, it's directional (I mean I can see the books with bigger file sizes first). Example, the GUI tells me a book is 522MB, then by opening the folder the total size of all formats is 558MB. Even the single biggest file (547MB) is already bigger than what shown on the GUI. 🤷*♂️ |
|
02-14-2024, 05:11 PM | #5 |
Bibliophagist
Posts: 40,555
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
If you have, for example, a PDF, azw3, ePub and txt file, the size shown is the largest file.
If you have a 250MB file and and 247MB file, the file size will be shown as 250MB. For the file size, when I look in calibre, there is a file shown as 367MB, when I open the folder the largest file shows as 375,772KB. Dividing 375,772 by 1024 gives me 366.96MB so round up to 367MB while Windows file properties will round down to 366MB. In your example, the 547 is likely the first three characters of the file size in bytes. 547,000,000 bytes gives me 521.65MB (divided twice by 1024) while 547,999,999 gives me 522.61MB. Last edited by DNSB; 02-14-2024 at 05:20 PM. |
Advert | |
|
02-14-2024, 06:15 PM | #6 |
Wizard
Posts: 1,139
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
This can be done by combination of Action Chains plugin and calibre template language from within the GUI. Attached below is a chain that calculates total size for selected books in human readable format. You can import the attached chain by: Action Chains > Add/modify chains > right click on the chains dialog > import > browse to the zip file.
Note: Also see what DNSB said in the post above about the difference between MB and MiB. |
02-14-2024, 06:26 PM | #7 |
Grand Sorcerer
Posts: 12,032
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
This calibre python script might help. It produces a tab-separated CSV file for each book id provided on the command line. The CSV file contains 4 columns:
To use it, save this script somewhere convenient: Spoiler:
Execute the script with Code:
calibre-debug -e script_file_path library_path id1,id2,id3 > output.csv
Spoiler:
Libre office calc shows this file as Edit: it would be easy for the script to use a search expression instead of a list of ids. Let me know if you want an example script. Last edited by chaley; 02-14-2024 at 06:42 PM. Reason: Discussed the possibility of using a search in the script |
02-14-2024, 11:08 PM | #8 |
creator of calibre
Posts: 44,554
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibredb list --fields=formats
|
Tags |
calibredb, export, location, meta data, path |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Keeping annotations/bookmarks in file -- save upon command/close instead of at once? | graatch | Calibre | 3 | 07-04-2021 02:36 AM |
How can I show document paths for each book? | MarjaE | Library Management | 2 | 04-02-2021 02:39 AM |
File paths not case sensitive in preview window? | shadowmanwkp | Sigil | 4 | 04-25-2020 12:25 PM |
Bug in renaming file in BookBrowser should show full paths mode. | The_book | Sigil | 8 | 03-25-2020 03:20 PM |
[Old Thread] Calibre Command line and .bat file | stratman | Calibre | 15 | 01-10-2012 06:38 PM |