python
ABOUTME: Complete Python development with uv package manager, quality tools, and Docker
ABOUTME: Modern workflow with uv, ruff, ty, pytest, Pydantic, and containerization
Python Development
What's New (2025-2026)
Python 3.14 (Oct 2025)
- Template strings (PEP 750):
t"Hello {name}"- safe SQL/HTML interpolation - Incremental GC: 10ms pauses (was 100ms)
- uuid7: Time-ordered UUIDs (better for DBs)
- Remote pdb:
python -p PID
Tooling
| Tool | Notes |
|---|---|
| ty | Astral's type checker, 10-60x faster than mypy |
| Ruff 0.8+ | Type-aware linting, 800+ rules |
| uv 0.5+ | Stable, production-ready |
Quick Reference
uv init myproject && cd myproject # New project
uv add requests pydantic httpx # Add deps
uv add --dev pytest ruff # Dev deps
uv sync --locked # CI-safe sync
uv run python main.py # Run code
uv run ruff check . && uv run ruff format --check . && uvx ty check && uv run pytest # Quality
Target: Python 3.13 | See also: _AST_GREP.md, _PATTERNS.md, source-control
Package Management (uv)
UV is the ONLY way. Do NOT use pip/poetry/pipenv. 10-100x faster, universal lockfile.
pyproject.toml
[project]
name = "myproject"
version = "0.1.0"
requires-python = ">=3.13"
dependencies = ["httpx>=0.27.0", "pydantic>=2.10.0"]
[dependency-groups]
dev = ["pytest>=8.0.0", "ruff>=0.8.0"]
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
Code Quality
Type checking: uvx ty check
Linting (Ruff): uv run ruff check . && uv run ruff format --check .
[tool.ruff]
line-length = 100
target-version = "py313"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP", "B", "C4", "SIM", "TCH", "RUF", "PERF"]
Testing: uv run pytest --cov=myproject --cov-report=html. Fixtures, AAA pattern, parametrize.
Pydantic v2
from pydantic import BaseModel, Field, field_validator
class User(BaseModel):
id: int
name: str = Field(min_length=1, max_length=100)
email: str
@field_validator("email")
@classmethod
def validate_email(cls, v): return v.lower() if "@" in v else raise ValueError("Invalid")
# Performance
user = User.model_validate_json('{"id":1,"name":"Max","email":"m@x.com"}') # Fast JSON
Code Review Checklist
- Public functions have type hints, no unjustified
Any - Pydantic for external data,
X | NonenotOptional[X] - Ruff/type checker pass, no bare
except: - Context managers,
asyncio.gather()for concurrency - AAA tests, parametrized
For Docker, CI/CD, async patterns, and detailed testing examples, see references/python-patterns.md.
Resources
More from maroffo/claude-forge
email-cleanup
Clean up Gmail - archive old emails, delete promotions, manage storage. Use when user wants to clean inbox, archive emails, or free up space.
25newsletter-digest
Process newsletters into Second Brain digest. Use when user wants to process newsletters, create digest, or catch up on subscriptions. Not for web clippings (use process-clippings) or email bookmarks (use process-email-bookmarks).
22table-image
Render markdown tables as hand-drawn sketch images. Use when user wants a table rendered as an image, visual table, or diagram illustration.
21apple-swift
Apple platform development with Swift, SwiftUI, async/await, and performance. Use when working with .swift files, Package.swift, Xcode projects, or building for iOS/macOS/watchOS/visionOS.
20react-nextjs
React + Next.js App Router development. Use when working with .tsx/.jsx files, next.config, or user asks about Server Components, data fetching, state management, forms, or React testing.
20inbox-triage
Review and prioritize Gmail inbox. Use when user wants to check email, review inbox, or see what needs attention.
19