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 08-17-2020, 08:44 AM   #1
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Efficient tag management??

Hi folks,

I would like to clean up the mess in my tags (4565 different ones)
For that I want to export the tags, along with all the related books, in order to analyse this further in Excel

I know I can export a catalog, but then all the tags are on one single field, comma separated, which is not quite usable

Ideally, I would like something like
tag1 - book1
tag1 - book2
...
tag2 - book1
tag2 - book2
...

Any clue on how to do this?
Or any other brilliant idea about efficient tag management?

Thanks!
Patrick Derwael is offline   Reply With Quote
Old 08-17-2020, 09:12 AM   #2
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 13,450
Karma: 239219453
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
The tag browser should do exactly what you describe.
Attached Thumbnails
Click image for larger version

Name:	Tags_LI.jpg
Views:	260
Size:	1.19 MB
ID:	181393  
Sirtel is online now   Reply With Quote
Advert
Old 08-17-2020, 09:47 AM   #3
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Sure, I know that, but this is not what I call "tag management"

I want to analyse the existing tags on order to improve their quality and accuracy

By exporting to Excel, I want to be able to easily identify (for example)
- synonymous tags which could be combined together
- series with very different tags (which should normally happen)
- typos in tags
- books without tags (or potentially too few/too many) tags
- etc...
Patrick Derwael is offline   Reply With Quote
Old 08-17-2020, 09:49 AM   #4
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 13,450
Karma: 239219453
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by Patrick Derwael View Post
Sure, I know that, but this is not what I call "tag management"

I want to analyse the existing tags on order to improve their quality and accuracy

By exporting to Excel, I want to be able to easily identify (for example)
- synonymous tags which could be combined together
- series with very different tags (which should normally happen)
- typos in tags
- books without tags (or potentially too few/too many) tags
- etc...
I've found the easiest way to manage tags is to delete all tags from new books immediately after import and add my own tags later when cleaning up the metadata. To try to make sense of the mess the default tags bring with them is a waste of time and energy.
Sirtel is online now   Reply With Quote
Old 08-17-2020, 09:55 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,335
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Create a csv catalog and import that to excel
kovidgoyal is online now   Reply With Quote
Advert
Old 08-17-2020, 09:58 AM   #6
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Quote:
Originally Posted by Sirtel View Post
I've found the easiest way to manage tags is to delete all tags from new books immediately after import and add my own tags later when cleaning up the metadata. To try to make sense of the mess the default tags bring with them is a waste of time and energy.
Everyone has his own method; there is nothing like "the one and only" method
I'm through that "waste of time" up to the letter V
Having almost finished, what I'm looking for is a not-too-complicated way to perform cross checks (after I will have finished obviously)
Patrick Derwael is offline   Reply With Quote
Old 08-17-2020, 10:00 AM   #7
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Create a csv catalog and import that to excel
Sure, but all the tags are then comma separated in one single cell
In other words, I have a relationship book --> tags
What I need is a relationship tag --> books
Patrick Derwael is offline   Reply With Quote
Old 08-17-2020, 10:09 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,335
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont use excel, but I would be amazed if it didnt have an easy way to split up comma separated data into multiple cells
kovidgoyal is online now   Reply With Quote
Old 08-17-2020, 10:11 AM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,037
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I use the Manage option for each section in the Tag Browser and good old Eyeball Mk I.
The advantage is I can check NOW, what books are associated with that tag.
Especially with Series, Duplicates or Singles (books ONLY have the same Series name), the Manage Series PI helps (I add the Authors initials in paren to a series to break a tie: Magic (AN)

The only tool I wish it had, is a 'compound Tag splitter' (takes the Tag and allows commas to be inserted which makes that into the multiple tags)
OK another tool : Hierarchical flipper. (I don't type well, so any help is good)
Hardboiled Detective I add the dot (Hardboiled.Detective) then flip -> Detective.Hardboiled
theducks is offline   Reply With Quote
Old 08-17-2020, 11:18 AM   #10
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Quote:
Originally Posted by kovidgoyal View Post
I dont use excel, but I would be amazed if it didnt have an easy way to split up comma separated data into multiple cells
Excel can indeed easily split a list of tags into several values. That is absolutely not an issue
The complex part (at least with my knowledge of Excel) is then to keep the relationship between each tag and all the related books

This is why, instead of a "can do" situation, I'm looking for a straightforward (i.e. application provided) solution
Patrick Derwael is offline   Reply With Quote
Old 08-17-2020, 11:22 AM   #11
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Quote:
Originally Posted by theducks View Post
I use the Manage option for each section in the Tag Browser and good old Eyeball Mk I.
The advantage is I can check NOW, what books are associated with that tag.
Especially with Series, Duplicates or Singles (books ONLY have the same Series name), the Manage Series PI helps (I add the Authors initials in paren to a series to break a tie: Magic (AN)
I was not aware of the Manage tags option. Thanks for the pointer
Still this does not have the flexibility (and analysis power) of a proper "catalog by tags" export to Excel
Patrick Derwael is offline   Reply With Quote
Old 08-17-2020, 12:03 PM   #12
Difflugia
Testate Amoeba
Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.Difflugia ought to be getting tired of karma fortunes by now.
 
Difflugia's Avatar
 
Posts: 3,049
Karma: 27300000
Join Date: Sep 2012
Device: Many Android devices, Kindle 2, Toshiba e755 PocketPC
Quote:
Originally Posted by Patrick Derwael View Post
Ideally, I would like something like
tag1 - book1
tag1 - book2
...
tag2 - book1
tag2 - book2
...

Any clue on how to do this?
The tag information is stored in the SQLite database file metadata.db. If you're comfortable using the command line and willing to access the database file directly, you can get exactly what you want.

First, here's the query in case you don't need the rest of the explanation:
Code:
SELECT a.name, b.author_sort, b.title
FROM tags a, books b, books_tags_link c
WHERE a.id = c.tag AND b.id = c.book
ORDER BY a.name, b.author_sort, b.title;
The command line tool for can be downloaded from the SQLite website here. Under Precompiled Binaries for Windows, you want "sqlite-tools-win32-x86-3330000.zip". The zip file contains three executables, one of which is named "sqlite3.exe".

My suggestion is that you create a separate working directory for this. First, make a copy of the "metadata.db" file from your Calibre directory in the new directory (the tool will let you make irreversible changes to your Calibre database, so work from a copy). Then copy the "sqlite3.exe" file into the same directory. Finally, create a text file named "tags.sql" in the directory and paste the above query into it.

Open a Windows command line and cd to the directory you created. Type "sqlite3 metadata.db" and you should see the following:
Code:
SQLite version 3.33.0 2020-08-14 13:23:32
Enter ".help" for usage hints.
sqlite>
The command ".read some_file" will execute SQLite commands from some_file. The command ".output some_other_file" will redirect all output to the file instead of the screen. Type or paste the following commands at the sqlite> prompt to create a "tags_output.csv" file that you can import into Excel.
Code:
.output tags_output.csv
.read tags.sql
.quit
Unfortunately, the field separator isn't a comma, but a vertical bar. I guess that means it's not actually a CSV file, but if you're comfortable importing files into Excel, I assume you can find the spot in the dialog that lets you pick a different delimiter.
Difflugia is offline   Reply With Quote
Old 08-18-2020, 03:33 AM   #13
Patrick Derwael
Enthusiast
Patrick Derwael began at the beginning.
 
Posts: 42
Karma: 10
Join Date: Oct 2018
Location: Belgium
Device: none
Quote:
Originally Posted by Difflugia View Post
The tag information is stored in the SQLite database file metadata.db. If you're comfortable using the command line and willing to access the database file directly, you can get exactly what you want.
Hi
Thanks a bunch, this is EXACTLY what I wanted
Knowing now this is SQLite, I was wondering: is the DB structure documented somewhere?
That might be extremely useful for all sorts of data analysis (I'm a big fan of such exercise )

Thanks again
Patrick Derwael is offline   Reply With Quote
Reply

Tags
tag management


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tag Mapper: Remove tag if another specific tag exists? ownedbycats Library Management 2 07-23-2020 10:32 PM
The Most Efficient Way to Publish an eBook swisherpackers Self-Promotions by Authors and Publishers 0 06-06-2014 10:30 PM
Tag Management lucidcrux Calibre 7 08-19-2010 09:55 AM
HELP -- Any efficient way to synchronize folders? mr.giroro iRex 27 03-27-2008 05:58 AM


All times are GMT -4. The time now is 05:05 AM.


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