Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-02-2013, 06:00 AM   #1
DedTV
Enthusiast
DedTV began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Dec 2009
Device: PRS-505; Galaxy Tab 7
Export Category Editor data

Is there any way to export the data displayed in the Category Editor (particularly tag and series)?

I've been finding things like "brother" and "sister" are each used once as tags but there's 40 books with "siblings". With almost 4k tags in my library, I've been trying to pare things down to more manageable sizes. But things like the example I used don't stick out when they're in one looong list of tags like they are in the Category Editor inside Calibre.

Currently the method I'm using is that I exported the tags using "calibredb catalog tags.csv --fields tags", deduped and fiddled with the list in Excel until I got a master list of tags, then imported them into Access and have been separating them out into themed tables and noting ones that can be merged or deleted. But I keep having to go back to Calibre to check the counts on tags to find out which tag gets kept and which gets pruned and being tethered to my library (which resides on my home NAS) means I can't easily use all the free time I have while away from home (those 3 hour layovers at LAX suck).

So, before I spend too much more useful free time flipping back and forth between access and calibre, I figured I'd see if it's possible to somehow get the data calibre shows outside of Calibre because if I didn't, I'd end up finding out there's some super simple and obvious way to do it that I overlooked after I've spent 100 hours doing it the hard way
DedTV is offline   Reply With Quote
Old 06-02-2013, 01:20 PM   #2
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,737
Karma: 26785684
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Samsung Galaxy Tab S8 Ultra
Check out what DoctorOhh did.

https://www.mobileread.com/forums/sho...82#post1522482

I suspect that would be the quickest and easiest way for you to fix your tags.
Adoby is offline   Reply With Quote
Advert
Old 06-02-2013, 05:53 PM   #3
DedTV
Enthusiast
DedTV began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Dec 2009
Device: PRS-505; Galaxy Tab 7
Quote:
Originally Posted by Adoby View Post
Check out what DoctorOhh did.

https://www.mobileread.com/forums/sho...82#post1522482

I suspect that would be the quickest and easiest way for you to fix your tags.
I've been doing that for long while. I even went a bit further than he did in fact and made a json file that maps every genre tag Goodreads has (and I posted the root of that file here). Without that the job would be MUCH bigger than it is.

But many of the books I have do not have tags, or even listings on Goodreads (my library has around 70k books, all legal). So I've pulled tags for those books from numerous other sources. The goodreads plugin can't clean those tags up and there isn't a plugin with the same functionality that works with existing tags or tags from other metadata sources and plugin creation is beyond my skill so a mostly manual solution is the only choice ATM.

Last edited by DedTV; 06-02-2013 at 05:54 PM. Reason: typo
DedTV is offline   Reply With Quote
Old 06-02-2013, 06:44 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@DedTV - Suggestion

Have you considered using a copy of the calibre database «metadata.db» as a resource to assist you in getting the job done.

The three tables I thought might be useful are books, tags and books_tags_link.

You can use the SQLite Database Browser to peruse the schema and contents, and execute SQL Commands

You may even be able to use a SQLite ODBC driver to hook the database into Access.

BR
BetterRed is offline   Reply With Quote
Old 06-03-2013, 12:11 AM   #5
DedTV
Enthusiast
DedTV began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Dec 2009
Device: PRS-505; Galaxy Tab 7
Quote:
Originally Posted by BetterRed View Post
@DedTV - Suggestion

Have you considered using a copy of the calibre database «metadata.db» as a resource to assist you in getting the job done.
I used SQLite Admin to dump several tables to clean up titles and authors. I should have also used it to get the list of existing tags as it would have saved me a few minutes of removing the dupes.

If I knew SQL (or databases) better I could probably do a lot more to help myself but the limit of my "expertise" with SQL beyond simple SELECT queries is Googling to find a query that does what I need to do.

I'm even worse with Access and am only using it because I found a step by step guide to sorting a flatfile database into tables which works better than trying to do it with Excel as I was trying to do first.

Edit: Decided to play around with it and I've gotten close. The best I could do is get is (what I think is) the counts via a "select tag, count(*) from books_tags_link group by tag;" query but I haven't figured out how to link that up with a query to link it with the actual tag name.

Although, thinking about it, I could simply just export the tag table and the result of the query and match them up in Excel.
Yup. That worked!

Last edited by DedTV; 06-03-2013 at 12:27 AM.
DedTV is offline   Reply With Quote
Advert
Old 06-03-2013, 12:57 AM   #6
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,737
Karma: 26785684
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Samsung Galaxy Tab S8 Ultra
I suspect that you could use calibre to examine the database. Only have metadata.db in the library, without any of the books. Just make sure that you don't use the column formats. And don't open any books.

I don't think that calibre tries to access the actual books, unless it tries to check what formats are available or if you try to open a book.
Adoby is offline   Reply With Quote
Old 06-03-2013, 04:06 AM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,662
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DedTV View Post
Edit: Decided to play around with it and I've gotten close. The best I could do is get is (what I think is) the counts via a "select tag, count(*) from books_tags_link group by tag;" query but I haven't figured out how to link that up with a query to link it with the actual tag name.

Although, thinking about it, I could simply just export the tag table and the result of the query and match them up in Excel.
Yup. That worked!
Great

Something like INNER JOIN tags ON books_tags_link.tag=tags.id might have done the trick too, not on calibre system so i can't test.

Glad I could help - sounds like you're in the home straight.

BR

Last edited by BetterRed; 06-04-2013 at 01:33 AM.
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Testpoints etc. for USB Data+ & Data- ? Upprcalypse Kindle Developer's Corner 5 03-16-2013 12:47 PM
MobileRead Help determining category John F Book Clubs 6 02-25-2012 07:05 PM
category filter arvalin Library Management 10 03-26-2011 05:49 PM


All times are GMT -4. The time now is 03:15 PM.


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