---
author: einar
categories:
- Linux
comments: true
date: "2009-10-02T20:25:00Z"
slug: danbooru2nepomuk-a-nepomuk-tagger-for-danbooru-images
tags:
- Anime
- danbooru
- KDE
- Linux
title: danbooru2Nepomuk - a Nepomuk tagger for Danbooru images
omit_header_text: true
disable_share: true
wordpress_id: 681
---

If you dabble with [anime]({{ site.url }}/category/Anime) and related things like I do, you may have heard about [imageboards](http://en.wikipedia.org/wiki/Imageboard). A known variant, which powers sites such as [moe.imouto](http://moe.imouto.org) (some links may be NSFW) or [Konachan](http://konachan.net), is [Danbooru](http://en.wikipedia.org/wiki/Imageboard#Danbooru-style_boards), 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](http://www.kde.org) (tested with version 4.3.1).

danbooru2nepomuk is a Python program, so it requires first of all the [Python interpreter](http://python.org), version 2.5 or later. It has been developed to use the [Nepomuk semantic desktop](http://nepomuk.semanticdesktop.org) framework present in KDE, so you'll also need [PyQt4](http://riverbankcomputing.com) and [PyKDE4](http://techbase.kde.org/Development/Languages/Python), 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:

{{< highlight bash >}}danbooru2nepomuk.py [-r] <file or directory>{{< / highlight >}}

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.
