|
|
#1 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Aug 2010
Location: Treviso, Italy
Device: none
|
[solved] Massive import batch process
Hy Guys,
I need to import 800 books' titles from a csv file. I've developed a routine that read this list and print ino a file (addBooks.py) a list of python commands blocks like the following one: Code:
# coding:utf-8
from calibre.library.database2 import LibraryDatabase2
from calibre.ebooks.metadata import MetaInformation
db = LibraryDatabase2("G:/dloads/Ebooks")
#BLOCK repeated
m1 = MetaInformation("Memoria delle mie puttane tristi", ["Garcia Marquéz Gabriel"])
m1.tags = ["BlueBook"]
m1.series = "BlueBook(49)"
db.add_books(["C:/fake.doc"], ["doc"], [m1], add_duplicates=True)
#END OF BLOCK repeated
I try to feed Calibre with the following command: Code:
calibre-debug -e c:\addBooks.py Code:
[...]You must not use 8-bit bytestrings unless you use a text_factory that[ecc.] How can I solve the problem? Have I other ways to import from my csv list? Thanks bazu Last edited by bazu; 08-07-2010 at 01:47 AM. |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,618
Karma: 28549044
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Stick a u before each string
so use: u"Garcia Marquéz Gabriel" or safer replace non ascii chars with their unicode code points u'Garcia Marqu\xe9z Gabriel' |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Aug 2010
Location: Treviso, Italy
Device: none
|
Goog shot Kovid! All works!
Thank you very much |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Massive wave of ebook piracy? | fjtorres | News | 608 | 11-10-2010 12:52 PM |
| Massive Kindle load questions | kcallis | Calibre | 1 | 09-26-2010 09:29 AM |
| massive eReader coversion failure | Nate the great | Calibre | 2 | 02-20-2010 09:48 PM |
| Massive thumbs up to Diesel EBooks | PDS | Reading and Management | 9 | 03-18-2009 07:48 PM |
| Massive conversion in .prc | idum | Kindle Formats | 2 | 11-10-2008 09:22 AM |