lang-python_skill

This skill helps you write, debug, and set up Python projects with modern tooling and frameworks like FastAPI, Django, and pandas.
  • TypeScript

8

GitHub Stars

1

Bundled Files

3 weeks ago

Catalog Refreshed

2 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstart where the catalogue uses aiagentskills.

npx veilstart add skill joncrangle/.dotfiles --skill lang-python

  • SKILL.md6.2 KB

Overview

This skill helps with writing, debugging, and structuring Python projects using modern tools and idioms. It focuses on async-first web frameworks (FastAPI, Starlette), Pydantic validation, SQLAlchemy async patterns, pytest async testing, and contemporary type-hinting. It prefers fast, reproducible package management and venv workflows to speed iteration and reduce errors.

How this skill works

The agent inspects project files like pyproject.toml, requirements.txt, and source .py files to infer frameworks, dependencies, and test layouts. It uses a discovery-first approach: check justfile, then read project metadata, then operate with uv for package and venv management. For code suggestions it enforces safe patterns (no mutable defaults, no wildcard imports, no bare excepts) and avoids sync I/O inside async functions.

When to use it

  • When you ask to write or refactor Python code or endpoints (FastAPI, Django, Flask).
  • When debugging Python scripts, async behaviors, or test failures (pytest, pytest-asyncio).
  • When setting up a project: virtual env, dependency management, pyproject.toml, or CI steps.
  • When migrating to Pydantic v2 or modern typing (Protocol, TypeVar, ParamSpec).
  • When you need database async patterns with SQLAlchemy, Alembic migrations, or ORM mapping.
  • When working with data libraries (pandas, numpy, polars) or building ETL pipelines.

Best practices

  • Never use mutable default arguments; use None and initialize inside functions.
  • Avoid blocking sync I/O within async functions; prefer httpx and asyncio primitives.
  • Use explicit imports; avoid from module import *.
  • Catch specific exceptions only; never use bare except:.
  • Prefer uv for package management and uv venv for environments; fall back to pip/poetry only if explicitly requested or uv fails.
  • Respect lint/format settings found in ruff.toml or pyproject.toml [tool.ruff].

Example use cases

  • Generate FastAPI endpoints with Pydantic v2 models and async DB access using SQLAlchemy 2.0 async sessions.
  • Create pytest async tests and fixtures for an ASGI app, including async_client examples.
  • Migrate models to Pydantic v2 using model_config and model_validate patterns.
  • Set up project env: detect pyproject.toml, run uv venv, and add dependencies with uv add.
  • Debug detached session issues: set expire_on_commit=False or await session.refresh(obj) after commit.

FAQ

Use uv for all package and venv operations; only use pip or poetry if explicitly requested or if uv is unavailable.

How should I handle blocking libraries in async code?

Replace blocking calls with async equivalents (httpx for HTTP, asyncio.sleep) or run blocking work in thread/process pools.

How do I validate ORM objects with Pydantic v2?

Enable from_attributes=True in model_config (ConfigDict) and call model_validate(orm_obj) to create models from ORM instances.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational