Track the changes into the filesystem and trigger callback on changes detecting.
Project description
Tree Guardian
Track the changes into the filesystem and trigger callback on changes detecting.
Getting Started
Installation
pip install tree-guardian
Usage
Observe the changes into your project.
from tree_guardian import observe
# Target function to trigger
def cb():
from time import time
print('[{}] Changes detected...'.format(time()))
observe(cb) # Run observer
Run in background.
from time import sleep
from threading import Event
from tree_guardian import observe
# Target function to trigger
def cb():
from time import time
print('[{}] Changes detected...'.format(time()))
event = Event()
observe(cb, run_async=True, event=event) # Run observer
# Type your code below...
try:
sleep(10) # Run for 10 seconds or until interrupted
except KeyboardInterrupt:
event.set()
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
tree_guardian-0.1.3.tar.gz
(4.1 kB
view hashes)
Built Distributions
tree_guardian-0.1.3-py3.9.egg
(15.5 kB
view hashes)
Close
Hashes for tree_guardian-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c37ff032a002c47cc8c7a3b31676106e123a64f743d9d335bfce595f456aae9d |
|
MD5 | 09de0c79661e6feff00ad46b7cd296d3 |
|
BLAKE2b-256 | 4936a6c6871e5e10b585d403b902e1702a5b0ff32850225d229556aa0c203987 |