virgilio — a polling-based folder-watching daemon with an overridable hook interface.
Project description
Virgil.IO
A folder-watching daemon that detects file creations, modifications, and deletions, and notifies a consumer via overridable hook methods. Pure polling — no watchdog, no OS-native filesystem-event API — so behavior is consistent across macOS, Linux, and Windows.
CLI usage
virgilio <folder>
Watches only <folder>'s immediate contents by default, polling once per second, logging every event to log.txt inside <folder>.
Flags:
virgilio <folder> --recursive --interval 0.5 --include-hidden --report-existing
--recursive/-r— watch the full subtree instead of just<folder>'s immediate contents.--interval SECONDS/-i SECONDS— poll interval in seconds (default1.0), may be a float (e.g.0.25).--include-hidden— include hidden files/directories (dotfiles) and symlinks in the walk (excluded by default).--report-existing— fire aFOUNDevent for every pre-existing file at startup, instead of silently indexing it.
If <folder> doesn't exist or isn't a directory, virgilio prints an error and exits with a non-zero status without starting.
Library usage
Subclass Virgilio and override whichever hooks you care about, then reuse the same argument parsing via .main() — no separate CLI-loading mechanism needed:
from virgilio import Virgilio, EventType
class MyVirgilio(Virgilio):
def notify_created(self, path: str) -> None:
print(f"new file: {path}")
def notify(self, event: EventType, path: str) -> None:
send_metric(event, path)
MyVirgilio.main()
MyVirgilio.main() parses sys.argv exactly like the plain virgilio CLI (<folder> [--recursive] [--interval SECONDS] [--include-hidden] [--report-existing]), constructs a MyVirgilio, and calls .run(...). Both notify (unified) and the event-specific hook (notify_created, notify_modified, notify_deleted, notify_found, notify_error) fire for every event — override either, both, or neither.
To embed a Virgilio inside a larger application (e.g. running .run() on its own thread), call .stop() to shut it down programmatically instead of relying on SIGINT/SIGTERM:
import threading
virgilio = MyVirgilio("/path/to/folder")
thread = threading.Thread(target=virgilio.run, kwargs={"recursive": True})
thread.start()
...
virgilio.stop()
thread.join()
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
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 virgilio-1.0.1.tar.gz.
File metadata
- Download URL: virgilio-1.0.1.tar.gz
- Upload date:
- Size: 179.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e8de210458087314686bf1baba40b95c88f14a1c86c6e763f457eaef86122d2
|
|
| MD5 |
20be961c9182f73979197842ef62c214
|
|
| BLAKE2b-256 |
c68aa46f0bdc6a2a1baf85719a6bff135a2fbf24834fb21549d3131b8101b347
|
File details
Details for the file virgilio-1.0.1-py3-none-any.whl.
File metadata
- Download URL: virgilio-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3db75b91cea3f82172454b9faed0e9263bc50b76eede66bd0eb4bb59cad064e4
|
|
| MD5 |
3a4c422c5b17c0275ae65626beafa5cd
|
|
| BLAKE2b-256 |
3d9096d60ddc53786c55d50386d4dc40b0219c52c910e041715d01549c3d7936
|