mcpField
P
python-coder

python-coder

github.com/majesticlabs-devDevelopment5052 installsUpdated 7w ago
Repository

About python-coder

python-coder is a skill for developers working with Python 3.12 and later. It provides guidance on modern tooling, language patterns, typing, and code-quality practices.

Key features

  1. 01uv package management examples
  2. 02ruff formatting and linting guidance
  3. 03pyright and mypy type-checking settings
  4. 04Modern pattern matching and async examples
  5. 05Testing and error-handling standards

Use cases

  1. 01Starting a Python 3.12 project with uv
  2. 02Configuring linting and type checking
  3. 03Writing asynchronous Python code
  4. 04Applying typing and testing conventions

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill python-coder

After installing, type/python-coderin Claude Code to confirm it loaded.

Details

From the project README

Python-Coder

Modern Python 3.12+ development patterns.

Related Skills (Use for Specific Needs)

SkillUse When
fastapi-coderBuilding FastAPI services
django-coderDjango web applications
pytest-coderWriting comprehensive tests
python-debuggerDebugging 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

Comments

Markdown supported