Skip to main content

UV Project Generator - Create Python monorepos with workspaces.

Project description

uvpg - UV Project Generator

PyPI version License Release and Publish

A CLI tool to scaffold Python monorepo projects using uv workspaces.

Features

  • ๐Ÿš€ Creates monorepo structure with uv workspaces
  • ๐Ÿ“ฆ Adds internal packages with automatic dependency registration
  • ๐Ÿ Configurable Python version
  • ๐Ÿ‘ค Configurable author name and email
  • ๐Ÿ“„ MIT License auto-generated
  • ๐Ÿ”ง Pre-configured tools: Ruff, Ty, pytest, coverage
  • ๐Ÿ’ป VSCode settings with recommended extensions
  • ๐Ÿ–ฅ๏ธ Auto-detects OS for correct Python interpreter path
  • ๐Ÿณ Docker support with multi-stage build and compose
  • โšก FastAPI + Uvicorn ready

Installation

# Install from PyPI
pip install uvpg

# Or install from PyPI with uv
uv tool install uvpg

# Or clone the repository
git clone https://github.com/lucasmaziero/uvpg.git
cd uvpg

# Install with uv
uv sync
uv build
uv tool install dist/uvpg-*.whl

# Or install with pip
pip install dist/uvpg-*.whl --break-system-packages

Uninstall

# Via uv
uv tool uninstall uvpg

# Via pip
pip uninstall uvpg

Usage

Create a new project

# Basic project
uvpg my-project

# With specific Python version
uvpg my-project --python 3.14

# With author information
uvpg my-project --author "John Doe" --email "john@example.com"

# With initial packages
uvpg my-project -p core -p utils -p api

# Combining options
uvpg my-project --python 3.14 --author "John Doe" --email "john@example.com" -p core

Add packages to existing project

cd my-project
uvpg . -p new-package

Show version

uvpg --version

Show help

uvpg --help

Generated Structure

my-project/
โ”œโ”€โ”€ .vscode/
โ”‚   โ”œโ”€โ”€ settings.json       # VSCode settings (Ruff, Ty, Action Buttons)
โ”‚   โ””โ”€โ”€ extensions.json     # Recommended extensions
โ”œโ”€โ”€ packages/
โ”‚   โ””โ”€โ”€ core/
โ”‚       โ”œโ”€โ”€ pyproject.toml
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ””โ”€โ”€ core/
โ”‚       โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”‚       โ””โ”€โ”€ main.py
โ”‚       โ””โ”€โ”€ tests/
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ project_clean.sh    # Cleanup script
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ app/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ main.py         # FastAPI application
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ .dockerignore
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .python-version
โ”œโ”€โ”€ compose.yaml            # Docker Compose config
โ”œโ”€โ”€ Dockerfile              # Multi-stage Docker build
โ”œโ”€โ”€ LICENSE                 # MIT License
โ”œโ”€โ”€ pyproject.toml          # Root config with workspace
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ uv.lock

Configuration

The generated pyproject.toml includes:

  • FastAPI + Uvicorn - Web framework and ASGI server
  • Ruff - Linting with select = ["ALL"]
  • Ty - Type checking
  • pytest - Testing (commented, ready to enable)
  • coverage - Code coverage (commented, ready to enable)
  • uv workspaces - Monorepo package management
  • hatchling - Build system

Docker

Run with Docker Compose:

# Build and run
docker compose up --build

# Run with watch mode (auto-reload)
docker compose up --watch

Requirements

  • Python >= 3.12
  • uv package manager

Development

# Clone
git clone https://github.com/lucasmaziero/uvpg.git
cd uvpg

# Install dependencies
uv sync

# Run locally
uv run uvpg --help

# Run tests
uv run pytest

# Build
uv build

License

MIT License - See LICENSE 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

uvpg-1.0.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

uvpg-1.0.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file uvpg-1.0.1.tar.gz.

File metadata

  • Download URL: uvpg-1.0.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uvpg-1.0.1.tar.gz
Algorithm Hash digest
SHA256 48bf73bdc70f0e11a75ae9f52a4b2cb798645e53409855337a71ba80dedf49f7
MD5 40bab6b551c1af7362b80d70a6c8be39
BLAKE2b-256 f4b77d0d4edd54ec80f5b048e63361b2ca20cdda34b7518f0a0786ea00c9a1f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for uvpg-1.0.1.tar.gz:

Publisher: release.yml on lucasmaziero/uvpg

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

File details

Details for the file uvpg-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: uvpg-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uvpg-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1723adb659b0e602976e0dfec0be1ca30f150b0a8552e765b09639a2ebeff29
MD5 4b8f7ea4ee31ff677a86819d457af59a
BLAKE2b-256 dcfe6ff2817552ef50d084f3f8e758509dd6184dd3d8e65005ac165411d1c8d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for uvpg-1.0.1-py3-none-any.whl:

Publisher: release.yml on lucasmaziero/uvpg

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