SnapFS (Python Client)
SnapFS is a file indexing and metadata system designed for large-scale production environments such as VFX, animation, gaming, simulation, and data pipelines.
Status
Early development.
APIs, schemas, and endpoints may evolve rapidly before the 1.0 release.
Features
- Filesystem scanning and metadata ingestion
- Cache-aware incremental hashing
- Configurable hash algorithms (
sha1,sha256, optionalxxh64) - Hash performance tuning (
--workers,--hash-chunk-size) - Large-file telemetry with phase/progress reporting
- Async gateway client built on aiohttp
- Command-line interface for common operations
- Local benchmark helper for normalized scan-engine comparisons
Installation
pip install snapfs
or install from source:
pip install -e .
To enable optional xxh64 hashing support:
pip install snapfs[xxhash]
or from source:
pip install -e .[xxhash]
If scan performance matters on a host, especially for many-small-file trees or
warm-cache repeat scans, xxh64 is worth testing.
Example .env
For agent or CLI-based scans, a minimal environment file often looks like:
SNAPFS_GATEWAY=https://example.snapfs.com
SNAPFS_API_KEY=YOUR_API_KEY
SNAPFS_AGENT_ID=scanner-01
SNAPFS_SCAN_ROOT=/mnt/data
You can export these values in your shell, load them from a local .env, or translate them into your service manager configuration.
Install The Systemd Agent
For Linux hosts that should run the SnapFS scanner agent as a service, the preferred bootstrap flow is:
curl -fsSL https://raw.githubusercontent.com/snapfsio/snapfs/master/install.sh | bash
This bootstrap installer verifies python3, creates a managed virtual
environment under /opt/snapfs, installs snapfs[xxhash], and then hands off
to the systemd installer for scanner-specific configuration.
If the host is missing a usable virtual environment backend, the installer now offers to install the required system package automatically on supported Linux distributions such as Debian, Ubuntu, Rocky, RHEL, Fedora, CentOS, and AlmaLinux.
By default it resolves the latest GitHub release and fetches the corresponding
source archive automatically. You can pin a version explicitly with
SNAPFS_VERSION:
curl -fsSL https://raw.githubusercontent.com/snapfsio/snapfs/master/install.sh | \
SNAPFS_VERSION=0.4.3 bash
If the latest-release lookup fails, the bootstrap falls back to a pinned default release. If you prefer to review the script locally first, the repo-based fallback remains available:
git clone https://github.com/snapfsio/snapfs
cd snapfs
./install.sh
If the bootstrap path still fails on a target host, use one of these fallbacks:
sudo apt install python3-venv
sudo dnf install python3-virtualenv
If your host uses a non-default system Python, install the matching
python3.<minor>-venv package instead. Then re-run ./install.sh, or install
the package manually and launch the systemd installer directly.
If you prefer to manage the Python environment yourself, the manual fallback remains available:
pip install .[xxhash]
./systemd/install.sh
For broader installation guidance, including the bootstrap installer and
filesystem layout, see docs/install.md. For ongoing service
management, including enabling, disabling, uninstalling, and legacy standalone
service cleanup, see docs/systemd.md.
Development
Install developer dependencies:
pip install -e .[dev]
Install benchmark dependencies:
pip install -e .[benchmarks]
This installs the in-repo benchmark extras such as tqdm and xxhash.
Run the test suite:
pytest -q
Quick Start
Scan a directory and publish metadata:
snapfs scan /mnt/projects
Select a hash algorithm explicitly:
snapfs scan /mnt/projects --algo xxh64
Tune local hashing performance:
snapfs scan /mnt/projects --workers 4 --hash-chunk-size 2097152
Scanner Capabilities
Hash Algorithm Selection
SnapFS supports configurable hash algorithms for both direct scans and long-running agents.
Currently supported:
sha1sha256xxh64when installed with the optionalxxhashextra
How to choose:
sha1: current default. Use this when you want the standard out-of-the-box SnapFS behavior and do not need to optimize hash throughput yet.xxh64: best first option to test when performance matters andxxhashis installed. It is often much faster on CPU-limited, warm-cache, or many-small-file workloads.sha256: use this when you specifically prefer a SHA-256 hash over the defaultsha1, even if it may cost more CPU time thanxxh64.
Examples:
snapfs scan /mnt/projects
snapfs scan /mnt/projects --algo xxh64
snapfs scan /mnt/projects --algo sha256
snapfs agent --algo sha256 --gateway https://tenant.snapfs.com
Environment defaults are also supported:
SNAPFS_HASH_ALGOSNAPFS_HASH_WORKERSSNAPFS_HASH_CHUNK_SIZE
Performance Tuning
You can tune hashing behavior for different hosts and datasets with:
--workers--hash-chunk-size
These settings are especially useful for:
- large-file workloads
- warm-cache repeat scans
- comparing different hardware or filesystem setups
Large-File Telemetry
Running scans now emit richer telemetry so large-file hashing work does not appear deceptively idle. Telemetry includes phase/progress information such as:
- walking vs hashing vs publishing
- processed bytes
- hashed bytes
- active hash jobs
Local Benchmarking
Use the local benchmark helper when you want to compare scan-engine performance without requiring a gateway URL or API key:
python3 scripts/bench_scan.py /mnt/projects --force --workers 2 --algo sha256
See scripts/README.md for benchmarking guidance and --json output details.
For a representative results table and interpretation notes, see
docs/benchmarks.md.
Cross-Platform Notes
SnapFS supports Python 3.8+ and is tested across Linux, macOS, and Windows.
A few practical notes:
- Linux is currently the primary environment for service installs via systemd
- hash worker multiprocessing is designed to stay compatible with Windows spawn semantics
- service-install tooling is Linux-only today
Documentation
Additional docs live under docs/:
Requirements
- Python 3.8+
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 snapfs-0.4.3.tar.gz.
File metadata
- Download URL: snapfs-0.4.3.tar.gz
- Upload date:
- Size: 43.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af5c0a190f089c835ba1cfc5ed11a90f0583c0f9cf71d186b99d59932ce915e0
|
|
| MD5 |
b55a09e86f412c391e064939792ab624
|
|
| BLAKE2b-256 |
3ee5903f5c6881047c02d44ffa2c6c80732c6e3ec3b949bcd8e86313ff7e0bc3
|
File details
Details for the file snapfs-0.4.3-py3-none-any.whl.
File metadata
- Download URL: snapfs-0.4.3-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1556fc9392dda5f5f7468f356a3a1b413e794b25743bd584ac3b0477f9e5190
|
|
| MD5 |
c946b8c76c131235fd778d1f0940bb70
|
|
| BLAKE2b-256 |
4ace42f0a189a0b24aa41a26d46c11a6bfe2b6d7591140de38c36f38c0c3f18f
|