Skip to main content

A lightweight version control system with cross-platform support

Project description

SnapVC - Simple Version Control System

License: MIT Python 3.7+ Cross-Platform

A lightweight, educational version control system written in Python. Perfect for learning how Git-like systems work internally, with a unique "house" system (similar to branches) and cross-platform compatibility.

🚀 Quick Start

Install

pip install snapvc

Basic Usage

# Initialize repository
svcs init

# Stage files
svcs ready

# Create snapshot
svcs snapshot

# View current version
svcs current

✨ Key Features

  • 🏠 House System: Branch-like parallel development environments
  • 📸 Snapshots: Version your code with SHA-256 integrity checking
  • 🌍 Cross-Platform: Works seamlessly on Windows, macOS, and Linux
  • 📚 Educational: Perfect for understanding version control internals
  • 🚫 Smart Ignoring: Automatically excludes OS-specific files (.DS_Store, Thumbs.db, etc.)
  • 📦 Zero Dependencies: Uses only Python standard library

📖 Commands

Command Description
svcs init Initialize repository in current directory
svcs ready Stage all files for snapshot
svcs snapshot Create versioned snapshot of staged files
svcs house new <name> Create new development house (branch)
svcs house <name> Switch to existing house
svcs house show List all available houses
svcs current Show current version number
svcs revert <version> Restore to specific snapshot version

🏠 House System (Branches)

Houses are SnapVC's equivalent to Git branches, allowing parallel development:

# Create feature house
svcs house new feature-auth

# Work on your feature
echo "login system" > auth.py
svcs ready && svcs snapshot

# Switch back to main
svcs house main

# Switch to your feature house
svcs house feature-auth

🔧 How It Works

SnapVC demonstrates core version control concepts:

  • Staging Area: Files are prepared in a "ready" area before snapshotting
  • Content Hashing: Each snapshot gets a unique SHA-256 hash for integrity
  • Binary Serialization: Efficient storage using Python's pickle format
  • Path Normalization: Cross-platform file path handling

Storage Structure

.svcss/
├── house.txt              # Current active house
├── all_house.txt          # Available houses list
└── main/                  # Default house
    ├── ready/             # Staging area
    └── snapshot/
        ├── version.txt    # Version counter
        └── 1/
            └── <hash>     # Snapshot data

🌍 Cross-Platform Support

SnapVC automatically handles platform differences:

  • Windows: Uses backslash paths, ignores Thumbs.db, desktop.ini
  • macOS: Uses forward slash paths, ignores .DS_Store
  • Linux: Supports all distributions, ignores *~, .directory

💡 Use Cases

Learning & Education

  • Understand version control system internals
  • Learn about hashing, serialization, and file tracking
  • Explore branching and parallel development concepts

Small Projects

  • Simple backup and versioning for personal projects
  • Lightweight alternative when Git feels too heavy
  • Experimentation with different development workflows

Development Practice

  • Practice CLI tool development patterns
  • Study cross-platform Python programming
  • Learn about binary data handling and file systems

🚦 Requirements

  • Python 3.7+
  • Operating System: Windows, macOS, or Linux
  • Dependencies: None (standard library only)

📚 Example Workflow

# Start new project
mkdir my-project && cd my-project
svcs init

# Create some files
echo "print('Hello World')" > main.py
echo "# My Project" > README.md

# Stage and snapshot
svcs ready
svcs snapshot

# Create feature branch
svcs house new add-tests
echo "def test_hello(): pass" > test_main.py

# Stage and snapshot feature
svcs ready
svcs snapshot

# Check current state
svcs current  # Shows: You are at version 2
svcs house    # Shows: You are at add-tests

# Switch back to main
svcs house main
ls           # Only main.py and README.md (test_main.py not here)

# Go back to feature
svcs house add-tests
ls           # All files including test_main.py

⚠️ Important Notes

  • Destructive Operations: svcs revert permanently deletes files not in target snapshot
  • Working Directory: Always run commands from your project root
  • Binary Storage: Snapshots are stored in binary format (not human-readable)
  • Case Sensitivity: House names are case-sensitive

📝 License

MIT License - see full license text at https://opensource.org/licenses/MIT

👨‍💻 Author

Shreyash Mogaveera
GitHub: @ShreyashM17


Learn version control by building it yourself! 🚀

SnapVC makes complex version control concepts accessible through hands-on experience.

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

snapvc-0.2.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

snapvc-0.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file snapvc-0.2.0.tar.gz.

File metadata

  • Download URL: snapvc-0.2.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for snapvc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2621aa63bd279da287026da5bb600a0bc28d8ee06ca6b673ffaddbef65e3649c
MD5 5a9be794ffe1336c2c325dae3ed59084
BLAKE2b-256 69538f6b263715d8c70b839bc091febfc42f12e5aa4d509da14934885ef7f7ec

See more details on using hashes here.

File details

Details for the file snapvc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: snapvc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for snapvc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f41f96a68d9ab4388804d2afbb038159ab5ec8680438872fbd80fa1ec0e8b48
MD5 046130d78fdf31157ea76228e473f131
BLAKE2b-256 4490a5d1239ab7eb5d3b08400608c878b8c67247324be8dece79db5de3743205

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