Skip to main content

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


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)

Uploaded Source

Built Distributions

tree_guardian-0.1.3-py3.9.egg (15.5 kB view hashes)

Uploaded Source

tree_guardian-0.1.3-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page