This is Purrr, mass file rename tool written in PyGTK.


What?
=====

Purrr will let you rename multiple files according to specified template.
Templates are really a miniature programming language, with variables and
stuff. All that to let you automate not-so-fun task of doing zillions of
almost identical renames by hand. If you have ever downloaded anime series
where files had smart names like kimi_ga_ep1_divx_mp3[23ed4xc].avi through 
kimi_ga_ep13_divx_mp3[4c00ddd].avi, you'll surely get the idea.

How?
====

Renames are done according to _template_. Template is character string, which
(in general) can have two distinct types of parts in it. One is _plain_, that 
is, string that will be copied as is into resulting name. Another is _special_,
that is, reference to special value of some kind. All special references are
enclosed in brackets ([ and ]). There are currently 4 known special types:

* Counters. Denoted by [C]. Counters are the basic tool you'll use, each 
  reference to counter will insert value of that counter in resulting string.
  Counters are incremented when going to next file in list. Counters can have
  up to 4 comma-separated arguments: name (numerical), start value, step, and
  padding (how many digits will the value of counter use, zero-filled)

  For example, using this template: "file [C,10,3,3].txt" will give you:

  aaa -> file 010.txt
  bbb -> file 013.txt
  ccc -> file 016.txt

* Name references. [N] in template inserts previous name of file being renamed. 
  Optional "_" switch will make it operate in special mode, where "_" characters
  will be replaced in spaces in result. For example, "[N_]" will give you:

  aaa  	  	   -> aaa
  bbb 		   -> bbb
  ccc 		   -> ccc
  some_long_name   -> some long name

* Basename references. Denoted by [B]. Same as [N], except that they will only 
  insert name without extension. So, "[B_].dat" gives:

  aaa  	  	   -> aaa.dat
  bbb 		   -> bbb.dat
  ccc 		   -> ccc.dat
  some_name.txt    -> some name.dat

* Extension references. Inserted with [E]. Extension references expand to original 
  extension of file renamed. For example, with "file.[E]":

  aaa.txt -> file.txt
  aaa.jpg -> file.jpg
  aaa.mkv -> file.mkv

Special references are case-insensitive (so [C] is the same as [c]), unrecognised 
reference will be inserted unchanged, so [something xxx, #?] will insert string
"something xxx, #?" in resulting file name. You can turn off special meaning of 
brackets by escaping them with backslash (you'll also need to escape backslash
with backslash to get backslash in resulting name)

How much?
=========

Not much. Purrr is free software released under GPL license. To run it, you'll need
at least Python 2.3, with PyGTK 2.4 and Gnome libraries installed. You'll also need
libglade, which is used to construct UI at runtime.

If you use nautilus, you can install nautilus script which will invoke Purrr on
selected files. It's available under name "Mass rename" in scripts context-menu.

Who?
====

Purrr was written by Maciej Katafiasz (http://mathrick.org), who had damn lots of fun
hacking on it.
