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.0.tar.gz (13.3 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.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snd_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 13.3 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.0.tar.gz
Algorithm Hash digest
SHA256 69632c96f234ade2c2e1a714c2ab3c6ab8de56d55d9673da1e8171179484e0da
MD5 ff5e5f068b252a9fddb8a5258077e27a
BLAKE2b-256 a00e158aad9a93332d36f68f2877a20bfc61b14b6bc881720ad7760cce50e4be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: snd_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93f516db7e66d5d53d7a7db957f56dfc763508309239b0624230a3f5d975ba79
MD5 bcd7e4dcd3ea675121115233ddf44331
BLAKE2b-256 2c178996bdb5fd4b44750fec36b5e7eaa761fd942fe7b06a0cde12c2d45f116c

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