Plugboard, template, and custom composite column recipes
#131  chaley 01-09-2011, 05:12 AM
The first tag is the one in the front of the list, in alphabetic (case-insensitive) order.

What scenario are you thinking of?

#132  nynaevelan 01-09-2011, 01:39 PM
Quote chaley
The first tag is the one in the front of the list, in alphabetic (case-insensitive) order.

What scenario are you thinking of?
I am not sure, in most cases it is not the the first one that I want but the second but how would you tell it to pick the second one if more than one exist but the first one if only one exists?? But if that is not doable, it can stay as it is.

#133  chaley 01-09-2011, 01:49 PM
{tags:'switch(count($, ','), 1, $, list_item($, 1, ','))'}

#134  nynaevelan 01-09-2011, 02:33 PM
Thank you for all your help.

#135  ThePage 01-16-2011, 06:36 PM
I've been working exclusively with the GUI, as my only reader at the moment is an Ebookwise with it's own limited conversion/Library software elsewhere on my PC.

My previous efforts at cataloging my Library were on the AZZ Cardfile program, where I've also kept a list of my Custom Columns for Calibre.

Several of these had to be redone because I had chosen them originally as non-comma'd versions. I therefore recommend using the commas unless you are absolutely certain that they will never be needed!

With one exception these are all being filled in by "hand" w/o any {}.

Not sure whether these would count as recipes, but they are hereby offered below as some may find the examples useful:

Column type/{} if any/search designation in lower case/column Heading

Column built from other columns/{format}/format/eFormats
showing all the formats present that are recognized by Calibre for each book, previously discussed in FAQ

Ratings, shown with stars/myrate/My Rating
as opposed to those supplied by others

Floating point numbers/price/Retail recording cover price or equivalent

Text, but with a fixed set of permitted values/drm/DRM
Notes the original Encrypted Format purchased, if any.

Comma separated text, like tags, shown in the tag browser/award/Awards
citing both Wins and Nominations

Comma separated text, like tags, shown in the tag browser/genre/Genres
not as yet used

Comma separated text, like tags, shown in the tag browser/length/Length
includes both Fictionwise VS/S/M/L/VL (coded below as L1 thru L5) as well as "Named" Lengths: Flash & Micro-Fiction, Shortstories vs. Short for Non-fiction, and Novelet(te)s vs. Novellas vs. Novels & Omnibus Volumes

Comma separated text, like tags, shown in the tag browser/line/Lines
such as Romance lines: Intrigue, Blaze, Desire, etc., with or without line #'s

Comma separated text, like tags, shown in the tag browser/myseries/My Series

Comma separated text, like tags, shown in the tag browser/otherfmt/Other Formats
as Paper, Trade, Hardcover, Leatherbound, Stageplay & Audio

Comma separated text, like tags, shown in the tag browser/note/Notes
such Signed, First Edition, as well as corrections needed, Etc.

Comma separated text, like tags, shown in the tag browser/setting/Settings such as Ireland, Scotland, name of town, etc.

Comma separated text, like tags, shown in the tag browser/subject/Subjects

Long text, like comments, not shown in tag browser/com2/My Comments

Long text, like comments, not shown in tag browser/comm/Other Comments

Text,column shown in the tag browser/cat/Catalog
personal catalog # in previous use matching cover art in separate folder

This was originally intended to get rid of idiosyncratic file names and allow me to locate and view the covers, which the cardfile couldn't readily handle, but still has secondary benefits, as I can store multiple covers here, and change them off if desired, as well as copying the best of them to folders accessed by my screensaver for a slideshow, and can break the latter down by style such as vintage pulp, watercolor, etc. The screensaver runs more smoothly using the catalog #'s than it did when they had regular titles attached.

Text,column shown in the tag browser/code/Code
is a personal alpha-numeric code based on the Word-Length of Books -
for example, L3aj includes a 2.4H (hour) reading time for a mid-length book described by some as a novella.

Text,column shown in the tag browser/issue/Issue
such as Magazine, Webscription or other Issue data

Text,column shown in the tag browser/time/Time
Reading time in Decimal Hours as 2.4H, Etc. rounded up
from the high end Fictionwise Reading time in minutes

Yes/No/coll/ACMO for Anthologies, Collections, Magazines & Omnibi
a yes shows that there will be further information in other columns


Yes/No/mark/Mark as recomendation for or against for my brother at home who actually reads

Yes/No/read/Read (by me)

#136  assur191 01-20-2011, 12:19 PM
I just purchased a Kindle, and I wish to have the title of each book include not only the series name, but also the over-arching meta series name and index, if available. For example:

The book "Rogue Squadron" is book one of the series "X-Wing", which is itself a part of the meta-series "Star Wars". I would like the title to appear as "Star Wars: X-Wing - 01 - Rogue Squadron". I have created a custom field in Calibre titled "Meta Series" which holds the data "Star Wars". I'd want to be sure that the colon or dash marks don't appear if there is nothing in the fields.

How would I go about setting up a pegboard for this? Any help is appreciated.

Thank you.

#137  pchrist7 01-23-2011, 05:23 AM
Hi All
The following HOWTO was developped in another thread.

Chaley suggested to put it here as well.

Do you have a Kindle ?
Did you ever want Calibre to show "Read Status" of your books in a column ?
Automagically ?

Then the following might for you as well.

You must be running Calibre 0.7.40 or newer to use this.
Also you must use "Fetch annotations" from you Kindle.

The following example is based on the following Kindler requirements:
"What I want is a custom column to show the "Last Opened" Date if Last location read > 95%.
If the book shows >0% but < 95%, I want the column to show "Reading"
And if the book is 0%, or unopened, the column should show "Not Read".

Howto "Fetch annotations" from you Kindle:
Start Calibre,
Connect your Kindle, wait a bit,
Click on the arrow just to the right of the "Send to Device" icon,
choose "Fetch Annotations"
and the Kindle "Book status" is added to the Calibre book details, in the comments.

You should Fetch fresh Annotations everytime you connect your Kindle to get updated information.

This is just an example of what I could get with my K3:

Last Page Read: Location 7365 (68%)
Location 4603 • Bookmark
Location 4942 • Bookmark
Location 4980 • Bookmark
Location 5984 • Bookmark
Location 7363 • Bookmark

The best/fastest way, but hardest way, to get the needed information into a custom column, is to use Python Template functions.
Sounds scary, but don't worry. Copy/paste is your helper

Simply do as follows:

1) go to Preferences -> Advanced -> Template Functions.

2) in the Function box type: kindle_read_status

3) in the Arg count box type: 4

4) in the Documentation box, paste the following:

Check if the associated field contains a kindle annotation for percent read.
If not, return no_page_read_str.
If annotations are found, then compare that percent against is_read_pct.
If the val is larger, then return date,
if the val is >0 and < is_read_pct return is_reading_str.
Otherwise return is_not_read_str.
One usage: {comments:kindle_read_status(95,Not Read,Reading)}
( use the above when defining your custom column )
95 goes into variable is_read_pct
Not Read goes into variable no_page_read_str
Reading goes into variable is_reading_str
Feel free to change the %, the test strings to suit your needs.
Do this in the custom column definition.
5) In the Program Code box, paste the following:
def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct,	is_reading_str, no_page_read_str):	try:	test_val = int(is_read_pct)	except:	return 'is_read_pct is not a number'	import re	mg = re.match('.*\s(\d+[-/]\d+[-/]\d+).*?Last Page Read: Location \d+ \((\d+)%\)', val, re.I + re.DOTALL);	if mg is None:	return no_page_read_str	date =	pct =	try:	f = int(pct)	if f > test_val:	return date	elif f > 0:	return is_reading_str + ': ' + pct + '%'	except:	pass	return no_page_read_str
6) press the Create button, then the Apply button.

7) Still in Preferences, Choose Add your own columns

8) Choose Add custom column bar at the bottom

9) enter the following into your custom column:
Lookup name: read_status
Column Heading: Read Status
Column type: Column built from other columns
{comments:kindle_read_status(95,Reading,Not Read)}
10) Choose Apply

11) Click Ok to the Restart Warning

12) Shutdown Calibre

13) Start Calibre

If you followed instructions minutely, you should have a new column showing the "Read Status" for your books.

If you like this functionality, please remember to send some Karma to chaley

He has been absolutely fantastic and helpfull with this.

If this fails, please try one more time before posting to this thread.
This has been tested by several Kindlers succesfully.


Note: If you want a text returned instead of a date when a book is read
have a look here:

#138  nynaevelan 01-24-2011, 01:58 AM
Very interesting, one question though: Why does this new column not show up in the columns section on the left? Now I have to go "read" books I have already read so that they are all registering correctly. Thank you all for this one.


#139  DoctorOhh 01-24-2011, 02:12 AM
Quote nynaevelan
Very interesting, one question though: Why does this new column not show up in the columns section on the left?
Maybe calibre has to be restarted for this to show there.

#140  nynaevelan 01-24-2011, 02:20 AM
Quote dwanthny
Maybe calibre has to be restarted for this to show there.
No, a restart does not produce it either, but no big deal.

One more question: Is there a way to adjust the template to pull the annotations from K4PC, since that is easier to use to go back to adjust the locations for the books?

 « First  « Prev Next »  Last »  (14/89)
Today's Posts | Search this Thread | Login | Register