FTagger

File tagging utility for advanced command-line users (part of the scripts project at the moment).

FTagger is a command-line program that lets you assign tags (keywords) to files, and allows you to search the files later using the tags. Any types of files can be tagged (image/video collections being a good example). There are no limits on types of tags either, except that they must not contain spaces or start with exclamation mark.

$ cd ~/images
$ ftagger tag 2007-06-28/dsc01209.jpg 'scenery sunset'
$ ftagger tag 2007-06-28/dsc01210.jpg 'motorcycle bob john scenery'

For the convenience of the user, a description can be attached to tags. The tags can be listed (showing how many files have certain tags) and manipulated (added, renamed, removed).

$ ftagger addtag bob 'the beardy fellow'
$ ftagger taglist
    2 scenery:
    1 bob: the beardy fellow
    1 john:
    1 sunset:
    1 motorcycle:

The tagged files can later be listed or searched. The searches can be anything from simple “find all files with tag A and B” to more complex queries with OR and NOT operations.

$ ftagger list
2007-06-28/dsc01210.jpg: bob john motorcycle scenery
2007-06-28/dsc01209.jpg: scenery sunset
$ ftagger find 'scenery'
2007-06-28/dsc01210.jpg
2007-06-28/dsc01209.jpg

Now, tagging files this way seems quite tedious. The usefullness of FTagger leans heavily on the scripting skills of the user. FTagger is designed to work well together with existing GNU utilities and command-line tools.

For example, to examine and tag all new (untagged) images in a directory, using the image viewer feh to view each image before asking user to input the tags:

$ ftagger examine feh $(ftagger listnew 2007-06-28/*)

Or, if you want to tag videos, you could examine all of those youtube clips using mplayer:

$ ftagger examine mplayer clips/*.flv

However, personally I prefer to view all of the images using feh, and tag only some of the images (by pressing enter in feh, which executes the specified action, -A parameter below. Note that the examine program used here is true, which basically does nothing so FTagger asks user to type new tags right away):

$ feh -dFZ -A 'ftagger examine true %f' $(ftagger listnew 2007-06-28/*)

Or, you could use the standard find program to find all files that have been changed during last week, and examine them:

$ feh -dFZ -A 'ftagger examine true %f' $(find 2007-06-28/ -type f -ctime 7)

Once you have tagged a hefty amount of files, you might start needing more complex search queries to find specific images you remember. For example, you remember you took a picture between years 2005-2006 on a summer night containing a beautiful blue sky with a moon or stars on it (and you remember for sure that the beardy fellow bob was not in it):

$ ftagger find 'summer night sky (moon | stars) !bob' |grep ^200[56] |xargs feh -dFZ

Features

  • The file tagging part is actually a lie. FTagger is not limited to files (at least not at the moment) - it can tag any strings. What it can be used for is up to the user.
  • Supports complex queries: AND, OR, NOT and subquery support.

~~DISCUSSION~~

 
projects/ftagger.txt · Last modified: 2008/05/07 18:11 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki