Skip to main content

Snapshot Diff: a lightweight filesystem time machine for folders

Project description

snd

Snapshot Diff: a lightweight filesystem time machine for folders.

snd is a small Python CLI tool that can snapshot a folder, compare the current state with an older snapshot, and restore files from backup-mode snapshots.

It is not a Git replacement. It is designed for quick local snapshots when Git is too much, unavailable, or inconvenient: downloaded archives, generated assets, datasets, configuration folders, temporary experiments, and risky refactors.

Features

  • Snapshot any folder in seconds
  • Compare current files with the latest or selected snapshot
  • Detect added, deleted, and modified files
  • Store metadata-only snapshots by default
  • Optional backup mode with deduplicated file storage
  • Restore one file, glob patterns, or the whole folder
  • Dry-run restore preview
  • Clean old snapshots and unused blobs
  • Centralized storage outside the project folder
  • No runtime dependencies

Installation

From source:

pip install .

After publication:

pip install snd-cli

Quick Start

Create a metadata-only snapshot:

snd snap . --name before\_changes

Create a restorable snapshot with file contents:

snd snap . --name before\_refactor --store-files

Show changes since the latest snapshot:

snd diff .

Show all snapshots for the folder:

snd list .

Restore one file from a snapshot:

snd restore . --from before\_refactor --file main.py

Restore Python files by pattern:

snd restore . --from before\_refactor --file "\*.py"

Preview a full restore without changing files:

snd restore . --from before\_refactor --all --dry-run

Restore the whole folder state:

snd restore . --from before\_refactor --all

Clean old snapshots and keep only the latest five:

snd clean . --keep 5

Storage

snd does not create service folders inside your project.

Snapshots are stored centrally:

  • Linux: \~/.local/share/snd/
  • macOS: \~/Library/Application Support/snd/
  • Windows: %LOCALAPPDATA%\\\\snd\\\\

You can print the actual storage path:

snd where

You can override it with:

SND\_HOME=/custom/path snd snap .

Snapshot Modes

Metadata-only mode

Default mode:

snd snap .

Stores:

  • file paths
  • SHA-256 hashes
  • sizes
  • modification times
  • file modes

This is lightweight and works well for diffing. It cannot restore file contents.

Backup mode

Enabled with:

snd snap . --store-files

or:

snd snap . --backup-mode

Stores file contents in a deduplicated blob storage. The same file content is stored only once even if it appears in multiple snapshots.

Use this mode when you want restore support.

Ignored Files

snd ignores common temporary and dependency folders by default:

  • .git
  • \_\_pycache\_\_
  • node\_modules
  • .venv
  • venv
  • dist
  • build
  • \*.pyc
  • \*.log
  • .DS\_Store

Add custom ignore patterns:

snd snap . --ignore "\*.png" --ignore "data/\*"

Example

Try it on the included demo project:

snd snap examples/demo\_project --name initial --store-files

Change a file:

echo "print('changed')" >> examples/demo\_project/app.py

Compare:

snd diff examples/demo\_project

Restore:

snd restore examples/demo\_project --from initial --file app.py

Commands

snd snap PATH \[--name NAME] \[--store-files]
snd diff PATH \[--with SNAPSHOT]
snd list PATH
snd restore PATH --from SNAPSHOT (--file PATTERN | --all) \[--dry-run]
snd clean PATH --keep N
snd where

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

snd_cli-0.1.1.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

snd_cli-0.1.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file snd_cli-0.1.1.tar.gz.

File metadata

  • Download URL: snd_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for snd_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b60bf5b923b4fc07e523cf55824d180d07a70d00fffbc4c7407bd267c6536e79
MD5 3e28a1bc7f781fbd6b0a713ceb357234
BLAKE2b-256 ad9194e0316998bc890b2c6bab34c978c4799fd318ba645e5dd2e87ddd923a66

See more details on using hashes here.

File details

Details for the file snd_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: snd_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for snd_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 863fe364516c2d4ffc1f6d5b0db5b4a6ef121aa159928e2756c04881ed2c0b66
MD5 73e0544de0b1ef1b9af600b1b557ea39
BLAKE2b-256 eeaf37f9ec588ace4e984ed44f7e13760b928083c4748fd39cca2430c1dde138

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