Skip to main content

Python bindings for Vegh - The Snapshot Tool.

Project description

🥬 PyVegh

PyVegh is the official Python binding for the Vegh snapshot engine, developed by CodeTease.

It delivers the raw performance of Rust (Zstd multithreaded compression, Tar archiving, Blake3 hashing) wrapped in a modern, flexible Python interface.

"Tight packing, swift unpacking, no nonsense."

Features

  • Blazing Fast: Core logic is implemented in Rust using PyO3, utilizing Zstd Multithreading and the next-gen Blake3 hashing algorithm.
  • Analytics Dashboard: Instantly visualize your project's Lines of Code (LOC) with a beautiful terminal dashboard—no extraction required.
  • Dry-Run Mode: Simulate snapshot creation to check file sizes and detect sensitive data risks before packing.
  • Integrity v2: Verify data integrity at lightning speed with Blake3 and inspect metadata (author, timestamp, tool version) without unpacking.
  • Smart Upload: Built-in send command supporting concurrent Chunked Uploads for large files.
  • Smart Filtering: Automatically respects .veghignore and .gitignore rules.
  • Vegh Hooks: Allow you to custom automation shell command while snapping.
  • Deep Inspection: Peek into files (cat) and compare snapshots (diff) without unpacking.

Installation

Install directly from PyPI:

pip install pyvegh

Or build from source (requires Rust):

maturin develop --release

CLI Usage

PyVegh provides a powerful command-line interface via the vegh (or pyvegh) command.

1. Configuration

Set up your default server URL and Auth Token so you don't have to type them every time.

vegh config
# Or one-liner:
vegh config send --url https://api.teaserverse.online/test --auth YOUR_TOKEN

# List current configuration
vegh config list

# Reset configuration to defaults
vegh config reset

2. Create Snapshot

Pack a directory into a highly compressed snapshot.

# Basic snapshot
vegh snap ./my-project --output backup.vegh

# Dry-Run (Simulation) - Check for large/sensitive files
vegh snap ./my-project --dry-run

3. Analytics

View the CodeTease Analytics Dashboard to break down your project by language and lines of code.

vegh loc backup.vegh

4. Inspect & Verify

Check file integrity (Blake3) and view embedded metadata.

vegh check backup.vegh

5. Restore

Restore the snapshot to a target directory. Supports Partial Restore.

# Full restore
vegh restore backup.vegh ./restored-folder

# Partial restore (Specific files or folders)
vegh restore backup.vegh ./restored-folder --path src/main.rs --path config/

# Flatten directory structure (Extract files directly to output dir)
vegh restore backup.vegh ./restored-folder --flatten

6. Peek & Diff

Inspect content without extracting.

# View a file's content inside the snapshot
vegh cat backup.vegh src/main.rs

# View raw content (Useful for piping binary files)
vegh cat backup.vegh image.png --raw > extracted_image.png

# Compare snapshot with a directory
vegh diff backup.vegh ./current-project

7. Send

Send the snapshot to a remote server. PyVegh now supports Chunked Uploads for reliability.

# Auto-detects if chunking is needed, or force it:
vegh send backup.vegh --force-chunk

8. Doctor

Check your environment and installation health.

vegh doctor

9. Hooks example

Create a .veghhooks.json in your workspace.

{
  "hooks": {
    "pre": [
      "echo '🚀 Pre-snap hook started...'",
      "echo 'Preparing to backup...'",
      "echo 'Backing up database...'",
      "echo 'Backup completed.'"
    ],
    "post": [
      "echo '🎉 Snapshot completed!'",
      "echo 'Cleaning up...'"
    ]
  }
}

Library Usage

You can also use PyVegh as a library in your own Python scripts:

import json
from vegh import create_snap, restore_snap, check_integrity, get_metadata

# 1. Create a snapshot
# Returns the number of files compressed
count = create_snap("src_folder", "backup.vegh", comment="Automated backup")
print(f"Compressed {count} files.")

# 2. Check integrity (Now uses Blake3)
checksum = check_integrity("backup.vegh")
print(f"Blake3 Hash: {checksum}")

# 3. Read Metadata (Fast, no unpacking)
raw_meta = get_metadata("backup.vegh")
meta = json.loads(raw_meta)
print(f"Snapshot created by: {meta.get('author')}")

# 4. Restore
restore_snap("backup.vegh", "dest_folder")

License

This project is under the MIT License.

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

pyvegh-0.5.0.tar.gz (34.4 kB view details)

Uploaded Source

Built Distributions

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

pyvegh-0.5.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pyvegh-0.5.0-cp38-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.8+Windows x86-64

pyvegh-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

pyvegh-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

pyvegh-0.5.0-cp38-abi3-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

pyvegh-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file pyvegh-0.5.0.tar.gz.

File metadata

  • Download URL: pyvegh-0.5.0.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvegh-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7ee25c4cb3539ecd7e7ad8984d5b8a98ceb17033ad6b08fb8b4bd994fadd8fec
MD5 373acc7df7e089c895d580a750dae549
BLAKE2b-256 333d359e2f05c99faf5dd03e57ce3f5d775c1f9cc49376a5bf9c29b0f919e2d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvegh-0.5.0.tar.gz:

Publisher: release.yml on CodeTease/pyvegh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvegh-0.5.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyvegh-0.5.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c05c94e406c3963d689a5704e8b7baef42c69c2e58f4bb66f2f2ca2eb1ead04
MD5 041eb93f1cedf301ffa3ad2e7a69564f
BLAKE2b-256 d666ffc0e40380c4f74bfbcd2018962d16665be4e100747dce25fcf4d4c62c07

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvegh-0.5.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on CodeTease/pyvegh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvegh-0.5.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: pyvegh-0.5.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvegh-0.5.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 14bdaa7ff2da3bc43e4db5a6b42ab754bf38df8b2d346f8d33b9474ca9eb4b48
MD5 8761e54362fa44486edd1dde42f9325d
BLAKE2b-256 d2959cdf0d3f9a48f4e6d7ac56805d0ff32af2a07db05034a573521fb420fb3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvegh-0.5.0-cp38-abi3-win_amd64.whl:

Publisher: release.yml on CodeTease/pyvegh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvegh-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyvegh-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c7e23551a62428298b60b858af9439526e53bdb07c143a83ac3fb0d383c5a99
MD5 89053ec014d99f77f6f5d78506951758
BLAKE2b-256 88362fca41d29f449d6448cc866f934a18733abbcbc7c09f0c8e2177af8582bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvegh-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on CodeTease/pyvegh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvegh-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyvegh-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 443f85c86f77d4a5147d4a2a7343b24e87ee04e12a9b62a4bc8ec77d768e2094
MD5 1d1a8fd2fe264bf1d9f22b9db014a9b6
BLAKE2b-256 c022eb92011111a32f8ee45ebb44b1843c76165cb6a5a4737b9a44813fa42d28

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvegh-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on CodeTease/pyvegh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvegh-0.5.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyvegh-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67911430c1608e931b99c9caa300240c1fb1d71457f83ff8543285c9f5693c39
MD5 f67b77d1dd19b46d219b82f5ab773c95
BLAKE2b-256 08c78cccd731e0ee0977d925f93219165c63645a358b058a6eee50af4ef8f5fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvegh-0.5.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on CodeTease/pyvegh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvegh-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyvegh-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a4ab188e05629648d1927dec2c53e953ce72d4b40b199983b78e944b57f8cb8c
MD5 24bccf5b483e926d38b9a3001e086011
BLAKE2b-256 dae2753fc5c778c1ff876e6060730c576b40629642eaa356603f60493ae7c407

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvegh-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on CodeTease/pyvegh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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