Marketplace
Browse and adopt engineering standards, rules, and configurations. Fork to customize for your organization.
Use Django migrations properly
django
One migration per change. Never edit applied migrations. Use RunPython for data migrations. Squash when large.
Use mypy for Python type checking
linting
mypy with --strict mode. Check all files. Fix type errors, don't ignore. Part of CI pipeline.
Use Alembic for database migrations
python
Alembic for SQLAlchemy migrations. `alembic revision --autogenerate`. Review generated migrations. Stamp for sync.
Use async/await for I/O operations
python
Async for HTTP (httpx), database (asyncpg), files (aiofiles). Don't mix sync/async in same service.
Use context managers for resources
python
with statement for files, connections, locks. contextlib for custom managers. Never leave resources open. async with for async resources.
Use logging module properly
python
logging module, not print. Configure at app entry point. Use __name__ for logger names. Structured logging with extra dict or structlog.
Use Pydantic for data validation
python
Pydantic BaseModel for validation. Field types with constraints. Serialization built-in. FastAPI integration.
Use Ruff for linting and formatting
python
Ruff for both linting and formatting (replaces flake8/isort/pylint/Black). Single tool, 100x faster. `ruff check` and `ruff format`.
Use SQLAlchemy for database access
python
SQLAlchemy 2.0 style. Declarative models. Session management. Async with asyncio extension.
Use type hints everywhere
python
Type hints on all functions and class attributes. Enables mypy/pyright static analysis.
uv project structure
python
pyproject.toml for deps, uv.lock (commit it), .python-version, src/ layout. Python 3.12+.
Use isort for Python imports
formatting
isort for import ordering. Profile: black. Run before Black. Or use Ruff which includes isort.
Use flake8 for Python linting
linting
flake8 for style checks. Use with .flake8 config. max-line-length: 88 (Black compat). Ruff is faster alternative.
Use pyright for Python type checking
linting
pyright: fast type checker. VS Code Pylance backend. strict or basic mode. Better inference than mypy.
Use Poetry for Python dependency management
package_manager
pyproject.toml + poetry.lock. `poetry install --no-dev` for prod. Groups for dev deps. Prefer uv for speed.
Migrate from pipenv to uv
python
pipenv is slow and unmaintained. Migrate to uv for speed and modern features. `uv init` from existing.
Use boto3 for AWS
python
boto3 for AWS services. Use resource API for simple ops, client for advanced. Handle pagination.
Use Celery for distributed tasks
python
Celery for distributed task queue. Redis or RabbitMQ broker. Beat for scheduling. Flower for monitoring.
Use dataclasses or Pydantic for data structures
python
Dataclasses for simple containers, Pydantic for validation. No plain dicts for structured data.
Use httpx for async HTTP
python
httpx for async HTTP client. Requests-compatible API. Async context manager. HTTP/2 support.
Use pylint for comprehensive Python linting
python
pylint for comprehensive checks. Disable noisy rules in pylintrc. Ruff is faster alternative.
Use pytest for testing
python
pytest with fixtures and parametrize. Simple asserts, rich plugin ecosystem.
Use requests for sync HTTP
python
requests for simple sync HTTP. Session for connection pooling. Timeout always. Use httpx for async.
Use unittest for Python basics
python
unittest for simple cases or legacy code. TestCase classes. setUp/tearDown. Prefer pytest for new projects.
uv scripts and commands
python
Define entry points in `[project.scripts]`. Run any command with `uv run <cmd>`. CI: `uv sync --frozen`.
uv workspaces for monorepos
python
Use `[tool.uv.workspace]` for multi-package repos. Single lockfile, editable local packages.