I used to do the same sort of thing and more with a bunch of python scripts. My cheapo mass-storage mp3 player has died recently and my son has donated (voluntarily) his Shuffle to me, but python scripts were all bit-rot and refused to work and I haven't touched python for several years already, so I rewrote the main script in ruby. The reading part of python version still worked so I made it dump what it read in ruby-esque format for testing (that's test_data.rb). The test_data isn't very exciting though (all tracks are in default state without bookmarks).