This really is particularly targeted towards controlling tunes but should easily work with any directory structure with many different files.

I wish to find or write a daemon (ideally in Python) which will watch a folder with lots of subfolders which should all contain X quantity of tunes. When a file is added, up-to-date or remove it will reflect that inside a database (ideally PostgreSQL). I'm prepared to accept if your file is just moved the particular rows are erased and recreated anew but upgrading existing rows will make me the most joyful.

This has a bit of things i want:

I essentially simply want a database will be able to then do whatever I wish to with. My most up-to-date database by now's my iTunes.xml file but I'd rather not depend on this too almost as much ast I do not always wish to depend on iTunes for my music management. I see lots of projects available that perform a little of the items I would like however in a format that either I can not access or perhaps is just more complicated than I would like. If there's some media player available that may watch a folder increase a database that's readily available i quickly am all for this.

The main reason I am leaning towards writing my very own happens because It might be nice to select my database and schema myself.

Another answer already recommended pyinotify for Linux, allow me to add watch_directory for Home windows (a great discussion from the options in Home windows is here, the module's a good example) and fsevents around the Mac (regrettably I do not think there is a single mix-platform module offering a uniform interface to those various system-specific methods for getting directory-change notification occasions).

When you get such occasions, upgrading a suitable SQL database is straightforward!-)

If you are using Linux, you should use PyInotify.

[cde] can inform you about filesystem occasions whenever your program is running.

IMO the very best media player which has these functions is Winamp. It rescans the background music folders every X minutes, that is enough for music (however rather less efficient than letting the operating-system watch out for changes).

But while you were requesting suggestions on writing your personal, you can take advantage of pyinotify (Linux only). If you are running Home windows, you should use the ReadDirectoryChangesW API call