No project description provided
Project description
Directory Observer
(Windows only) The package implements an observable to monitor directory changes, and to notify observers when a change is detected. The observable is running in a separate daemon thread, and is being locked while there are no changes (non-busy-waiting).
Installation
python3 -m pip install directory-observer
Usage Examples
from directory_observer import DirectoryObservable
def update(path: str):
# Handle change in path
# Initialize Observable with update() as observer function
observable = DirectoryObservable(path, observers=[update])
observable.start() # Start observable thread
observable.remove_observer(update) # Remove observer
observable.add_observer(update) # Add new observer
observable.stop() # Stop observable thread
# Use "with" statement to call start() and stop()
with DirectoryObservable(path, observers=[update]) as observable:
# Observe directory in this section
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
Close
Hashes for directory_observer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f967c8b2f43e617465ff1927ead24b3578564c45bdf5ee84c3ded6f2706938b |
|
MD5 | f68375ef4107ca2cbb69f70b8c4a9c03 |
|
BLAKE2b-256 | 030023d681a8dfe7a986cc79dde7ccfa629ad777b7e9c940c9623a143e329d8b |