Skip to main content

CLI utility to manage Python virtual environments with auto-detection

Project description

PythonProjectManager (ppm)

A CLI utility to manage Python virtual environments with auto-detection of system Python installations.

Features

  • Auto-detect Python installations across Windows, macOS, and Linux (pyenv, conda, system Python)
  • Manage interpreters - add, list, and configure Python interpreter paths
  • Create virtual environments using any configured Python interpreter
  • Install templates - predefined and custom package templates with special pip arguments (e.g., CUDA-specific PyTorch)
  • Persistent configuration - interpreter paths and templates stored in data/interpreters.json and data/templates.json

Installation

From PyPI

pip install pythonprojectmanager

After installation, use the ppm command:

ppm --help

From source

git clone https://github.com/yourusername/PythonProjectManager.git
cd PythonProjectManager
pip install -e .

Quick Start

1. Detect and add Python installations

# List found Python installations
ppm interpreter detect

# Interactively select which to add
ppm interpreter detect --add

# Add all detected interpreters
ppm interpreter detect --add-all

2. Create a virtual environment

ppm create-venv "C:\Users\...\python.exe" my_venv

3. Install packages using templates

# List available templates
ppm template list

# Create venv with datascience template (numpy, scipy, pandas, etc.)
ppm create-from-template datascience my_ds_venv

# Create venv with PyTorch (CUDA 12.4)
ppm create-from-template pytorch-cu124 my_pytorch_venv

4. Create custom templates

# Simple template
ppm template add mytemplate "numpy scipy matplotlib"

# Template with special pip arguments
ppm template add-complex pytorch-custom "torch torchvision" --args-str "--index-url https://download.pytorch.org/whl/cu124"

# Create venv from custom template
ppm create-from-template pytorch-custom my_venv

Commands

  • ppm add-interpreter <path> - Manually add a Python interpreter path
  • ppm list - List all configured interpreters
  • ppm interpreter detect [--add | --add-all] - Auto-detect system Python installations
  • ppm create-venv <interpreter> <venv_dir> [--dry-run] - Create a virtual environment
  • ppm create-from-template <template> <venv_dir> [--interpreter <path>] [--dry-run] - Create venv and install template packages
  • ppm template list - List all templates
  • ppm template show <name> - Show template details
  • ppm template add <name> "<packages>" - Add a simple template
  • ppm template add-complex <name> "<packages>" --args-str "<args>" - Add template with pip arguments
  • ppm template remove <name> - Remove a template

Data Storage

  • Interpreters: data/interpreters.json - stores configured Python interpreter paths
  • Templates: data/templates.json - stores user-defined package installation templates

Configuration

interpreters.json

{
    "FILE_PATH": "interpreters.json",
    "interpreters": [
        "C:\\Users\\...\\python.exe",
        "/usr/bin/python3.12"
    ],
    "global_interpreter": null
}

templates.json

{
    "templates": {
        "simple": ["numpy", "scipy"],
        "pytorch-cu124": {
            "packages": ["torch", "torchvision"],
            "args": ["--index-url", "https://download.pytorch.org/whl/cu124"]
        }
    }
}

Platform Support

  • Windows: Detects pyenv-win, AppData Python installations, system Python
  • macOS/Linux: Detects /usr/bin/python*, pyenv, conda, system Python

License

MIT

Contributing

Contributions welcome! Please feel free to submit issues and pull requests.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pynstal-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pynstal-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pynstal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12d74246c1f699afe736dc14dba230b75c588cb43032fc60a31a85bcd0b97593
MD5 75bca3eeb5eb4b5edb2c0aa6ee484fe9
BLAKE2b-256 ada335e2c4a753fe148720356057ad365d7211bde4f6871f6fe7257f6b22e66c

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