Skip to main content

Interactive Python environment setup CLI for VSCode

Project description

TyPySetup - Python Environment Setup CLI

Interactive Python environment setup CLI for VSCode. Automatically configure Python projects with proper virtual environments, dependencies, and VSCode settings.

Features

  • ๐ŸŽฏ Interactive Menu - Select from 6 project type templates (FastAPI, Django, Data Science, CLI Tools, Async/Real-time, ML/AI)
  • ๐Ÿ”ง Automatic Setup - Create virtual environment, install dependencies, generate VSCode configs
  • ๐Ÿ“ฆ Multiple Package Managers - Support for uv (fast), pip (universal), and poetry (lock files)
  • โš™๏ธ Smart Configuration - VSCode settings optimized per project type, non-destructive merging, with the project venv auto-selected as the default interpreter
  • ๐Ÿ’พ Preference Persistence - Remember your choices for faster future setups
  • ๐Ÿ”„ Graceful Cancellation - Cancel between phases with automatic rollback

Quick Start

Installation

# Install from PyPI (recommended)
pip install typysetup

# Or with uv
uv tool install typysetup

# Install from source (development)
git clone <repository>
cd typysetup
pip install -e .

Basic Usage

# Interactive setup wizard
typysetup setup /path/to/project

# List available setup types
typysetup list

# Manage preferences
typysetup preferences --show

Example: FastAPI Project

$ typysetup setup ~/my-api
? Choose a setup type: FastAPI
? Package manager (uv recommended): uv
? Proceed with setup? [Y/n]: y

Creating virtual environment...
Installing dependencies (14 packages)...
Generating VSCode configuration...

โœ“ Setup complete! Next steps:
  - Activate: source ~/my-api/venv/bin/activate
  - Open VSCode: code ~/my-api
  - Start coding: fastapi dev main.py

Project Structure

typysetup/
โ”œโ”€โ”€ src/typysetup/
โ”‚   โ”œโ”€โ”€ main.py                # Typer CLI application
โ”‚   โ”œโ”€โ”€ models/                # Pydantic data models
โ”‚   โ”œโ”€โ”€ commands/              # CLI command classes (OOP)
โ”‚   โ”‚   โ”œโ”€โ”€ config_cmd.py      # ConfigCommand
โ”‚   โ”‚   โ”œโ”€โ”€ help_cmd.py        # HelpCommand
โ”‚   โ”‚   โ”œโ”€โ”€ history_cmd.py     # HistoryCommand
โ”‚   โ”‚   โ”œโ”€โ”€ list_cmd.py        # ListCommand
โ”‚   โ”‚   โ”œโ”€โ”€ preferences_cmd.py # PreferencesCommand
โ”‚   โ”‚   โ””โ”€โ”€ setup_orchestrator.py # SetupOrchestrator (main wizard)
โ”‚   โ”œโ”€โ”€ core/                  # Business logic (config loading, venv, deps, vscode)
โ”‚   โ”œโ”€โ”€ utils/                 # Utilities (paths, prompts, rollback)
โ”‚   โ””โ”€โ”€ configs/               # Setup type YAML templates
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ unit/                  # Unit tests
โ”‚   โ”œโ”€โ”€ integration/           # Integration tests
โ”‚   โ””โ”€โ”€ conftest.py           # Pytest fixtures
โ””โ”€โ”€ pyproject.toml            # Project metadata and dependencies

Setup Types

FastAPI

Web API with FastAPI framework - async, modern, fast

  • Python: 3.10+
  • Core: fastapi, uvicorn, pydantic
  • Dev: pytest, black, ruff

Django

Full-stack web framework with batteries included

  • Python: 3.8+
  • Core: django, djangorestframework
  • Dev: pytest, black, ruff

Data Science

Jupyter-based data analysis and ML workflows

  • Python: 3.9+
  • Core: pandas, numpy, jupyter, scikit-learn
  • Dev: pytest, black, ruff

CLI Tool

Command-line applications using Typer/Click

  • Python: 3.8+
  • Core: typer, click, rich
  • Dev: pytest, black, ruff

Async/Real-time

High-performance async and real-time applications

  • Python: 3.10+
  • Core: asyncio, aiohttp, websockets, starlette
  • Dev: pytest, black, ruff

ML/AI

Machine learning and AI model development

  • Python: 3.9+
  • Core: tensorflow, torch, transformers, scikit-learn
  • Dev: pytest, black, ruff

Technology Stack

  • Language: Python 3.11+
  • CLI Framework: Typer (type-safe, beautiful)
  • Data Validation: Pydantic (runtime validation)
  • Configuration: YAML + PyYAML (human-friendly)
  • Terminal UI: Rich + Questionary (interactive prompts)
  • Virtual Environment: Built-in venv module
  • Package Managers: uv (primary), pip, poetry
  • Testing: pytest + pytest-cov
  • Code Quality: black, ruff, mypy

Development

Setup Development Environment

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=src/typysetup

Code Quality

# Format code
black src/ tests/

# Lint code
ruff check src/ tests/

# Type checking
mypy src/typysetup

Testing

# Run all tests
pytest

# Run unit tests only
pytest tests/unit/

# Run integration tests
pytest tests/integration/

# Run with coverage report
pytest --cov=src/typysetup --cov-report=html

Architecture

See ARCHITECTURE.md for detailed architecture documentation.

Configuration

User preferences are stored in ~/.typysetup/preferences.json:

{
  "preferred_manager": "uv",
  "preferred_python_version": "3.11",
  "preferred_setup_types": ["fastapi"],
  "setup_history": []
}

Commands

typysetup setup

Interactive setup wizard - guides you through project configuration.

typysetup setup /path/to/project [--verbose]

Options:

  • --verbose, -v: Enable detailed logging output

Example:

typysetup setup ~/my-fastapi-app --verbose

typysetup list

List all available setup type templates.

typysetup list

typysetup preferences

Manage user preferences and view setup history.

typysetup preferences --show   # View current preferences
typysetup preferences --reset  # Reset to defaults

typysetup config

Display project configuration.

typysetup config /path/to/project

typysetup history

View recent setup history.

typysetup history [--limit 10] [--verbose]

typysetup help

Show detailed help and usage examples.

typysetup help [topic]  # Topics: setup, workflows, preferences

Common Workflows

Creating a New FastAPI Project

mkdir my-api
cd my-api
typysetup setup .
# Select "FastAPI" from menu
# Choose "uv" as package manager
source venv/bin/activate
code .

Data Science Project with Jupyter

typysetup setup ml-analysis
# Select "Data Science"
cd ml-analysis
source venv/bin/activate
jupyter notebook

Converting Existing Project

cd existing-project
typysetup setup .
# TyPySetup will detect and preserve existing files
# Select appropriate setup type

Troubleshooting

For detailed troubleshooting guide, see TROUBLESHOOTING.md.

Quick Fixes

Python not found:

python --version  # Ensure 3.10+

Command not found:

pip install typysetup
# or
pip install --user typysetup

Permission denied:

chmod u+w /path/to/project

VSCode not recognizing venv:

  • Reload window: Ctrl+Shift+P โ†’ "Developer: Reload Window"
  • Select interpreter: Ctrl+Shift+P โ†’ "Python: Select Interpreter"

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE file for details

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

typysetup-2.1.0.tar.gz (69.8 kB view details)

Uploaded Source

Built Distribution

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

typysetup-2.1.0-py3-none-any.whl (87.2 kB view details)

Uploaded Python 3

File details

Details for the file typysetup-2.1.0.tar.gz.

File metadata

  • Download URL: typysetup-2.1.0.tar.gz
  • Upload date:
  • Size: 69.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for typysetup-2.1.0.tar.gz
Algorithm Hash digest
SHA256 86b0cca3bba528fb0ebf615049b35df7acf2df0d053868f148bc78640d982d51
MD5 9a4dd93503bb9964f4f8f95191c8635f
BLAKE2b-256 7f5c5fd96b74dc044856fcd48204b4235b4f248f8f1ce6651457c3dbd1673f4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for typysetup-2.1.0.tar.gz:

Publisher: publish-to-pypi.yml on mugubr/typysetup

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

File details

Details for the file typysetup-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: typysetup-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 87.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for typysetup-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e751f295bb7711acffcfb3c35b8a430219c1be284fa6edbfde421bd44f27e11
MD5 b6c0f5c964152421032e5bbb41a18d3a
BLAKE2b-256 48e16ecda37fda20f314428216ee84636a7205cc9d86394c15a9a56a34443c72

See more details on using hashes here.

Provenance

The following attestation bundles were made for typysetup-2.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on mugubr/typysetup

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