Simple file-system watcher.
Project description
surveiler
Very simple file-watching utility.
Installation
(coming soon) pip:
pip install surveiler
Or just copy the file locally (it's literally 60 lines)
Usage
Two exported functions: make_event_handler
, surveil
. Signatures (not exactly):
def make_event_handler(**kw: dict[str, Callable[[], None]]) -> Callable[[int], None]: ...
def surveil(directory_name: str, event_handler: Callable[[int], None]) -> Never: ...
Example usage:
event_handler = make_event_handler(on_create=lambda: print('create'), on_modify=lambda: print('modify'))
surveil("testdirec", event_handler)
Check out the constants in the source file to see what event handlers you can add; any one of them can be adapted
to a keyword argument to event_handler
. Example: IN_MOVE
-> on_move
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
surveiler-1.0.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for surveiler-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2df8555e240d7e6140830fde8caafc9d46bba059dfd9d12a6c9b3527aa0f2f06 |
|
MD5 | d330841859e90a17cc40dc198386a3eb |
|
BLAKE2b-256 | c96e4761e3ef19f19d0f3e63cb5cdd60b4ba8c7510191fe37c6a316b4a2bee9f |