Python Recipes
View CommandsPython development commands for package management, virtual environments, testing, and script execution with pip and venv.
10 recipes
GitHub Actions CI for Python with Matrix Testing
Set up a complete GitHub Actions CI pipeline for Python projects with matrix testing across multiple Python versions, linting, type checking, and coverage.
Debug and Profile Python Apps from the CLI
Use Python's built-in debugger (pdb), profiling tools (cProfile), and memory analysis to find bugs and performance bottlenecks from the command line.
Package Python Apps in Docker with Multi-Stage Builds
Containerize Python applications using Docker multi-stage builds for small, secure, production-ready images.
Static Type Checking with mypy
Add static type checking to your Python project with mypy to catch type errors before runtime and improve code documentation.
Full Project Lifecycle with Poetry
Manage Python project dependencies, virtual environments, versioning, and publishing with Poetry's declarative pyproject.toml workflow.
Manage Multiple Python Versions with pyenv
Install and switch between multiple Python versions on the same machine using pyenv, with per-project version pinning.
Testing Workflow with pytest, Fixtures, and Coverage
Write and run Python tests with pytest, using fixtures for setup, parametrize for data-driven tests, and coverage for reporting.
Fast Linting and Formatting with Ruff
Use Ruff to lint and format Python code at extreme speed, replacing Flake8, isort, Black, and dozens of other tools in a single binary.
Blazing-Fast Dependency Management with uv
Use uv from Astral as a drop-in replacement for pip and virtualenv with 10-100x faster installs and built-in project management.
Set Up a Python Project with Virtual Environment
Create an isolated Python environment with dependencies, linting, and a reproducible project structure ready for collaboration.