AtomPub data model for music metadata storage and indexing

Noah Gift described a cool project he had started recently named Pylesystem. The idea was to monitor the filesystem for events regarding the creation and deletion of files, more specifically media files like music audio files. Noah explained he wanted to provide a simple metadata storage so that he could query it for getting information about his media library. He decided to use SQLAlchemy to abstract the storage as well as the query mechanism as much as possible whilst providing an easy and high level query interface.

I thought it’d be cool to give it a go using the AtomPub data model to store metadata. I therefore hacked a small example within a few hours this weekend using amplee.

I was quickly able to associate a collection per artist and album and a member per track. I used hachoir-metadata to get a few basic metadata about tracks as well as a couple of simple queries to the Musicbrainz web service to get more advanced information like tags, related URLs, etc.
Finally I used the basic indexing mechanism provided in amplee to perform simple query on the AtomPub store and then generate atom feeds on the fly based on the query result.
Overall it was really fun and I’m happy that it shows how to use AtomPub and amplee in a context that is not directly related to the web. The source code is of course available here.

Note that if you wish to run the code you’ll need the latest trunk of amplee. Otherwise you’ll need the current stable release of amara, hachoir-metadata and pyinotify.