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

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 10-31-2019, 07:57 PM   #1
kylecarroll
Junior Member
kylecarroll began at the beginning.
 
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).
kylecarroll is offline   Reply With Quote
Old 10-31-2019, 08:28 PM   #2
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 3,378
Karma: 32493247
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
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.
jhowell is offline   Reply With Quote
Advert
Old 11-01-2019, 02:52 AM   #3
kylecarroll
Junior Member
kylecarroll began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Oct 2019
Device: Kindle
Thanks! The Database API is exactly what I needed. Got it working now!
kylecarroll 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
[Plugin] SubsetFonts - Simple font subsetter Doitsu Plugins 22 11-21-2018 07:34 AM
creating an output (export) plugin foobert5 Development 1 02-12-2016 07:21 PM
Help creating a simple expression santiagodraco Library Management 1 05-24-2012 07:30 PM
Need advice for creating a slightly odd type of plugin ldolse Development 4 05-25-2011 12:31 PM
Trouble creating a plugin. A0tmsk Plugins 2 04-26-2011 01:19 AM


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


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