Skip to main content

SnapFS Python client and CLI

Project description

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, optional xxh64)
  • 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 -e .[xxhash]

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:

git clone https://github.com/snapfsio/snapfs
cd snapfs
pip install .
./systemd/install.sh

The installer expects the snapfs CLI to already be installed and available in PATH. Run the installer as your normal user; it will prompt for elevated privileges when it reaches the root-only systemd setup steps.

For production service installs, prefer installing snapfs into a stable system-level Python environment rather than a user-local virtualenv.

Current systemd installer support is Linux-only. Windows service support is planned but not available yet.

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 sha256

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:

  • sha1
  • sha256
  • xxh64 when installed with the optional xxhash extra

Examples:

snapfs scan /mnt/projects --algo sha256
snapfs agent --algo sha256 --gateway https://tenant.snapfs.com

Environment defaults are also supported:

  • SNAPFS_HASH_ALGO
  • SNAPFS_HASH_WORKERS
  • SNAPFS_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.

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+

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

snapfs-0.4.2.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snapfs-0.4.2-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file snapfs-0.4.2.tar.gz.

File metadata

  • Download URL: snapfs-0.4.2.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for snapfs-0.4.2.tar.gz
Algorithm Hash digest
SHA256 31d36d0c1d11f17e4cfbecdbce82cd6d54e72a7c03f43f14cef9a9e0073a702f
MD5 2420e2f8a4748be0168c52e1223ea397
BLAKE2b-256 df399ac1203c50c0fdfe5096f060cac73b551bb9810e562a2b1254412d4761cd

See more details on using hashes here.

File details

Details for the file snapfs-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: snapfs-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for snapfs-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c996a44a0f0d9c90fcd85e7e3b09329dca831216fef952b6299a89f9e48d2880
MD5 bb4763b3637b7446e02ed305f32d3316
BLAKE2b-256 bec41b5f2892e95dd69b9ec12c5a7e06e3850f20277658241458f6927a6137bd

See more details on using hashes here.

Supported by

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