Extracting a list of all tags in the database?

Is there an easy way to export a complete list of all tags in the digiKam database?

Tag Manager will show the list on screen but I can’t see how to export the list.

Even a text file would be useful.

Hi there,
This is what I do to get tags into a csv-file:
First, I run linux mint 21.3 on a laptop and digikam 8.3.0 appimage, also is sqlitebrowser 3.12.1-2 installed.
1- Locate the sqlite database digikam4.db —> (for me this is on a external usb-disk)
2- Double click on digikam4.db, the database opens
3- see pictures :

digikam1

digikam2

digikam3

digikam4

Then You can view the Tags.csv file with corresponding software.
Hope this helps You.
Eric.

1 Like

Another option might be to assign all tags (keywords) to one image (preferably with side car writing enabled), then use that sidecar to get all the keywords. Though that can lead to a very large sidecar file: digikam can write keywords to several xml tags, although that can be configured.

I’d use an image I was planning to delete, so once I have all the tags recovered, cleaning up is easy.

Interesting, but I started searching in digikam and did not discover the option to assign ALL tags (keywords) to any photo. XnViewMP is similarly extended to find such operations. So… where to go searching in digikam (or XnViewMp)

That would be neat - but I am looking at 3000 or so tags (in a hierarchy) as Eric says, there needs to be a process to “apply all tags”.

Let me know if there is a workaround.

Yes sqlitebrowser helps, but I have 3000+ tags in a hierarchy and it looks like a bit of SQL is needed to extract useful info.

My best option to date is to OCR a screenshot. This works fine, but I regularly add more tags and thats a lot of screen shotting . . . .

Select the image and make sure the tag hierarchy is visible in the right-hand pane. Right-click any tag and choose “Select”, then choose “All Tags” from the popout menu.

Ha! Easy when you know how!!

Many thanks to rvietor and ashurbanipal!!

One additional snag - I apply all my 3000+ tags to a single image and this works fine, but when I try to extract the tags from the jpg using exiftool, it looks like there are size limitations and only about 1000 are extracted.

One of the reasons I suggested using a sidecar file, then you can at least see where the problem is.
If you use a hierarchy of keywords, and the number of keywords written is the limitation, there may still be a solution.
I think (don’t have time to check right now) that you can automatically apply all child keywords when selecting a parent keyword.

Yes it looks like all the tag data can be extracted directly from the XMP.

Many thanks.

Sqlite is a public format, there is a sqlite module for Python and if you know SQL and Python you can alter the .db file using Python scripts.