Skip to content
Back to skills

Languages

ASecurity

Python development skill - Modern Python 3.11+, type hints, async, data processing

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
developmentpythontestingapiperformance

Works with

  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 10 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add pluginagentmarketplace/custom-plugin-linux --skill languages --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Languages?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Languages
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pluginagentmarketplace-languages-aae77515/badge)](https://www.skillsdirectory.com/skills/pluginagentmarketplace-languages-aae77515)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python
description: Python development skill - Modern Python 3.11+, type hints, async, data processing
version: "1.0.0"
sasmp_version: "1.3.0"

input_schema:
  type: object
  properties:
    task: { type: string, enum: [code, debug, explain, optimize, review] }
    context: { type: string }
    code_snippet: { type: string }
  required: [task]

output_schema:
  type: object
  properties:
    solution: { type: string }
    explanation: { type: string }
    best_practices: { type: array }

retry_config:
  max_attempts: 3
  backoff: exponential
  initial_delay_ms: 1000

timeout_ms: 30000
---

# Python Skill

## PURPOSE
Atomic skill for Python development with modern best practices.

## CORE COMPETENCIES
```
Python 3.11+ Features:
├── Type hints (typing module)
├── dataclasses
├── Pattern matching (match/case)
├── Exception groups
└── Performance improvements

Async Python:
├── asyncio
├── async/await
├── aiohttp, httpx
├── Concurrent.futures
└── Event loops

Data Processing:
├── Pandas, Polars
├── NumPy
├── List comprehensions
├── Generators
└── Context managers
```

## CODE PATTERNS

### Type-Safe Function
```python
from typing import TypeVar, Callable, Optional
from functools import wraps
import logging

T = TypeVar('T')

def with_retry(
    max_attempts: int = 3,
    delay: float = 1.0,
    backoff: float = 2.0
) -> Callable[[Callable[..., T]], Callable[..., T]]:
    def decorator(func: Callable[..., T]) -> Callable[..., T]:
        @wraps(func)
        def wrapper(*args, **kwargs) -> T:
            last_exception: Optional[Exception] = None
            current_delay = delay

            for attempt in range(max_attempts):
                try:
                    return func(*args, **kwargs)
                except Exception as e:
                    last_exception = e
                    logging.warning(f"Attempt {attempt + 1} failed: {e}")
                    if attempt < max_attempts - 1:
                        time.sleep(current_delay)
                        current_delay *= backoff

            raise last_exception
        return wrapper
    return decorator
```

### Dataclass Pattern
```python
from dataclasses import dataclass, field
from typing import List, Optional
from datetime import datetime

@dataclass
class APIResponse:
    data: dict
    status_code: int
    timestamp: datetime = field(default_factory=datetime.now)
    errors: List[str] = field(default_factory=list)

    @property
    def is_success(self) -> bool:
        return 200 <= self.status_code < 300
```

## TROUBLESHOOTING

| Issue | Cause | Solution |
|-------|-------|----------|
| ImportError | Missing package | `pip install package` or check venv |
| IndentationError | Mixed tabs/spaces | Use consistent indentation |
| MemoryError | Large dataset | Use generators, chunking |
| GIL bottleneck | CPU-bound | Use multiprocessing |

## TESTING TEMPLATE
```python
import pytest
from unittest.mock import Mock, patch

class TestFunction:
    def test_normal_input(self):
        result = function("input")
        assert result == "expected"

    def test_invalid_input(self):
        with pytest.raises(ValueError):
            function(None)

    @pytest.mark.asyncio
    async def test_async_operation(self):
        result = await async_function()
        assert result is not None

    @patch('module.external_call')
    def test_with_mock(self, mock_call):
        mock_call.return_value = "mocked"
        result = function_using_external()
        assert result == "mocked"
```

## OBSERVABILITY
```python
import logging
import functools
import time

def log_execution(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        logger = logging.getLogger(func.__module__)
        logger.info(f"Calling {func.__name__}")
        start = time.perf_counter()
        try:
            result = func(*args, **kwargs)
            elapsed = time.perf_counter() - start
            logger.info(f"{func.__name__} completed in {elapsed:.3f}s")
            return result
        except Exception as e:
            logger.error(f"{func.__name__} failed: {e}")
            raise
    return wrapper
```

Files in this skill

  • SKILL.md637 B
  • assets/config.yaml678 B
  • assets/schema.json1.1 KB
  • java-SKILL.md1.8 KB
  • js-SKILL.md3.1 KB
  • python-SKILL.md4.1 KB
  • references/GUIDE.md1.8 KB
  • references/PATTERNS.md1.5 KB
  • rust-SKILL.md1.8 KB
  • scripts/validate.py3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…