# Python

> Python development with FastAPI, data processing, audio analysis with librosa. Type hints, async patterns, Pydantic models. Don't use for JavaScript/TypeScript code.

- Skill: `neuron-one/python` (Agent Skill)
- Install (CLI): `npx skillmds@latest add neuron-one/python`
- Raw SKILL.md: https://api.skillmd.com/api/skills/neuron-one/python/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: neuron-one (https://skillmd.com/u/neuron-one)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/neuron-one/python

---


# Python Development

## FastAPI Patterns
- Pydantic models for all request/response
- Dependency injection for services
- Async/await for all I/O operations
- Background tasks for heavy processing
- Proper error handling with HTTPException

## Type Hints
- Required for all function signatures
- Use Optional[] for nullable params
- Use Union[] for multiple types
- Generic types for collections

## Data Processing
- pandas for structured data
- numpy for numerical operations
- asyncio for concurrent I/O
- ThreadPoolExecutor for CPU-bound tasks

## Audio (librosa)
- BPM detection: librosa.beat.beat_track
- Key detection: librosa.feature.chroma_cqt
- Energy: librosa.feature.rms
- Spectral features: centroid, bandwidth, rolloff

## Project Structure
```
project/
  ├── app/
  │   ├── main.py
  │   ├── models/
  │   ├── services/
  │   └── routes/
  ├── tests/
  ├── requirements.txt
  └── pyproject.toml
```
