Runs Python functions once a certain file is created or modified.
Project description
FileWatchdog
Runs Python functions once a certain file is created or modified.
Installation
pip install filewatchdog
Usage
import filewatchdog as watcher
import time
def job():
print("I'm working...")
# detecting changes to one single file
watcher.once().file('C:/Temp/1.txt').modified.do(job)
watcher.once().file('C:/Temp/1.txt').exists.do(job)
# detecting file changes in a directory recursively
watcher.once().folder('C:/Temp').modified.do(job)
# watching multiple files
files = ['C:/Temp/1.txt', 'C:/Temp/2.txt', 'C:/Temp/3.txt']
watcher.once().one_of(files).modified.do(job)
watcher.once().all_of(files).exist.do(job)
while True:
watcher.run_pending()
time.sleep(1)
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
filewatchdog-0.1.7.tar.gz
(3.4 kB
view details)
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 filewatchdog-0.1.7.tar.gz.
File metadata
- Download URL: filewatchdog-0.1.7.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.12.7 Linux/6.1.91-060191-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19ca201789be20e459ec82e97852db70e99fc8b6756690fa0b67769d4df6ca12
|
|
| MD5 |
03cacdbb43cfcb4649d247bf03a6ffc0
|
|
| BLAKE2b-256 |
bc8321f2ed39a4167831fbe04d831b72e8982bc9a668ca07d92b016052d1f59e
|
File details
Details for the file filewatchdog-0.1.7-py3-none-any.whl.
File metadata
- Download URL: filewatchdog-0.1.7-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.1 CPython/3.12.7 Linux/6.1.91-060191-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53b43be8235aa4771e08333c045cae1f0dfcf181a025654d82d2dfd62801cc90
|
|
| MD5 |
a6115b46bc3c3421b1eb2b69ccebd2c8
|
|
| BLAKE2b-256 |
453448a3b8e37d8b2f010aef6f4284e6864e880a8fb294eae9ed55663bfd51e3
|