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

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 05-11-2020, 11:06 PM   #1
Rellwood
Library Breeder
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 646
Karma: 1900141
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
How can I manage two different columns holding the same data?

I want some help or suggestions on keeping track of, and maintaining two different custom columns with tags shown in the browser. The columns hold the same information but one is hierarchal, and one isn’t.

It’s a book source column. It’s been around almost as long as I have had Calibre. It started with Amazon, Kindle Unlimited, and Library, but it has grown over the years to 50 different tags. I can’t change the tags or the column because it’s in use in tweaks, plugins, and rules. On their own in the book list and when editing the metadata the tags are great. When looking at them in the browser, they suck. Strictly alphabetizing tags isn't a good thing when you use many of them only a few times and the ones you use the most aren't grouped together.

Today I decided to create a new column to hold “Book Source” tags, but in hierarchal form, strictly for use in the tag browser. Hierarchal tags are ugly outside the browser. I don’t want to deal with manually inputting them, or having them high up in my edit metadata custom column order, or booklist view. I plan on hiding the column everywhere but the browser, and hiding the original Book source column in the browser, but showing it everywhere else.

I am asking for help or suggestions on how I can have the original book source field be filled in manually with “Amazon” and have the hierarchal book source column automatically fill in with “0 – Main Sources.Retail.Amazon”, and so on matching up each original tag with a heirarchal. I know I can do a quck copy/replace when starting out, but as the time goes on and new books are brought in, how can I keep it up?

I am afraid that if I manually have to type this field in, it will change because of input error and just forgetting which tag matches with the original one.
Rellwood is online now   Reply With Quote
Old 05-12-2020, 12:00 AM   #2
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 5,427
Karma: 5757254
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Not an expert but, for me, the best option would be a composite column, with a program/expression that would copy the original value from the manual one doing the tweaking you need for a hierarchical view.
Terisa de morgan is offline   Reply With Quote
Advert
Old 05-21-2020, 01:34 PM   #3
Rellwood
Library Breeder
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 646
Karma: 1900141
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
Quote:
Originally Posted by Terisa de morgan View Post
Not an expert but, for me, the best option would be a composite column, with a program/expression that would copy the original value from the manual one doing the tweaking you need for a hierarchical view.
I'm wondering how that would work.

Example - Orignal Column - Amazon
Heirarchal Column - 0 - Main Sources.Retail.Amazon

I wish I could figure out a one - to - one copy because I have other shelves that this would work for, the tags won't change, but keeping up with them sucks, and I wouldn't have so many columns to fill out.

I think what I want is this

If Original column contains Amazon then heirarchal column contains 0 - Main Sources.Retail.Amazon

And so on for each pair.

Is that possible. Create a list of paired tags and have them show up in their colums?

Last edited by Rellwood; 05-21-2020 at 01:41 PM. Reason: additional info
Rellwood is online now   Reply With Quote
Old 05-21-2020, 01:43 PM   #4
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 5,427
Karma: 5757254
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by Rellwood View Post
I'm wondering how that would work.

Example - Orignal Column - Amazon
Heirarchal Column - 0 - Main Sources.Retail.Amazon

I wish I could figure out a one - to - one copy because I have other shelves that this would work for, the tags won't change, but keeping up with them sucks, and I wouldn't have so many columns to fill out.
I've done it... with a python template function, adapted to the changes I want. I'm sure it can be done in program mode or so on, but I don't handle it quite well.
Terisa de morgan is offline   Reply With Quote
Old 05-21-2020, 01:58 PM   #5
Rellwood
Library Breeder
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 646
Karma: 1900141
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
Quote:
Originally Posted by Terisa de morgan View Post
I've done it... with a python template function, adapted to the changes I want. I'm sure it can be done in program mode or so on, but I don't handle it quite well.
What do you mean "You don't handle it quite well"?

If someone out there is willing to accept a donation, I could email a list created from the .db of paired items and they can somehow detail how to create a template for those pairs. Helpful for all those columms. Or at the least, can someone provide me a template that I can use?
Rellwood is online now   Reply With Quote
Advert
Old 05-21-2020, 02:04 PM   #6
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 5,427
Karma: 5757254
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by Rellwood View Post
What do you mean "You don't handle it quite well"?
That I'm not able to create templates but I'm able to program a function, that's what I'm mean.
Terisa de morgan is offline   Reply With Quote
Old 05-21-2020, 02:09 PM   #7
Rellwood
Library Breeder
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 646
Karma: 1900141
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
Ah...how is that different?
Rellwood is online now   Reply With Quote
Old 05-21-2020, 02:22 PM   #8
chaley
Grumpy old git
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 9,108
Karma: 2792640
Join Date: Jan 2010
Location: UK
Device: Many android devices
Quote:
Originally Posted by Terisa de morgan View Post
That I'm not able to create templates but I'm able to program a function, that's what I'm mean.
(With apologies to "Terisa de morgan" for butting in...) She is saying that she is more comfortable programming in python than in calibre's template language.

A "calibre user defined template function" is pure python, requiring you to know how to program in that language and how to use them in a template. The "calibre template functions" are native to calibre, requiring little extra knowledge unless you are writing in calibre's Program Mode in which case it helps to have a programming background.

I can help with a calibre template but I need concrete examples of all the transformations you require, along with what to do if no transformation applies.
chaley is offline   Reply With Quote
Old 05-21-2020, 03:24 PM   #9
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 5,427
Karma: 5757254
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by chaley View Post
(With apologies to "Terisa de morgan" for butting in...) She is saying that she is more comfortable programming in python than in calibre's template language.

A "calibre user defined template function" is pure python, requiring you to know how to program in that language and how to use them in a template. The "calibre template functions" are native to calibre, requiring little extra knowledge unless you are writing in calibre's Program Mode in which case it helps to have a programming background.

I can help with a calibre template but I need concrete examples of all the transformations you require, along with what to do if no transformation applies.
Thank you for explaining it much better than me. Yes, I'm more comfortable with programming (around 35 years doing it )
Terisa de morgan is offline   Reply With Quote
Old 05-21-2020, 05:09 PM   #10
Rellwood
Library Breeder
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 646
Karma: 1900141
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
Quote:
Originally Posted by chaley View Post
(With apologies to "Terisa de morgan" for butting in...) She is saying that she is more comfortable programming in python than in calibre's template language.

A "calibre user defined template function" is pure python, requiring you to know how to program in that language and how to use them in a template. The "calibre template functions" are native to calibre, requiring little extra knowledge unless you are writing in calibre's Program Mode in which case it helps to have a programming background.

I can help with a calibre template but I need concrete examples of all the transformations you require, along with what to do if no transformation applies.
I'll DM you, I need to organize the list..THANK YOU!
Rellwood is online now   Reply With Quote
Old 05-23-2020, 04:08 AM   #11
chaley
Grumpy old git
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 9,108
Karma: 2792640
Join Date: Jan 2010
Location: UK
Device: Many android devices
Quote:
Originally Posted by Rellwood View Post
I'll DM you, I need to organize the list..THANK YOU!
Thanks for the list. Unfortunately I can't do what you want to do without coding the rules by hand, which I can't do in the template language. The reason: there are no "rules" that I can see to map booksource to the composite column. In other words, the process requires what is your head, not what is in the data. Example: how can the program know that "Amazon" goes into a different hierarchy than "Kobo"? You know, but calibre doesn't.

More work for you but doable:
  1. You make a column "Text, shown in the tag browser" where the values are all the prefixes. A quick count indicates you have some 15 of these. Why not "Fixed set of values"? That type would work well if you are sure about the prefix values. It is harder to change your mind because there isn't any operation to rename one of the values in both the booklist and the field definition. (Yes, there probably should be. )
  2. For each book, set the new column to the correct prefix. Given that you know that mapping from item to prefix you can do this in bulk medatadata edit. Search for books with the value then use bulk edit to set the prefix value. As there are approx 50 different sources, you would need to do 50 search/edit operations.
  3. Make a composite column that combines the prefix column and the source column. The template would be something like
    Code:
    program:
        source = field('booksource');
        prefix = test(source, field('#prefix'), '');
        test(prefix, 
            strcat(prefix, '.', field('#booksource')),
            '1 - Calibre.Missing Original Source'
        )
    It says that if either the prefix or the source is empty then the answer is '1- cal...', otherwise the answer is prefix.source.
  4. From then on, for each new book set the source and the prefix.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to better manage titles/meta data PhoenixDown Amazon Kindle 1 04-16-2020 03:55 PM
Automatically add in data into columns when adding books yamusing Library Management 6 07-29-2019 08:44 PM
I Need Help merging data from multiple custom columns thejoker954 Library Management 0 07-23-2018 06:12 PM
composite columns only effect part of data Jade Aislin Library Management 2 04-13-2016 04:54 PM
using templates/pyhon and custom columns to extract specific data from tags smoothrolla Library Management 6 11-10-2011 05:12 PM


All times are GMT -4. The time now is 02:54 PM.


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