python
Python development preferences. Use when writing Python code, CLI tools, APIs, or scripts.
When & Why to Use This Skill
This Claude skill streamlines Python development by enforcing modern best practices and a curated high-performance toolset. It focuses on writing readable, concise, and type-hinted code using industry-leading libraries like FastAPI, Polars, and SQLModel, while leveraging the `uv` package manager for lightning-fast dependency management and project initialization.
Use Cases
- Rapidly bootstrapping new Python projects with standardized configurations using `uv` and `ruff` for linting and formatting.
- Developing robust and interactive CLI tools using `typer` and `rich` for professional terminal outputs.
- Building scalable, production-ready Web APIs and backend services with FastAPI, Pydantic, and SQLModel.
- Implementing clean and maintainable data processing pipelines using Polars and explicit Python type hints.
- Integrating directly with Google Workspace APIs (Sheets, etc.) using official SDKs and modern authentication patterns.
- Setting up local development environments with automated testing via `pytest` and secure tunneling via Cloudflare.
| name | python |
|---|---|
| description | Python development preferences. Use when writing Python code, CLI tools, APIs, or scripts. |
Python Development
Philosophy
Readable, concise code. Function names and type hints should make purpose clear without verbose docstrings.
Tooling
- Package manager:
uv- new projects:uv init --python 3.14 - Linting/formatting:
ruff - Testing:
pytest - Logging:
loguru
Preferred Libraries
| Purpose | Library |
|---|---|
| CLI tools | typer |
| CLI output | rich (when needed) |
| HTTP clients | httpx |
| Web APIs | fastapi + uvicorn |
| DataFrames | polars |
| ORM | sqlmodel (Pydantic + SQLAlchemy) |
Code Style
- Type hints on function signatures
- Small, focused functions
pathlibfor pathsdataclassesor Pydantic for structured data- SQLite for prototyping, Postgres for prod
Docstrings
Minimal but useful. Skip verbose Google/NumPy style. Answer: "what does this return in practice?"
def fetch_weather(city: str) -> dict[str, float]:
"""Get current weather from OpenWeatherMap API.
Returns {"temp": 24.5, "humidity": 65.0, "wind_speed": 12.3}
"""
Include: what it does (if name isn't obvious), what's actually returned (not just the type), optional example for complex functions.
Google APIs
Use Google SDKs directly (gspread and similar wrappers are outdated/unmaintained).
uv add google-api-python-client google-auth-httplib2 google-auth-oauthlib
Refs: Sheets quickstart, reading values
Local Testing
Expose local servers via Cloudflare tunnel:
cloudflared tunnel --url http://localhost:8000
Deployment
Railway for FastAPI projects. Volumes required for persistent files (SQLite db, credentials.json).
Ref: Railway LLM docs