Logo van Python Dev

Python Dev

OrganisatiePopulair
databricks-solutions
python-dev

Python development guidance with code quality standards, error handling, testing practices, and environment management. Use when writing, reviewing, or modifying Python code (.py files) or Jupyter notebooks (.ipynb files).

Overzicht

Uitgeverdatabricks-solutions
Repositoryai-dev-kit
Skillnaampython-dev
Sterren
1.9K
Forks
428
Meegeleverde bestanden
Alleen instructies
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door databricks-solutions op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Python Dev in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/databricks-solutions/ai-dev-kit/tree/main/.claude/skills/python-dev
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/databricks-solutions/ai-dev-kit.git /tmp/ai-dev-kit
mkdir -p .claude/skills
cp -r /tmp/ai-dev-kit/.claude/skills/python-dev .claude/skills/python-dev
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Python Dev in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Python Dev automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Python Dev niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Python Development Rules

Overview

Python development guidance focused on code quality, error handling, testing, and environment management. Apply when working with Python code or Jupyter notebooks.

When to Use This Skill

Use this skill when:

  • Writing new Python code or modifying existing Python files
  • Creating or updating Jupyter notebooks
  • Setting up Python development environments
  • Writing or updating tests
  • Reviewing Python code for quality and best practices

Code Quality

Principles

  • DRY (Don't Repeat Yourself): Avoid code duplication
  • Composition over inheritance: Prefer composition patterns
  • Pure functions when possible: Functions without side effects
  • Simple solutions over clever ones: Prioritize readability and maintainability
  • Design for common use cases first: Solve the primary problem before edge cases

Style & Documentation

  • Type hints required: All functions must include type annotations
  • snake_case naming: Use snake_case for variables, functions, and modules
  • Google-style docstrings: Document functions, classes, and modules using Google-style docstrings
  • Keep functions small: Single responsibility principle - one function, one purpose
  • Preserve existing comments: Maintain and update existing code comments

Example

python
def calculate_total(items: list[dict[str, float]], tax_rate: float = 0.08) -> float:
    """Calculate total cost including tax.
    
    Args:
        items: List of items with 'price' key
        tax_rate: Tax rate as decimal (default 0.08)
        
    Returns:
        Total cost including tax
        
    Raises:
        ValueError: If tax_rate is negative or items list is empty
    """
    if not items:
        raise ValueError("Items list cannot be empty")
    if tax_rate < 0:
        raise ValueError("Tax rate cannot be negative")
    
    subtotal = sum(item['price'] for item in items)
    return subtotal * (1 + tax_rate)

Error Handling & Efficiency

Error Handling

  • Specific exception types: Catch specific exceptions, not bare except
  • Validate inputs early: Check inputs at function entry
  • No bare except: Always specify exception types

Efficiency Patterns

  • f-strings: Use f-strings for string formatting
  • Comprehensions: Prefer list/dict/set comprehensions over loops when appropriate
  • Context managers: Use with statements for resource management

Example

python
def process_file(file_path: str) -> list[str]:
    """Process file and return lines.
    
    Args:
        file_path: Path to file
        
    Returns:
        List of non-empty lines
        
    Raises:
        FileNotFoundError: If file doesn't exist
        PermissionError: If file cannot be read
    """
    if not file_path:
        raise ValueError("File path cannot be empty")
    
    try:
        with open(file_path, 'r', encoding='utf-8') as f:
            return [line.strip() for line in f if line.strip()]
    except FileNotFoundError:
        raise FileNotFoundError(f"File not found: {file_path}")
    except PermissionError:
        raise PermissionError(f"Permission denied: {file_path}")

Testing (Critical)

Framework & Structure

  • pytest only: Use pytest exclusively (no unittest)
  • Test location: All tests in ./tests/ directory
  • Test package: Include __init__.py in tests directory
  • TDD approach: Write/update tests for all new/modified code
  • All tests must pass: Ensure all tests pass before task completion

Test Structure Example

project/
├── src/
│   └── my_module.py
└── tests/
    ├── __init__.py
    └── test_my_module.py

Example Test

python
# tests/test_calculations.py
import pytest
from src.calculations import calculate_total

def test_calculate_total_basic():
    """Test basic total calculation."""
    items = [{'price': 10.0}, {'price': 20.0}]
    result = calculate_total(items, tax_rate=0.1)
    assert result == 33.0

def test_calculate_total_empty_list():
    """Test error handling for empty list."""
    with pytest.raises(ValueError, match="Items list cannot be empty"):
        calculate_total([])

def test_calculate_total_negative_tax():
    """Test error handling for negative tax rate."""
    items = [{'price': 10.0}]
    with pytest.raises(ValueError, match="Tax rate cannot be negative"):
        calculate_total(items, tax_rate=-0.1)

Environment Management

Dependency Management

  • Use uv exclusively: All packaging, environment, and script execution via uv
  • No pip/venv/conda: Do not use pip, python3 -m venv, or conda — uv handles all of this
  • pyproject.toml is the source of truth: Define all dependencies in pyproject.toml (not requirements.txt)

Environment Setup Example

bash
# Install dependencies from pyproject.toml
uv sync

# Install with optional dev dependencies
uv sync --extra dev

# Run a script (no activation needed)
uv run python script.py

# Run pytest
uv run pytest

# Add a new dependency
uv add requests

# Remove a dependency
uv remove requests

Running Python Code

  • Use uv run to execute scripts — no manual venv activation needed
  • Use uv run <tool> for dev tools (pytest, ruff, etc.)
  • Dependencies are defined in pyproject.toml (not requirements.txt)

Linting & Formatting (Ruff)

  • Ruff: Use Ruff for linting AND formatting (replaces flake8, black, isort)
bash
# Lint code
uv run ruff check .

# Lint and auto-fix
uv run ruff check --fix .

# Format code
uv run ruff format .

# Check formatting without changes
uv run ruff format --check .

Type Checking (Pyright)

bash
# Check types
uv run pyright

Note: Use pyright for type checking — do not use mypy.

Best Practices Summary

  1. Code Quality: DRY, composition, pure functions, simple solutions
  2. Style: Type hints, snake_case, Google docstrings, small functions
  3. Errors: Specific exceptions, early validation, no bare except
  4. Efficiency: f-strings, comprehensions, context managers
  5. Testing: pytest only, TDD, tests in ./tests/, all must pass
  6. Environment: Use uv exclusively for dependencies and execution, Ruff for linting/formatting, Pyright for type checking

Veelgestelde vragen

Wat doet de AI-skill Python Dev?

Python development guidance with code quality standards, error handling, testing practices, and environment management. Use when writing, reviewing, or modifying Python code (.py files) or Jupyter notebooks (.ipynb files).

Waarom Python Dev gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Python Dev bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Python Dev in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/databricks-solutions/ai-dev-kit/tree/main/.claude/skills/python-dev. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Python Dev gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Python Dev gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Python Dev ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Python Dev gratis?

Deze skill is door databricks-solutions op GitHub gepubliceerd. Bekijk de repository voor de licentievoorwaarden. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇