|  12-17-2010, 07:41 AM | #16 | 
| Junior Member  Posts: 3 Karma: 10 Join Date: Dec 2010 Device: K3 | 
			
			Thanks for catching my eye on azw files. I've changed 466 line from Code: print collDesc.encode('utf-8')Code: print collDesc edit. After while i think it could be os depedent, i'm running your script at linux where utf-8 is default encoding, windows (with kernel 6.x - vista, 7, 2k8) use utf-16. Calibre force utf-8 to write metadata file? or use system encoding? Last edited by ch4os; 12-17-2010 at 07:44 AM. | 
|   |   | 
|  12-17-2010, 07:58 AM | #17 | |
| Connoisseur        Posts: 63 Karma: 732 Join Date: Nov 2010 Device: Sony PRS-650 | Quote: 
 Glad the edit works for you, though. Did you try out the most recent version of the script, incidentally? I'm still not able to test it on the kindle, so I'd appreciate some reassurance that it works. | |
|   |   | 
| Advert | |
|  | 
|  12-18-2010, 04:33 AM | #18 | 
| Junior Member  Posts: 3 Karma: 10 Join Date: Dec 2010 Device: K3 | 
			
			I've tested latest version of your script and with my 'edit' everything works fine, great job it should be built-in into calibre    | 
|   |   | 
|  12-18-2010, 03:45 PM | #19 | 
| Addict            Posts: 272 Karma: 1050426 Join Date: Feb 2010 Location: California Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer | 
			
			I have a custom column thats called "In Collection" this column is a text, but with a set of  permitted values.  These values are the collections I have currently on my Kindle. When I add a book to my library I select which collection it will go in. How would I be able to alter you script to fit my set up? Thanks | 
|   |   | 
|  12-18-2010, 04:45 PM | #20 | |
| Connoisseur        Posts: 63 Karma: 732 Join Date: Nov 2010 Device: Sony PRS-650 | Quote: 
 You can open your calibre.metadata in a text editor to see exactly how its structured (and so from where you need to extract the values you want): It's just a json format structure. Probably it'd be something like this to obtain the values to parse (based on a quick glance at the json structure just now - I've not tested this at all): Code: mycustom = book["user_metadata"]["#mycustomcolumnid"]["#value#"] | |
|   |   | 
| Advert | |
|  | 
|  12-18-2010, 05:57 PM | #21 | 
| Addict            Posts: 272 Karma: 1050426 Join Date: Feb 2010 Location: California Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer | 
			
			Wow sounds complicated, but will give it a shot.  Thanks
		 | 
|   |   | 
|  12-18-2010, 06:28 PM | #22 | 
| Addict            Posts: 272 Karma: 1050426 Join Date: Feb 2010 Location: California Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer | 
			
			Please bare with me, I've never done this before and so I'm trying to get an understanding here.  I checked the calibre.metadata and found this pertaining to my custom column: Spoiler: 
 What do I do now with the script? | 
|   |   | 
|  12-19-2010, 03:26 AM | #23 | 
| Connoisseur        Posts: 63 Karma: 732 Join Date: Nov 2010 Device: Sony PRS-650 | 
			
			That's why I didn't do it that way in the script, but used tags/authors/series instead. Much easier. If you're not comfortable rewriting the script for your specific needs, why not just copy the custom column values into your tags using Calibre's bulk metadata edit tool? To do this: Select books to edit in calibre, right click, Edit metadata in bulk, "Search and Replace" tab. Set Search mode to "Regular Expression", Search field to your column name, search for to "(.+)" (without the quotes), replace with to "-\1" (again, without the quotes), destination field to "tags", mode to "append to field", ensure "use comma" is ticked then apply Back up your library before doing this, but it should create a new tag for each book and give that tag a dash prefix so that the script will detect it and turn it into a collection. If you don't want the collection names to have a prefix then change prefixTag in the script to an empty string (the script uses the dash to identify tags to turn into collections and then removes the dash before adding the prefixTag to the name). Last edited by mornington; 12-19-2010 at 03:34 AM. | 
|   |   | 
|  12-19-2010, 07:37 AM | #24 | |
| Zealot     Posts: 143 Karma: 387 Join Date: Sep 2010 Device: Kindle 3 | 
			
			Dear mornington, after much prep work in my calibre data, I was ready to start with revamping the collections on my Kindle today. Alas, I am getting this error message: Quote: 
 What can I do? Thanks for any help. Regards, Mixx | |
|   |   | 
|  12-19-2010, 01:17 PM | #25 | |
| Connoisseur        Posts: 63 Karma: 732 Join Date: Nov 2010 Device: Sony PRS-650 | Quote: 
 If you're using an old version then try using the latest one. | |
|   |   | 
|  12-24-2010, 04:28 AM | #26 | 
| Zealot     Posts: 143 Karma: 387 Join Date: Sep 2010 Device: Kindle 3 | 
			
			Yeah, I am using the latest version of the script. Is there a particular version of Python that needs to be used, perhaps? Thanks, Mixx | 
|   |   | 
|  12-25-2010, 11:30 AM | #27 | 
| Junior Member  Posts: 9 Karma: 10 Join Date: Dec 2010 Device: Kindle 3 | 
			
			I am getting an odd syntax error with my script, I have no idea what is wrong. I am not too familiar with Python. Could someone maybe take a look? It is on line 54. Thanks for any help.   | 
|   |   | 
|  12-25-2010, 11:42 AM | #28 | 
| Guru            Posts: 657 Karma: 64171 Join Date: Sep 2010 Location: Kent, England, Sol 3, ZZ9 plural Z Alpha Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin) | 
			
			The print in python3 needs braces () for the arguments. (I'm only just starting out in python, noticing differences between 2.7 and 3.#) | 
|   |   | 
|  12-25-2010, 02:22 PM | #29 | 
| Junior Member  Posts: 9 Karma: 10 Join Date: Dec 2010 Device: Kindle 3 | 
			
			So instead if the braces I should use the parentheses?
		 | 
|   |   | 
|  12-25-2010, 02:30 PM | #30 | 
| Grand Sorcerer            Posts: 12,525 Karma: 8065948 Join Date: Jan 2010 Location: Notts, England Device: Kobo Libra 2 | 
			
			My guess is that you should use python 2.6 or 2.7 instead of 3. There are *many* differences between python 2 and python 3, and you will have to fight your way through all of them.
		 | 
|   |   | 
|  | 
| Tags | 
| calibre, collections, kindle, kindle 3 | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| PRS-300 creating collections | terraskye | Sony Reader | 4 | 11-28-2010 10:01 AM | 
| Collections data format in 2.5 firmware | ngukho | Kindle Developer's Corner | 18 | 10-29-2010 11:19 PM | 
| Backing Up Data (Collections) | Cpl Punishment | Amazon Kindle | 14 | 10-27-2010 01:41 PM | 
| Calibre and creating Kindle collections on the PC? | guiyoforward | Calibre | 1 | 07-30-2010 02:11 AM | 
| Creating collections within collections | larlissm | Sony Reader | 2 | 10-04-2008 08:02 PM |