python

Provides Python development patterns for FastAPI, pandas, polars, pytest, packaging, asyncio, and CLIs.

4|1|Updated May 22, 2026
One-click install
npx skills add https://github.com/ThomazRossito/ai-data-agents --skill python-thomazrossito
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python
Source: https://github.com/ThomazRossito/ai-data-agents/tree/main/plugins/ai-data-agents/skills/python
Command: npx skills add https://github.com/ThomazRossito/ai-data-agents --skill python-thomazrossito

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Python developers often reinvent solutions or fall into common anti-patterns when building APIs, data pipelines, tests, or CLI tools. This Skill provides a curated index of battle-tested pattern references so the AI applies correct, idiomatic Python practices immediately instead of generating generic or outdated code. ## Core Features & Use Cases - FastAPI Patterns: App factory with lifespan, Pydantic v2 schemas, dependency injection, error handling, and BaseSettings configuration. - Data Transformation: Decision guidance for pandas vs polars, vectorized operations, lazy pipelines, and efficient group-by/join patterns. - Testing & Packaging: pytest fixtures, mocking, parametrize, coverage configuration, plus modern pyproject.toml packaging and PyPI publishing. - Async & CLI: asyncio gather, queues, semaphores, executors, plus argparse/Typer/Rich CLI patterns with semantic exit codes. - Use Case: When asked to build a REST endpoint that fetches data concurrently, the Skill directs the AI to the FastAPI and asyncio references, producing typed, tested code that avoids blocking the event loop. ## Quick Start Use the python skill to review my FastAPI endpoint and apply the correct async and Pydantic v2 patterns.

Frequently Asked Questions about python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a FastAPI project with routers and services?▼

Structure FastAPI projects with an app factory using lifespan, APIRouter per domain, Pydantic v2 schemas separated by input/output, and business logic in service modules without HTTP context. Use Depends() for reusable dependencies and BaseSettings for environment configuration.

pandas vs polars: which should I use for data transformation?▼

Use pandas for datasets under 1M rows and ML ecosystem integration; use polars for datasets over 10M rows or when performance matters, since it offers lazy evaluation and parallel execution. Convert between them with to_pandas() and from_pandas() when needed.

How do I run blocking code inside asyncio without freezing the event loop?▼

Use loop.run_in_executor with a ThreadPoolExecutor to run blocking I/O without stalling the event loop. Never call time.sleep() in async code; use await asyncio.sleep() instead, and limit concurrency with asyncio.Semaphore.

How do I mock async functions in pytest?▼

Mock async functions in pytest using unittest.mock.AsyncMock with patch, or pytest-mock's mocker.patch for cleaner syntax. Set asyncio_mode = "auto" in pyproject.toml and use fixtures with appropriate scopes for expensive setup like database connections.

What are common pandas anti-patterns to avoid?▼

Avoid iterrows(), chained indexing that triggers SettingWithCopyWarning, inplace=True, and df.append(). Instead use vectorized operations, df.loc for assignment, explicit reassignment, and pd.concat or list construction for row additions.

When should I use Typer instead of argparse for a CLI?▼

Use Typer when argparse becomes verbose, as it builds commands from type-annotated function signatures with less boilerplate. Stick with argparse for simple tools or zero-dependency requirements, and pair either with Rich for tables, progress bars, and styled output.