10-31-2019, 06:57 PM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2019
Device: Kindle
|
Help creating a very simple statistics plugin?
Hey all! I have a python program that I wrote which takes a CSV export from Calibre and gives you your stats such as Number of books owned, number read, average rating, titles of current reads, etc. Ever since I found out that development in Calibre is done in python, I've been wanting to move this functionality into Calibre itself so that all I have to do is press a button on the interface and have a pop up tell me all those fun stats.
However...I'm relatively new to Python. I can handle python on its own but I'm having trouble integrating it into Calibre. Can someone give me some pointers on how I would do this? I'm currently using the interface plugin demo as a starting point while I learn. I was able to get all the text I need into a popup, but I can't figure out how to iterate over all of the book IDs and parse their metadata to create the variables (which would then be passed into the string of text). |
10-31-2019, 07:28 PM | #2 |
Grand Sorcerer
Posts: 6,498
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
I suggest that you look at the existing plugins and find one or two that do something similar to what you need. You can then download, unzip, and examine the python code to see how they work.
Also check out documentation like the Plugin API and Database API. |
11-01-2019, 01:52 AM | #3 |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2019
Device: Kindle
|
Thanks! The Database API is exactly what I needed. Got it working now!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] SubsetFonts - Simple font subsetter | Doitsu | Plugins | 22 | 11-21-2018 06:34 AM |
creating an output (export) plugin | foobert5 | Development | 1 | 02-12-2016 06:21 PM |
Help creating a simple expression | santiagodraco | Library Management | 1 | 05-24-2012 06:30 PM |
Need advice for creating a slightly odd type of plugin | ldolse | Development | 4 | 05-25-2011 11:31 AM |
Trouble creating a plugin. | A0tmsk | Plugins | 2 | 04-26-2011 12:19 AM |