Skip to main content

Tree Guardian

Track the changes into the filesystem and trigger callback on changes detecting.

Getting Started

Installation

pip install tree-guardian

Usage (Python)

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()

Usage (Cli)

You can also use tree-guardian commands in shell. To make observe, run, for example:

tree-guardian-observe --command='[YOUR SHELL COMMAND HERE]'

This command supports the following params:

usage: tree-guardian-observe [-h] [-d] -c CALLBACK [-p PATH] [-e [EXCLUDE ...]]

Observe directory and trigger callback on change detection

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           run observe on debug mode; it also displays all trigger-command output
  -c [CALLBACK_COMMAND ...], --cmd [CALLBACK_COMMAND ...], --command [CALLBACK_COMMAND ...], --callback [CALLBACK_COMMAND ...], --callback-command [CALLBACK_COMMAND ...]
                        trigger command
  -p PATH, --path PATH  the observable root path
  -e [EXCLUDE ...], --exclude [EXCLUDE ...]
                        excluded files from observe

Call it with --help flag to get more details.

tree-guardian-observe --help

Metadata

Release files for tree-guardian 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tree-guardian 0.2.0
File Size Uploaded Provenance Actions
tree_guardian-0.2.0.tar.gz 5.8 kB Without provenance Details for tree_guardian-0.2.0.tar.gz

Release files / tree_guardian-0.2.0.tar.gz

Download URL tree_guardian-0.2.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0c21184458f256581c4a9c83e16354d1151a84ff7622e63dc4c9c62a758e6540
BLAKE2b-256 checksum
How to use checksums
3f9bc05e7ceb9280af5274a4b9bbd0da5f5adce7ec06f6a5a7fd4fd1fbd73f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.4

Security for tree-guardian 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page