Skip to main content

The Mentor-Based Python Project Initializer. Learn best practices while building.

Project description

๐Ÿ ViperX

The Mentor-Based Project Initializer Stop memorizing boilerplate. Start learning best practices.

ViperX is more than a CLIโ€”it's an automated mentor. It generates production-ready Python projects (Classic, ML, DL) using uv, but crucially, it creates ultra-commented code that teaches you why the structure is built that way.

๐Ÿฆ… Philosophy: "Freedom & Grip"

  1. Grip (Mentorship): We hold your hand at the start with strict, educational defaults.
  2. Freedom (No Lock-in): Use viperx eject to remove the tool entirely. Your code remains standard Python.
  3. Conscious Mastery: We aim to make you autonomous, not dependent.

๐ŸŽ“ Educational Features

1. The Knowledge Base (viperx learn)

Don't leave the terminal to read generic tutorials. ViperX includes a curated knowledge base about modern Python tooling.

viperx learn uv          # Why uv is the future of packaging
viperx learn structure   # Why we use the src/ layout
viperx learn packaging   # Understanding pyproject.toml

2. Explain Mode (--explain or Persistent)

Pass the global --explain flag to any command to get a real-time architectural breakdown. Or make it permanent:

viperx explain --activate    # I want a mentor for everything
viperx explain --deactivate  # I know what I'm doing now

When active, every command explains itself:

$ viperx config -n my-lib --explain

โ•ญโ”€ ๐ŸŽ“ Explain: Project Structure Strategy โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ We are about to create my-lib.                                  โ”‚
โ”‚ - Layout: src/ layout (Standard)                                โ”‚
โ”‚ - Why?: Placing code in src/ prevents "import side effects".    โ”‚
โ”‚   It forces you to install the package to test it.              โ”‚
โ”‚ - Tool: We use uv init because it sets up a modern              โ”‚
โ”‚   pyproject.toml automatically.                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โœจ Features

  • Education First: Generated files are learning materials. viperx --explain tells you the "why".
  • Blazing Fast: Built on top of uv for sub-second setup.
  • Pre-configured: pyproject.toml, proper src layout, ruff ready.
  • ML/DL First: Templates with torch, tensorflow, kagglehub and Smart Caching.
  • Smart Caching: Auto-downloads and caches datasets to ~/.cache/viperx/data (or local data/).
  • Strict Isolation: Environment variables (.env) isolated in src/<pkg>/ for better security.
  • Config-in-Package: Solves the "Colab/Kaggle doesn't see my config" problem.
  • Platform Agnostic: Works on Local, VSCode, Colab, and Kaggle.
  • Safe Mode: Never overwrites or deletes files automaticallyโ€”reports changes for manual action.

๐Ÿ“ฆ Installation

Recommended (Global Tool)

pipx install viperx

Alternative (uv)

uv tool install viperx

๐Ÿš€ Quick Start

# Classic Package
viperx config -n my-lib

# Machine Learning Project
viperx config -n churn-prediction -t ml --env

# Deep Learning Project (PyTorch)
viperx config -n deep-vision -t dl -f pytorch

# Declarative Config (Infrastructure as Code)
viperx config get                   # Generate template
viperx config -c viperx.yaml        # Apply config

๐Ÿงฑ Project Structure

Standard Layout

my-lib/
โ”œโ”€โ”€ pyproject.toml      # Managed by uv
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ viperx.yaml         # Config file
โ””โ”€โ”€ src/
    โ””โ”€โ”€ my_lib/
        โ”œโ”€โ”€ __init__.py
        โ”œโ”€โ”€ main.py         # Entry point
        โ”œโ”€โ”€ config.yaml     # Data URLs & Params
        โ”œโ”€โ”€ config.py       # Loader
        โ”œโ”€โ”€ .env            # Secrets (ISOLATED)
        โ””โ”€โ”€ tests/
            โ””โ”€โ”€ test_core.py

ML/DL Layout

deep-vision/
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ notebooks/
โ”‚   โ”œโ”€โ”€ Base_Kaggle.ipynb
โ”‚   โ””โ”€โ”€ Base_General.ipynb
โ”œโ”€โ”€ data/               # Cached datasets
โ””โ”€โ”€ src/
    โ””โ”€โ”€ deep_vision/
        โ”œโ”€โ”€ main.py
        โ”œโ”€โ”€ config.py       # <--- ISOLATED
        โ”œโ”€โ”€ .env            # <--- ISOLATED
        โ”œโ”€โ”€ data_loader.py  # Smart caching
        โ””โ”€โ”€ tests/

๐Ÿ’ป CLI Reference

config - Main Command

viperx config [OPTIONS]

Options:

Flag Description Default
-n, --name Project name (Required) -
-t, --type classic, ml, dl classic
-d, --description Project description -
-a, --author Author name git user
-l, --license MIT, Apache-2.0, GPLv3 MIT
-b, --builder uv, hatch uv
-f, --framework pytorch, tensorflow (DL only) pytorch
--env / --no-env Generate .env file --no-env
-c, --config Path to viperx.yaml -

learn - Educational Hub

viperx learn         # List topics
viperx learn uv      # Learn about uv

Global Options

  • --explain: Enable detailed architectural explanations during execution.
  • --version: Show version.

config get - Generate Template

viperx config get

Creates a viperx.yaml template in current directory.

config update - Rebuild from Codebase

viperx config update

Scans the existing project and updates viperx.yaml to match reality:

  • Detects packages in src/
  • Detects use_config, use_env, use_tests from actual files
  • Adds annotations for any mismatches

package - Workspace Management

# Add package
viperx package add -n worker-api -t classic

# Delete package
viperx package delete -n worker-api

# Update dependencies
viperx package update -n worker-api

๐Ÿ“ Declarative Config (viperx.yaml)

project:
  name: "my-project"
  description: "A cool project"
  author: "Your Name"
  license: "MIT"
  builder: "uv"

settings:
  type: "classic"          # classic | ml | dl
  use_env: false
  use_config: true
  use_tests: true

workspace:
  packages:
    - name: "api"
      type: "classic"
    - name: "ml-core"
      type: "ml"
      use_env: true

๐Ÿ”’ Safe Mode Philosophy

ViperX follows a non-destructive approach:

Action Behavior
Add โœ… Creates new files/packages
Update โš ๏ธ Reports changes, user decides
Delete โŒ Never deletesโ€”warns user
Overwrite โŒ Never overwrites existing files

๐Ÿงช Test Coverage

uv run pytest src/viperx/tests
# 46 tests | 76% coverage

Test Structure:

  • unit/ - Validation (5 tests)
  • functional/ - CLI, licenses, project types, updates (18 tests)
  • scenarios/ - Classic, workspace, type blocking, config scanner (18 tests)
  • integration/ - E2E lifecycle (5 tests)

๐Ÿค Contributing

git clone https://github.com/KpihX/viperx.git
cd viperx
uv sync
uv run viperx --help

Built with โค๏ธ by KpihX

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

viperx-1.7.0.tar.gz (62.6 kB view details)

Uploaded Source

Built Distribution

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

viperx-1.7.0-py3-none-any.whl (84.0 kB view details)

Uploaded Python 3

File details

Details for the file viperx-1.7.0.tar.gz.

File metadata

  • Download URL: viperx-1.7.0.tar.gz
  • Upload date:
  • Size: 62.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for viperx-1.7.0.tar.gz
Algorithm Hash digest
SHA256 0bf3f0560345f0faa310c4d3dcdaa5f5dc2af483f4093a8a193e83d2ee0f5a69
MD5 ce7f2c99b2f75058155f979d79157c16
BLAKE2b-256 12a6bce0bdc0424e1853581d707596aa8fcfc3efc5a3912948e600cce3b5d8fa

See more details on using hashes here.

File details

Details for the file viperx-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: viperx-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 84.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for viperx-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d976c41878c7d38ddc65b872d8208c66084b180c000c5b081f7398b1bcb1f08c
MD5 cea47b7878d1b0e001d7ee937c36c313
BLAKE2b-256 37059ab855f9ae03e65b6d8380370699dab434c500d324d291d95ce30430978d

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