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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file surveiler-1.0.0.tar.gz.
File metadata
- Download URL: surveiler-1.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9db2ad338b8046a1e73e2d85f8948602b83e6dd786693fd05dbf98c3c265272
|
|
| MD5 |
678f11fd51356f42214a033425da1e49
|
|
| BLAKE2b-256 |
4cb2715ac6cac4ab643adc87a679b15b4caea854dd31cdec83a2f962b5e85ea7
|
File details
Details for the file surveiler-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: surveiler-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2df8555e240d7e6140830fde8caafc9d46bba059dfd9d12a6c9b3527aa0f2f06
|
|
| MD5 |
d330841859e90a17cc40dc198386a3eb
|
|
| BLAKE2b-256 |
c96e4761e3ef19f19d0f3e63cb5cdd60b4ba8c7510191fe37c6a316b4a2bee9f
|