danbooru2Nepomuk - a Nepomuk tagger for Danbooru images
By einar
- CommentsIf you dabble with [anime]({{ site.url }}/category/Anime) and related things like I do, you may have heard about imageboards. A known variant, which powers sites such as moe.imouto (some links may be NSFW) or Konachan, is Danbooru, a Ruby on Rails application. One of the characteristics of this software is that images stored there can be tagged to be identified as precisely as possible: common tags are for example the magazine where the image was taken from, the characters depicted, and so on.
Once you save the file, however, all the tags are just present in your file name, and nowhere else. LIke that, they’re not that informative. That’s where danbooru2nepomuk comes into play. danbooru2nepomuk is a small Python program that can turn the tags present into the filenames into real semantic tags.
Requirements
As of this post, danbooru2nepomuk works only on Linux, so if you are a Windows user, you’re out of luck. Also, it requires a KDE (tested with version 4.3.1).
danbooru2nepomuk is a Python program, so it requires first of all the Python interpreter, version 2.5 or later. It has been developed to use the Nepomuk semantic desktop framework present in KDE, so you’ll also need PyQt4 and PyKDE4, along with a working Nepomuk installation. Most distributions use the broken Soprano redland backend, which will not work, so I suggest you to switch to the sesame2 backend, which (although dependent on Java) works reasonably well.
Download and installation
Simply get [danbooru2nepomuk.zip]({{ site.url }}/files/danbooru2nepomuk.zip), rename it to .py from .zip, save it in your PATH, and make it executable. Nothing more than that.
Usage
danbooru2nepomuk is a command line appplication. Its syntax is simple:
danbooru2nepomuk.py [-r] <file or directory>
If you specify a file, it will be tagged directly; if you specify a directory, it will be scanned for files, and those in turn will be tagged. If you add the -r switch to a directory, it will be scanned recursively, while it will be simply ignored if you use it with a file.
Configuration
You can specify a tag blacklist for tags in the filename that you don’t want to get in. To do so, edit the TAGS_BLACKLIST variable on line 41, and add more tags you don’t want Nepomuk to pick up.
Known issues
None that I know of, at least! If you find any, let me know.
danbooru2nepomuk is licensed under the GNU General Public License, version 2.