01-15-2009, 04:35 PM | #1 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
Adding online metadata using ISBN from CLI
O Wise Ones:
You know that sweet, sweet feature in Calibre's GUI that allows you to insert an ISBN and then automatically populate the metadata fields from the online data? Well, I'm wondering if it's possible to do the same thing when creating ebooks (e.g., epub or lrf) from the command line. I've read the docs and searched the forum but can't seem to find the answer to this question. I'd be grateful for any help on this. Thanks! Best wishes, Jack Lyon The Editorium http://www.editorium.com Waking Lion Press http://www.wakinglionpress.com |
01-15-2009, 04:59 PM | #2 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the isbndb command
|
Advert | |
|
01-15-2009, 05:31 PM | #3 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
Yes, perfect! Thank you! Can that be used with, say, any2epub? If so, how?
|
01-15-2009, 05:41 PM | #4 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
any2epub + isbndb + epub-meta
|
01-15-2009, 10:30 PM | #5 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
Kovid:
Thanks very much for this: any2epub + isbndb + epub-meta But I'm not getting the syntax. This example doesn't work: any2epub + isbndb -i=1-60096-173-8 + epub-meta anthem.htm Can you give me a specific example of the syntax you'd use to do something like this? Oh--I'd also like to include a cover image that I have in a folder in my hard drive. One more command to add to the string. Thanks very much. I'm really grateful for your work. Best wishes, Jack |
Advert | |
|
01-15-2009, 10:36 PM | #6 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I meant call them in succession. Just call them with the -h switch to see how to use them.
|
01-15-2009, 10:49 PM | #7 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
Oh, of course. I see. But what I'm really wanting to do is pass the information from isbndb directly to any2epub? Is that possible?
If not, is there a way to pull the isbndb information into a database or spreadsheet? I'm trying to batch process 400 html book files into epub files that include metadata and cover image, so I'd like to avoid entering the metadata by hand. Thanks for all your help. Best wishes, Jack |
01-15-2009, 11:27 PM | #8 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Well any2epub allows you to set the title,authors,publisher and comments, or it lets you load metadata from an OPF file.
You basically have to write a script that will call isbndb for each of your books, and then use the metadata returned to call any2epub |
01-15-2009, 11:44 PM | #9 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
> You basically have to write a script that will call isbndb for each of your books
I can do that. > then use the metadata returned to call any2epub That's where I'm getting hung up. How do I *collect* the data from isbndb? Can it write the data into an OPF file, for example? Thanks again! Best wishes, Jack |
01-16-2009, 12:46 AM | #10 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Parse the output of the isbndb command. It's in a standard form so shouldn't be difficult
|
01-16-2009, 01:59 PM | #11 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
My problem was figuring out how to *capture* the output so I *could* parse it. For anyone else facing this problem, here's at least one answer:
http://www.tldp.org/LDP/abs/html/io-redirection.html Thanks again, Kovid! |
01-16-2009, 02:01 PM | #12 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah! That never even occurred to me
|
01-16-2009, 02:23 PM | #13 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
No problem. I'm a novice on some of this stuff.
Now I'm wondering, though: How about including an isbndb option to create an .opf file from the downloaded metadata? Something like this: isbndb --makeopf I realize that wouldn't be a *complete* .opf file, but the point would be to then import the captured metadata using any2epub --metadata-from. Would that work? Thanks! Best wishes, Jack |
01-16-2009, 02:41 PM | #14 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
isbndb can return multiple matches, so there would be multiple OPF files. For the limited output presented by isbndb, it should be relatively trivial to parse
|
01-16-2009, 02:48 PM | #15 |
Member
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
|
Fair enough.
Thanks again, Kovid. Calibre is an amazing piece of work. |
Tags |
cli, command line, conversion, metadata |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help downloading metadata by ISBN | pookiepoo | Calibre | 15 | 01-14-2011 11:32 PM |
Metadata BUG adding books | Giuseppe Chillem | Calibre | 3 | 10-08-2010 06:13 PM |
Updating Metadata without and ISBN | herbycanopy | Calibre | 7 | 05-22-2010 02:16 AM |
what calibre does when adding books? (metadata) | jomaweb | Calibre | 1 | 02-06-2010 01:10 PM |
adding metadata | artemisblossom | Calibre | 3 | 09-25-2009 04:24 PM |