Python — typed Python with mypy/pyright, packaging and dependency locking (uv, poetry), FastAPI services, async vs sync, data and ML code hygiene, testing with pytest, performance basics. Use for Python services, data and ML code (Python, FastAPI, typing, pytest, packaging).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Python?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-python)
---
name: python
description: Python — typed Python with mypy/pyright, packaging and dependency locking (uv, poetry), FastAPI services, async vs sync, data and ML code hygiene, testing with pytest, performance basics. Use for Python services, data and ML code (Python, FastAPI, typing, pytest, packaging).
metadata:
category: languages-frameworks
---
# Python
## Purpose
Write Python that is typed, reproducible and testable.
**Use when:** Python services, scripts, ML code.
**Not for:** notebooks as production code.
## Inputs
- Code, environment.
## Outputs
- Typed code, locked dependencies, tests.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "python"` for prior decisions, patterns and anti-patterns.
## Steps
1. **Env.** Lock dependencies; pin Python version.
Done when builds are reproducible.
2. **Types.** Type hints and a type checker in CI.
Done when type check passes.
3. **Structure.** Package code; keep notebooks for exploration only.
Done when logic is importable and tested.
4. **Tests.** pytest with fixtures; property tests for data transforms.
Done when critical code covered.
## Best practices
- Pydantic models at boundaries.
- Avoid blocking calls in async code.
## Common mistakes
- Mutable default arguments.
- Unpinned dependencies.
## Example
FastAPI inference service with pydantic schemas, uv lockfile, pyright strict, pytest for preprocessing.
## Reusable prompt
```text
Apply the Python skill (.agents/skills/python/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Review or structure the Python code: environment locking, typing, packaging and tests.
Return: Typed code, locked dependencies, tests..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```