I am searching for a Python library for string formatting with custom placeholders. What I mean is that I would like to be able to define a string like "%f %d %3c" where for example %f would be then replaced with some filename, %d with a directory name and %3c with a counter with three digits. Or something. It does not have to be printf-like but it would be great if it would be. So I would like to be able to define what each letter means, is it string or number, and also some formatting (like number of digits) data.
The idea is that user can specify the format and I then fill it in with data. Like datefmt works. But for custom things.
Is there something like that already made for Python (2.5+, sadly not for 2.7 and 3 and its __format__)?