Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 06-09-2011, 08:15 PM   #1
skdutta
jojobar
skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.
 
Posts: 20
Karma: 480294
Join Date: Jun 2010
Device: prs-900
Import XML Feature designed in Calibre?

I have been using Alfa eBook Manager to manage my books so far. Now I want some of those books to be imported to Calibre. Alfa gives an easy way to export the meta data (and the book location) using a structured xml file.

So, I was wondering if there is an xml import format so that I can do the required xslt translation to import. OR if it is possible to generate calibre command line from this using XSLT. OR if there is even something close. Note that I want to do it as a one step process (don't want to copy files separately)

See below for the exported format, note that it outputs the file name that calibre can potentially import.

DISCLAIMER: I am new to Calibre!

Code:
<?xml version="1.0" encoding="utf-8"?>
<Book Book_Id="168">
  <Title>1,001 Best Slow-Cooker Recipes</Title>
  <Subtitle>The Only Slow-Cooker Cookbook You'll Ever Need</Subtitle>
  <Authors>
    <Author>Spitler, Sue</Author>
    <Author>Yoakam, R</Author>
  </Authors>
  <Genre>Food &amp; Drink: General</Genre>
  <Publisher>Agate Surrey</Publisher>
  <Series/>
  <Isbn_10>1572840986</Isbn_10>
  <Isbn_13>9781572840980</Isbn_13>
  <Date>Wednesday, October 01, 2008 12:00:00 AM</Date>
  <Pages>800</Pages>
  <Language>English</Language>
  <Paperback>Paperback</Paperback>
  <Edition>0</Edition>
  <Dimension>120x890x590</Dimension>
  <Weight>180</Weight>
  <Price>$19.95</Price>
  <Description>recipes - all thoroughly tested.</Description>
  <Toc/>
  <Front_cover>M:\Books\eBook\Sue Splitler\1572840986.jpg</Front_cover>
  <Back_cover/>
  <Location>M:\Books\eBook\Sue Splitler\1,001 Best Slow-Cooker Recipes.pdf</Location>
  <Size_nature>5784125</Size_nature>
  <Rating>4</Rating>
  <Date_Add>Monday, July 26, 2010 8:33:38 PM</Date_Add>
</Book>

Last edited by skdutta; 06-09-2011 at 08:17 PM. Reason: types
skdutta is offline   Reply With Quote
Old 06-09-2011, 08:53 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: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can use XSLT to convert that XML to OPF which is the standard XML format for ebook metadata. calibre reads metadata from OPF files.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-09-2011, 09:34 PM   #3
skdutta
jojobar
skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.
 
Posts: 20
Karma: 480294
Join Date: Jun 2010
Device: prs-900
Quote:
Originally Posted by kovidgoyal View Post
You can use XSLT to convert that XML to OPF which is the standard XML format for ebook metadata. calibre reads metadata from OPF files.
Thanks

Quick question, does calibre export to opf format also (did not see it in the list)?, so that I can quickly see which tags are required and just create them. Another problem I have is to figure out how to specify the file name of the book and the front cover.

If this is all possible in opf format it is great, I will look into the format.
skdutta is offline   Reply With Quote
Old 06-10-2011, 02:33 AM   #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: 45,209
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
just add any book to calibre and edit its metadata, you will see an OPF file the books folder.
kovidgoyal is offline   Reply With Quote
Old 06-10-2011, 06:54 AM   #5
skdutta
jojobar
skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.
 
Posts: 20
Karma: 480294
Join Date: Jun 2010
Device: prs-900
So, do you think the sequence should be like this:

1. Physically copy the eBook files into the calibre file structure
2. Write a program to traverse the xml from alfa and create separate opf files in the respective directory in calibre
3. Start calibre and it should read the opf

Is there any easier way? Step 1 above may be little involved as my structure does not match calibre's. Maybe I will try to do the import and see.

I was looking for a one step importer, so that I can create the opf files (for all the books once) and it will just import everything.
skdutta is offline   Reply With Quote
Advert
Old 06-10-2011, 08:12 AM   #6
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
I think that if you create an opf file in the location the book is currently located that references that book then you will be able to use the Calibre command line utility for adding books which will add the book to the database and then copy the opf and related file(s) to the calibre library. That way you leave Calibre to manage its own internal library details.

I am sure someone will chime in if I have got any of these details wrong.
itimpi is offline   Reply With Quote
Old 06-14-2011, 08:12 AM   #7
skdutta
jojobar
skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.skdutta ought to be getting tired of karma fortunes by now.
 
Posts: 20
Karma: 480294
Join Date: Jun 2010
Device: prs-900
What if you have multiple books in the same folder? will calibre read each opf file first and then copy the referenced book?
skdutta is offline   Reply With Quote
Reply

Tags
calibre, xml import


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Feature Idea - Auto convert on import jphphotography Calibre 6 11-04-2012 09:17 PM
Import failed Error:404 when attempting to import from Calibre to Stanza dvond Apple Devices 0 05-13-2011 03:00 PM
Feature request: Import Folder with Subfolder and Categories them as such c4rp3d13m Calibre 1 01-10-2011 02:28 PM
Import Date: Bug or Feature? DobraGolonka Calibre 19 08-24-2010 11:47 AM
Feature Request at the import-function ralphffm44 Calibre 4 04-02-2010 01:14 PM


All times are GMT -4. The time now is 05:32 PM.


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