Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
llama-farm avatar

Python Skills

  • 63 installs
  • 835 repo stars
  • Updated June 10, 2026
  • llama-farm/llamafarm

Helps with python tasks.

About

python-skills is a Claude Code skill for python. It helps solo builders move faster with AI-assisted development.

  • python-skills
  • Python
  • AI-coding skill

Python Skills by the numbers

  • 63 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #134 of 290 Python skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/llama-farm/llamafarm --skill python-skills

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs63
repo stars835
Last updatedJune 10, 2026
Repositoryllama-farm/llamafarm

What it does

Helps with python tasks.

Files

SKILL.mdMarkdownGitHub ↗

Python Skills for LlamaFarm

Shared Python best practices and code review checklists for all Python components in the LlamaFarm monorepo.

Applicable Components

ComponentPathPythonKey Dependencies
Serverserver/3.12+FastAPI, Celery, Pydantic, structlog
RAGrag/3.11+LlamaIndex, ChromaDB, Celery
Universal Runtimeruntimes/universal/3.11+PyTorch, transformers, FastAPI
Configconfig/3.11+Pydantic, JSONSchema
Commoncommon/3.10+HuggingFace Hub

Quick Reference

TopicFileKey Points
Patternspatterns.mdDataclasses, Pydantic, comprehensions, imports
Asyncasync.mdasync/await, asyncio, concurrent execution
Typingtyping.mdType hints, generics, protocols, Pydantic
Testingtesting.mdPytest fixtures, mocking, async tests
Errorserror-handling.mdCustom exceptions, logging, context managers
Securitysecurity.mdPath traversal, injection, secrets, deserialization

Code Style

LlamaFarm uses ruff with shared configuration in ruff.toml:

line-length = 88
target-version = "py311"
select = ["E", "F", "I", "B", "UP", "SIM"]

Key rules:

  • E, F: Core pyflakes and pycodestyle
  • I: Import sorting (isort)
  • B: Bugbear (common pitfalls)
  • UP: Upgrade syntax to modern Python
  • SIM: Simplify code patterns

Architecture Patterns

Settings with pydantic-settings

from pydantic_settings import BaseSettings

class Settings(BaseSettings, env_file=".env"):
    LOG_LEVEL: str = "INFO"
    HOST: str = "0.0.0.0"
    PORT: int = 14345

settings = Settings()  # Singleton at module level

Structured Logging with structlog

from core.logging import FastAPIStructLogger  # Server
from core.logging import RAGStructLogger      # RAG
from core.logging import UniversalRuntimeLogger  # Runtime

logger = FastAPIStructLogger(__name__)
logger.info("Operation completed", extra={"count": 10, "duration_ms": 150})

Abstract Base Classes for Extensibility

from abc import ABC, abstractmethod

class Component(ABC):
    def __init__(self, name: str, config: dict[str, Any] | None = None):
        self.name = name or self.__class__.__name__
        self.config = config or {}

    @abstractmethod
    def process(self, documents: list[Document]) -> ProcessingResult:
        pass

Dataclasses for Internal Data

from dataclasses import dataclass, field

@dataclass
class Document:
    content: str
    metadata: dict[str, Any] = field(default_factory=dict)
    id: str = field(default_factory=lambda: str(uuid.uuid4()))

Pydantic Models for API Boundaries

from pydantic import BaseModel, Field, ConfigDict

class EmbeddingRequest(BaseModel):
    model: str
    input: str | list[str]
    encoding_format: Literal["float", "base64"] | None = "float"

    model_config = ConfigDict(str_strip_whitespace=True)

Directory Structure

Each Python component follows this structure:

component/
├── pyproject.toml     # UV-managed dependencies
├── core/              # Core functionality
│   ├── __init__.py
│   ├── settings.py    # Pydantic Settings
│   └── logging.py     # structlog setup
├── services/          # Business logic (server)
├── models/            # ML models (runtime)
├── tasks/             # Celery tasks (rag)
├── utils/             # Utility functions
└── tests/
    ├── conftest.py    # Shared fixtures
    └── test_*.py

Review Checklist Summary

When reviewing Python code in LlamaFarm:

1. Patterns (Medium priority)

  • Modern Python syntax (3.10+ type hints)
  • Dataclass vs Pydantic used appropriately
  • No mutable default arguments

2. Async (High priority)

  • No blocking calls in async functions
  • Proper asyncio.Lock usage
  • Cancellation handled correctly

3. Typing (Medium priority)

  • Complete return type hints
  • Generic types parameterized
  • Pydantic v2 patterns

4. Testing (Medium priority)

  • Fixtures properly scoped
  • Async tests use pytest-asyncio
  • Mocks cleaned up

5. Errors (High priority)

  • Custom exceptions with context
  • Structured logging with extra dict
  • Proper exception chaining

6. Security (Critical priority)

  • Path traversal prevention
  • Input sanitization
  • Safe deserialization

See individual topic files for detailed checklists with grep patterns.

Related skills

Pythonbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.