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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36b6a46798112c95eeccb2fc3c4a3ca73324b7619bf888ade7fe5e3e5120125b |
|
MD5 | 5ac2c9629a2159bc769d5d9f2dc2795d |
|
BLAKE2b-256 | 03b7ce43d2761e50f6f77f28f5e396ceabca311feb97b64ccbe3c932bc4d9aeb |