Tunalysis – analyse your iTunes music library

Tuna

Tunalysis is a small(ish) Ruby script that will read your iTunes library, crunch numbers, and gives you a few interesting facts about it, such as:

  • Total number of songs
  • Total number of playlists
  • Average song length
  • Average bitrate
  • Average play count
  • Average skip count
  • Total time spent listening to music

Some of these statistics are already available in iTunes, but Tunalysis ultimate goal is to expand iTunes (limited) stats and to give you hindsight on your musical habits and tastes.

Tech

Tunalysis is written in Ruby and uses Bleything’s plist to parse iTunes’ XML library.

At the time being, Tunalysis only works on OS X. I’m not planning to do a Windows port, but will gladly accept a patch if you do. :)

Tunalysis is licensed under the GPLv3.

Features to come

  • You don’t like that: suggest music to delete based on the skip count, the play count, and the last played date
  • Preferred artists (by number of songs)

I’m open to suggestions. If you’re interested in a particular piece of data, leave a comment or send me an email and I’ll add it.

Get Tunalysis on GitHub!

A bit of Terminal-fu

Yesterday, my little brother was typing something on a linux bash and suddenly went back to the beginning of the line with a simple Ctrl-a. It blew my mind.

I don’t know why, but it never occurred to me to look for shortcuts in Terminal (and bash in general), other than Ctrl-c for badly behaving processes. I just cursed myself and frantically typed on the left arrow key each time I typed cd instead of cp.

Turns out bash has plenty of them, and here are a few useful ones I’m really glad to know now:
Beginning of the line: Ctrl+a
End of the line: Ctrl+e
Delete the word under the cursor or before: Ctrl+w
Delete all chars before the cursor: Ctrl+u
Delete all chars after the cursor: Ctrl+k

Apparently these shortcuts work in a lot of text fields, everywhere.

You can also move the cursor word-by-word by typing Esc, then f or b. It’s not really practical though, so you’d be better of remapping the following keys in Terminal Settings > Settings > Keyboard:
control cursor left: \033b (\033 is actually Esc)
control cursor right: \033f

Now you can swiftly move word-by-word with Alt+left arrow and Alt+right arrow.

I guess the lesson here is there’s always to learn from your siblings — especially the geeky ones.