## For Linux

* **[Pynotify](http://pyinotify.sourceforge.net/)**

    `Pyinotify` is a Python module for monitoring filesystems changes. Pyinotify relies on a Linux Kernel feature (merged in kernel 2.6.13) called `inotify`, which is an event-driven notifier. Its notifications are exported from kernel space to user space through three system calls. `Pyinotify` binds these system calls and provides an implementation on top of them offering a generic and abstract way to manipulate those functionalities.
    
    [Here](http://pyinotify.sourceforge.net/#The_EventsCodes_Class) you can find the list of the events that can be monitored with `Pynotify`.

## For Windows

* **[Watcher](https://pypi.python.org/pypi/watcher)**

    `Watcher` is a low-level `C` extension for receiving file system updates using the `ReadDirectoryChangesW` API on Windows systems. The package also includes a high-level interface to emulate most of the .NET `FileSystemWatcher` API.

* **[Watchdog](https://pypi.python.org/pypi/watchdog/0.5.4)**

    Python API and shell utilities to monitor file system events. Easy install: `$ pip install watchdog`. For more info visit the [documentation](https://pythonhosted.org/watchdog/).

* **[Pywatch](https://github.com/cmheisel/pywatch)**

    A python near-clone of the Linux `watch` command. The `pywatch.watcher.Watcher` class can be told to watch a set of files, and given a set of commands to run whenever any of those files change.

### Bonus for Windows with NTFS:
* **[NTFS USN Journal](http://en.wikipedia.org/wiki/USN_Journal)**  

    The NTFS USN (Update Sequence Number) Journal is a feature of NTFS which maintains a record of changes made to the volume. The reason it is listed as a *Bonus* is because unlike the other entries, it is not a specific library, but rather a feature existing on NTFS system. So if you are using other Windows filesystems (like FAT, ReFS, etc..) this does not apply.  
The way it works it that the system records all changes made to the volume in the USN Journal file, with each volume having its own instance. Each record in the Change Journal contains the USN, the name of the file, and information about what the change was.  

    The main reason this method is interesting for this question is that, unline most of the other methods, this one provides a way to detect a **file close** event, defined as **USN_REASON_CLOSE**. More information with a complete list of events can be found in this [MSDN article](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365722(v=vs.85).aspx). For a complete documentation about USN Journaling, visit this [MSDN page](http://msdn.microsoft.com/en-us/library/aa363798%28v=VS.85%29.aspx).

    There are multiple ways to access the USN Journal from Python, but the only mature option seems to be the **[ntfsjournal](https://pypi.python.org/pypi/ntfsjournal)** module.



## Multiplatform

* **[Qt's QFileSystemWatcher](http://qt-project.org/doc/qt-4.8/qfilesystemwatcher.html)**

    The `QFileSystemWatcher` class provides an interface for monitoring files and directories for modifications. This class was introduced in `Qt 4.2`.