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
File details
Details for the file directory_observer-1.0.1.tar.gz
.
File metadata
- Download URL: directory_observer-1.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.11.4 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.6rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfd4d82c821e51818df17005531177a0f20ea5c0c611d1f4d327bd4f2f423e64 |
|
MD5 | f00561e0917dcc9eee095f5cb8f20a6c |
|
BLAKE2b-256 | a409ec030d3df95d88eb6b339a9eaec81e0aa33416afd5129814e0ea838731d0 |
File details
Details for the file directory_observer-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: directory_observer-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.11.4 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.6rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36b6a46798112c95eeccb2fc3c4a3ca73324b7619bf888ade7fe5e3e5120125b |
|
MD5 | 5ac2c9629a2159bc769d5d9f2dc2795d |
|
BLAKE2b-256 | 03b7ce43d2761e50f6f77f28f5e396ceabca311feb97b64ccbe3c932bc4d9aeb |