![]() |
#1 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
calibredb add -- how to add additional metadata?
I'm trying to figure out how to an empty ebook from the command-line while adding fields such as tags and comments. Is that possible? If not, is that something I can do somehow without having to write out opf files for each book that I'm doing it with?
|
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,889
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
lists what you can do you can use multiple switches at the on the same commandline |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
Quote:
I'm trying to write a script that can import all my kindle books into the calibre db as empty books. Perhaps writing this as a plugin would work better, but I have no python experience, so I'm working on this in a ruby script. |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There's no way to do it if you aren't willing to work with OPF files.
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,585
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Not with calibre-add, but in some cases you can use edit-meta before, and there you can add tags and comments.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
|
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,164
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Its not that hard, OPF is just a simple XML file. Use
calibredb show_metadata --as-opf to generate the OPF file, then edit it, and use set_metadata |
![]() |
![]() |
![]() |
#8 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
will do that.
this should be an interesting process... ![]() ![]() |
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,585
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
The problem is not adding them (I usually add books in batch from command line, never UI), but getting the right metadata into them
|
![]() |
![]() |
![]() |
#10 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
Quote:
![]() I'm grabbing the categorization that Amazon lists for tags, and sticking the item description in the comments field. Hopefully that should handle most of the hard work of adding the books. ![]() |
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,585
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
If you're doing that, you can have two steps: the first one updates metadata (edit-meta) and the second one adds the book (calibre-add). I'm doing it in that way and it works.
|
![]() |
![]() |
![]() |
#12 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
Quote:
![]() It's not super user-friendly, and requires ruby and some rubygems libraries, along with an amazon AWS account, but it does appear to work so far... |
|
![]() |
![]() |
![]() |
#13 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
Okay... It's imported around 120 books so far, with no errors, so here it is... (you will have to pull the .txt off the end of the file)
I'm not responsible if this causes problems, so make sure you back up your existing library before using it. If you hit an error, I may or may not be able to fix it. ![]() If you want different functionality, I probably won't be willing to modify it myself, but you'll have the code, so you can either modify it yourself, or find someone to modify it for you. It's an ugly script, and not commented... I know that. ![]() I guess the summary of the above is "I'm throwing this script over the wall and if you want it, you can make it work for what you need, but I'm not going to be heavily supporting it. If you get a specific error, you can try asking in this thread, and if I know immediately what's causing it, I'll try to help, but I'm not going to put lots of effort into making it better right now, since I've got other things on my plate these days." Last edited by TuxGirl; 12-28-2011 at 04:40 PM. |
![]() |
![]() |
![]() |
#14 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 179
Karma: 141378
Join Date: Sep 2009
Device: kindle
|
oh... just a warning... the script is pretty chatty. i've been running it with the output piping to a file, but you could just pipe it to /dev/null (although if you then have problems, it'll be hard to find the source unless you re-run it with the output going to a file or to stdout.
|
![]() |
![]() |
![]() |
#15 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,585
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Defining Metadata with "calibredb add" command line function. | macr0t0r | Calibre | 3 | 03-01-2012 07:36 PM |
Slow calibredb add on huge ebooks directory | ternyk | Library Management | 8 | 05-17-2011 04:39 AM |
Can I add additional formats? | tinjaw | Calibre | 2 | 02-07-2011 11:09 PM |
Calibredb add after ebook-convert fails | spullar | Calibre | 5 | 03-04-2010 01:14 PM |
Way to add additional information with Calibre? | MidknytOwl | Sony Reader | 5 | 09-11-2009 01:53 PM |