python-stack

Guides Python project structure, typing, dependency management, testing, and async practices.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/astroville/sprout --skill python-stack-astroville
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-stack
Source: https://github.com/astroville/sprout/tree/main/.claude/skills/python-stack
Command: npx skills add https://github.com/astroville/sprout --skill python-stack-astroville

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Python codebases often drift into inconsistent structure, untyped functions, unpinned dependencies, and fragile tests. This Skill provides a consistent set of engineering conventions so AI-assisted Python development follows sound practices for typing, packaging, testing, async code, and error handling. ## Core Features & Use Cases - Type Safety & Structure: Enforces PEP 484/526/604 type hints, modern union syntax, and clean package layouts with pyproject.toml-based configuration. - Dependency & Testing Standards: Promotes lock files for applications, pytest with fixtures and parametrize, and boundary-focused mocking. - Async & Guardrails: Guides asyncio usage with TaskGroup, and flags classic bugs like mutable default arguments, bare except clauses, and import cycles. - Use Case: When asking an AI to scaffold a new Python service or refactor a module, this Skill ensures the output uses type hints, pathlib, structured logging, and pytest conventions automatically. ## Quick Start Apply the python-stack skill when writing or reviewing Python code so the output follows modern typing, packaging, testing, and async conventions.

Frequently Asked Questions about python-stack

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

FAQPage Schema
How do I structure a Python project with modern tooling?▼

Use a src/ or flat layout with consistent __init__.py usage and configure everything in pyproject.toml instead of setup.py or setup.cfg. Manage environments with venv, uv, or poetry, never installing into system Python.

What is the recommended way to write Python type hints?▼

Follow PEP 484/526/604 and prefer the modern union syntax like str | None over Optional[str] on Python 3.10 and later. Apply type hints consistently across function signatures and structured data.

Should I use pytest or unittest for Python testing?▼

Use pytest as the default test runner with fixtures instead of setup/teardown methods and parametrize for data-driven cases. Mock at boundaries with unittest.mock or pytest-mock, and mirror the source layout in a parallel tests/ directory.

When should I use asyncio instead of threads in Python?▼

Use asyncio for I/O-bound concurrency and reserve threads for blocking library calls via asyncio.to_thread. Coordinate concurrent tasks with asyncio.TaskGroup on 3.11+ or asyncio.gather, and avoid mixing sync and async code.

What are common Python bugs this guidance helps avoid?▼

It flags mutable default arguments, bare except clauses, global mutable state, and import cycles. It also recommends dataclasses or pydantic over raw dicts, pathlib over os.path, and explicit encoding when opening files.