moai-lang-python

Implements Python 3.13+ development patterns for FastAPI, Django, Pydantic, SQLAlchemy, and pytest.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/h102-log/pdfrag --skill moai-lang-python-h102-log
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-lang-python
Source: https://github.com/h102-log/pdfrag/tree/main/.claude/skills/moai-lang-python
Command: npx skills add https://github.com/h102-log/pdfrag --skill moai-lang-python-h102-log

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Python developers building modern web APIs and data pipelines need consistent, up-to-date guidance on Python 3.13 features, async patterns, and framework-specific best practices without searching scattered documentation. ## Core Features & Use Cases - Modern Python 3.13 Coverage: JIT compiler (PEP 744), GIL-free threading (PEP 703), pattern matching, and advanced type hints with Protocol, ParamSpec, and TypeVar. - Framework Patterns: Production-ready FastAPI 0.115+ dependency injection, Django 5.2 composite primary keys, Pydantic v2.9 validation, and SQLAlchemy 2.0 async ORM patterns. - Testing & Tooling: pytest async fixtures, parametrized tests, fixture factories, plus poetry and uv package management configurations. - Use Case: When building a FastAPI service with async database access, activate this Skill to get repository pattern implementations, JWT authentication dependencies, and a complete pytest suite with async fixtures. ## Quick Start Ask the assistant to create a FastAPI endpoint with async SQLAlchemy database access and a corresponding pytest test.

Frequently Asked Questions about moai-lang-python

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

FAQPage Schema
How do I set up async database sessions in FastAPI with SQLAlchemy 2.0?▼

Create an async engine with create_async_engine, then build an async_sessionmaker with expire_on_commit set to False. Define a get_db dependency that yields sessions via async context manager, and inject it into endpoints using Depends.

How to write async tests with pytest and FastAPI?▼

Use pytest-asyncio with asyncio_mode set to auto in pyproject.toml. Create an AsyncClient fixture with ASGITransport pointing at your app, override the get_db dependency with a test session, and mark test functions with pytest.mark.asyncio.

What changed in Pydantic v2 migration from v1?▼

The parse_obj method is now model_validate, parse_raw is now model_validate_json, and from_orm requires from_attributes set to True in ConfigDict. Validators use field_validator and model_validator decorators instead of the old validator API.

Does Python 3.13 support running without the GIL?▼

Python 3.13 offers an experimental free-threaded build via PEP 703, available as python3.13t in official installers. It enables true parallel thread execution but is not recommended for production use yet.

Why do I get detached instance errors with SQLAlchemy async sessions?▼

This happens when accessing attributes after commit expires the objects. Set expire_on_commit to False in the sessionmaker configuration, or call await session.refresh on the object after committing.

Should I use poetry or uv for Python package management?▼

Both are supported with pyproject.toml configurations. Poetry provides mature dependency resolution and lock files, while uv offers significantly faster installation speeds and can manage virtual environments with uv venv.