Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-15-2009, 03:35 PM   #1
EditorJack
Member
EditorJack began at the beginning.
 
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
EditorJack is offline   Reply With Quote
Old 01-15-2009, 03:59 PM   #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: 25,820
Karma: 5006091
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use the isbndb command
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 01-15-2009, 04:31 PM   #3
EditorJack
Member
EditorJack began at the beginning.
 
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?
EditorJack is offline   Reply With Quote
Old 01-15-2009, 04:41 PM   #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: 25,820
Karma: 5006091
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
any2epub + isbndb + epub-meta
kovidgoyal is offline   Reply With Quote
Old 01-15-2009, 09:30 PM   #5
EditorJack
Member
EditorJack began at the beginning.
 
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
EditorJack is offline   Reply With Quote
Old 01-15-2009, 09:36 PM   #6
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: 25,820
Karma: 5006091
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.
kovidgoyal is offline   Reply With Quote
Old 01-15-2009, 09:49 PM   #7
EditorJack
Member
EditorJack began at the beginning.
 
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
EditorJack is offline   Reply With Quote
Old 01-15-2009, 10:27 PM   #8
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: 25,820
Karma: 5006091
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
kovidgoyal is offline   Reply With Quote
Old 01-15-2009, 10:44 PM   #9
EditorJack
Member
EditorJack began at the beginning.
 
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
EditorJack is offline   Reply With Quote
Old 01-15-2009, 11:46 PM   #10
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: 25,820
Karma: 5006091
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
kovidgoyal is offline   Reply With Quote
Old 01-16-2009, 12:59 PM   #11
EditorJack
Member
EditorJack began at the beginning.
 
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!
EditorJack is offline   Reply With Quote
Old 01-16-2009, 01:01 PM   #12
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: 25,820
Karma: 5006091
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah! That never even occurred to me
kovidgoyal is offline   Reply With Quote
Old 01-16-2009, 01:23 PM   #13
EditorJack
Member
EditorJack began at the beginning.
 
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
EditorJack is offline   Reply With Quote
Old 01-16-2009, 01:41 PM   #14
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: 25,820
Karma: 5006091
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
kovidgoyal is offline   Reply With Quote
Old 01-16-2009, 01:48 PM   #15
EditorJack
Member
EditorJack began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Aug 2007
Device: Sony Reader
Fair enough.

Thanks again, Kovid. Calibre is an amazing piece of work.
EditorJack is offline   Reply With Quote
Reply

Tags
cli, command line, conversion, metadata

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help downloading metadata by ISBN pookiepoo Calibre 15 01-14-2011 10:32 PM
Metadata BUG adding books Giuseppe Chillem Calibre 3 10-08-2010 05:13 PM
Updating Metadata without and ISBN herbycanopy Calibre 7 05-22-2010 01:16 AM
what calibre does when adding books? (metadata) jomaweb Calibre 1 02-06-2010 12:10 PM
adding metadata artemisblossom Calibre 3 09-25-2009 03:24 PM


All times are GMT -4. The time now is 05:28 AM.


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