reshuffle -- cycle random music on and off an iPod Shuffle

reshuffle is a simple python script which I use to manage my iPod Shuffle. The idea is that the script loads a random set of music onto the Shuffle, which you can then listen to. When you next plug the Shuffle in and run the script, it deletes tracks you've listened to, and adds new random ones at the end of the playlist until the Shuffle is full again. The script keeps track of which tracks have been listened to and removed from the Shuffle, so it won't pick those again until you've been through the entire music collection.

I'm sure iTunes could do all this, but I use Linux so that's out, and I wanted a command line program which I could set up to just automatically run when the iPod was put into the USB cradle.

Also here is the nuke-ipod script, which simply deletes everything from the Shuffle and recreates an empty database. (It does not attempt to reformat the filesystem or restore the firmware or anything like that, so for really major messes you still need the official Apple ipod reset utility.)

You can download:

Both scripts are under the GPLv3.

The basic usage is something like:

   reshuffle --verbose /path/to/my/music

(--verbose is optional but without it you will get absolutely no progress information while it fills the Shuffle). Other options are also available (try --help).

The program makes certain assumptions:

I could probably be persuaded to generalise the program not to make these assumptions, but at the moment it works for my needs and that suffices :-)