python library for generating file names based on current time and git commit.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
fn add procsha option Jun 20, 2018
.editorconfig first May 5, 2016
.gitignore first May 5, 2016
LICENSE LICENSE Feb 14, 2018 install locally by default Mar 6, 2018 fix milli flag Feb 14, 2018 add procsha option Jun 20, 2018


What is it?

This is a tiny library to generate file names.

It will give you unique file names based on current git commit, as well as the time and date. You can also set your own prefix and/or postfix.

When fn is called from the terminal, the file names look like this:


Which currently follows this format:


Where gitsha is the prefix of the git commit sha. And proctimesha is a hash of the time when Fn() is called and the process id of the calling python script.

If you are not in a git repo, it looks like this:


If you use the package within python you can also:

  • Pass your own prefix and postfix.
  • Override the postfix.
  • Append incremental numbers.
  • Change the delimiter.
  • Override the length of the git sha.

Se ./ for some usage.

Use fn -h in the terminal to see other options.


I have a lot of projects where I make large amounts of files (images, 3D models, 2D vector files), and I've always wanted a more efficient way of maintaining unique file names.

I got inspired to write this when I saw this tweet about how Vera Molar names her works this Periscope video


Install using either

./ install --user


./ develop --user

The latter is most convenient if you will be editing the code.

Does it guarantee unique file names in any way?

No. It only uses the current time to make a relatively distinct string—don't use this for anything remotely important.

On Use and Contributions

This code is a tool that I have written for my own use. I release it publicly in case people find it useful. It is not however intended as a collaboration/Open Source project. As such I am unlikely to accept PRs, reply to issues, or take requests.