![]() |
#1 |
jojobar
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 & 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 |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
jojobar
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20
Karma: 480294
Join Date: Jun 2010
Device: prs-900
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#5 |
jojobar
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 |
jojobar
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?
|
![]() |
![]() |
![]() |
Tags |
calibre, xml import |
|
![]() |
||||
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 |