Index
Rust-powered filesystem toolkit for Python.
Fast recursive directory listing, parallel file hashing, bulk copy/move with progress, cross-platform file watching, file deduplication, content search, directory diff and sync, file integrity snapshots, disk usage analysis, and batch rename — all from a single, typed Python package.
Why pyfs-watcher?¶
- Performance — Core operations run in Rust with parallel execution via Rayon, bypassing the GIL. Walk directories and hash files 10x faster than pure Python.
- Type Safety — Full type stubs (
py.typed) ship with the package. Every function, class, and parameter has type annotations for IDE autocompletion and mypy/pyright checking. - Cross-Platform — Works on Linux, macOS, and Windows. File watching uses native OS APIs (inotify, FSEvents, ReadDirectoryChangesW).
- Batteries Included — Eleven feature modules cover the most common filesystem operations: walk, hash, copy/move, watch, dedup, search, diff, sync, snapshot, disk usage, and rename.
Features¶
-
Walk
Parallel recursive directory traversal powered by jwalk. Stream entries one-by-one or collect them all at once.
-
Hash
BLAKE3 and SHA-256 hashing with automatic memory-mapped I/O for large files. Parallel batch hashing across all cores.
-
Copy / Move
Bulk file copy and move with real-time progress callbacks. Smart cross-device move with automatic fallback.
-
Watch
Cross-platform filesystem watcher with debouncing. Supports both synchronous iteration and async generators.
-
Dedup
Three-stage duplicate finder: size grouping, partial hash, then full hash. Finds duplicates across multiple directories.
-
Search
Parallel content search with regex patterns. Skips binary files, supports context lines, streaming and collect modes.
-
Diff
Compare two directories to find added, removed, modified, and moved files. Content-aware with optional move detection.
-
Sync
Incremental directory sync with dry-run preview, delete-extra support, and progress callbacks. Only copies what changed.
-
Snapshot
Capture file hashes and metadata to JSON. Verify later to detect additions, removals, and modifications.
-
Disk Usage
Parallel directory size calculation with per-child breakdown, sorted by size. Faster than
du. -
Rename
Regex-based batch file rename with dry-run preview and undo support. Safe by default.