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.1.2.tar.gz (10.4 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.1.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for snapvc-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e7bf4b0210eebcbab1f7dde41ccb0f1b3175da5504b0603e92b3ae8ccd703196
MD5 04af7db7ea095e90edcdd8bd37b81858
BLAKE2b-256 57e8a89d8c4e61f8052bf6ff38e531c61673174a34ea8a2260d2b10afd2c0418

See more details on using hashes here.

File details

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

File metadata

  • Download URL: snapvc-0.1.2-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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e1d094c8e98a76401a187fe013dc94ef0637794fded5c1fdc052386dabaab119
MD5 0098a92ff3c86a477176993237ae2239
BLAKE2b-256 30c81034a2eb4a5b3507dc1796c4736a60e2254f840f074535431ee9493364bc

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