---
description: Python coding standards
globs: **/*.py
alwaysApply: false
---

- Follow PEP 8; use 4-space indentation.
- Use type hints for all function signatures and return types.
- Prefer `pathlib.Path` over `os.path` for file operations.
- Use f-strings for string formatting.
- Handle exceptions explicitly; avoid bare `except:` clauses.
- Use dataclasses or Pydantic models for structured data.
- Keep functions under 40 lines; extract helpers when longer.
- Use `logging` module instead of print statements in production code.
- Write docstrings for public functions and classes.
