Blog of me. I’m Alexander Jones.

10 September 2009

Today’s hack: CD wallet inlay track listings generator

If you’re a CD DJ, and, like me, you’re used to scrawling the names of the tracks you’ve just burnt down onto a piece of paper and slotting it into your CD wallet, you probably know how difficult it is to write legibly in a small space.

So, I hacked this Python tool together to generate a printable PDF from some simple text files. There is no graphical interface (yet), just a simple command line interface.

All you have to do is:

  1. Create a folder full of plain text files like such:

    LABEL GOES HERE
    Artist 1 - Title 1
    Artist 2 - Title 2
    Artist 3 - Title 3
    ... etc.

    that is, the CD label goes on the first line, and then the track listing goes on each line after that. The file names do not matter, but it's probably a good idea to use the same thing for the label and filename.

  2. Run the tool as such:

    python /path/to/tracklisting.py /path/to/tracklisting/files/*
  3. Out pops the PDF “output.pdf” in the working directory. Print it off, and cut it out! Happy times!

The code is up on Launchpad at https://code.launchpad.net/~alex-weej/+junk/tracklisting. Please feel free to submit patches or suggestions for any improvements you may have!

No comments: