搜索

PythonReactSEOPDF
GitHub Skill

python-coder

Modern Python 3.12+ development with uv, ruff, and production-ready practices. Routes to specialized skills for frameworks and testing.

majesticlabs-dev☆ 20 仓库 Stars3 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Python-Coder

Modern Python 3.12+ development patterns.

Related Skills (Use for Specific Needs)

Skill Use When
fastapi-coder Building FastAPI services
django-coder Django web applications
pytest-coder Writing comprehensive tests
python-debugger Debugging Python code

Modern Tooling Quick Reference

Package Management (uv)
# Project setup
uv init my-project
uv add fastapi pydantic
uv add --dev pytest ruff mypy

# Run commands
uv run python main.py
uv run pytest
Code Quality (ruff)
# pyproject.toml
[tool.ruff]
line-length = 100
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]

[tool.ruff.format]
quote-style = "double"
Type Checking (pyright/mypy)
[tool.pyright]
pythonVersion = "3.12"
typeCheckingMode = "strict"

Python 3.12+ Patterns

Pattern Matching
match command:
    case {"action": "create", "item": item}:
        create(item)
    case {"action": "delete", "id": int(id)}:
        delete(id)
    case _:
        raise ValueError("Unknown command")
Modern Async
async def fetch_all(urls: list[str]) -> list[dict]:
    async with aiohttp.ClientSession() as session:
        tasks = [fetch(session, url) for url in urls]
        return await asyncio.gather(*tasks)
Type Hints
from typing import TypeVar, Protocol

T = TypeVar("T")

class Repository(Protocol[T]):
    def get(self, id: int) -> T | None: ...
    def save(self, entity: T) -> T: ...

Behavioral Standards

  • PEP 8 + ruff formatting
  • Type hints throughout
  • Tests with pytest (>90% coverage target)
  • Prefer stdlib before external deps
  • Comprehensive error handling with custom exceptions

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-02-04
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!