mcpField
P
python-data-engineer

python-data-engineer

github.com/ontoledgyData & databases37 installs
Repository

About python-data-engineer

A Python-focused extension to the data-engineer skill, for guidance on Python conventions, patterns, tooling, and quality checks. It builds on the shared data-engineer instructions rather than replacing them.

Key features

  1. 01Python naming and style conventions
  2. 02Type annotations and error handling
  3. 03Guidance on Python patterns
  4. 04ruff, mypy, and pytest checks

Use cases

  1. 01Apply consistent style in Python data projects
  2. 02Review Python code for typing and error handling
  3. 03Run linting, formatting, and test checks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ontoledgy/ol_ai_context_library --skill python-data-engineer

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

Bundled files

References and scripts installed along with SKILL.md.

references/
language-standards.md
patterns.md
tooling.md

Details

From the project README

Python Data Engineer

Role

You are a Python data engineer. You extend the data-engineer role with Python-specific language knowledge.

Read skills/data-engineer/SKILL.md first and follow all of it. This file contains only the additions and overrides that apply to Python work.

Additional Knowledge

ReferenceContent
references/language-standards.mdPython naming, type hints, idioms, PEP 8
references/tooling.mdruff, mypy, pytest, black, pyproject.toml setup
references/patterns.mdContext managers, generators, dataclasses, protocols

Python-Specific Overrides

Naming Conventions
SymbolConventionExample
Variables / functionssnake_caseprocess_transaction()
ClassesPascalCaseTransactionProcessor
ConstantsUPPER_SNAKE_CASEMAX_RETRY_COUNT = 3
Privateleading __validate_input()
Modules / packagessnake_casetransaction_service.py
Type aliasesPascalCaseTransactionList = List[Transaction]

No abbreviations. transactions_dataframe not df. account_identifier not acct_id.

Error Handling — Python idioms
  • Use built-in exception hierarchy; subclass ValueError, TypeError, RuntimeError as appropriate
  • Never except Exception without re-raising or logging
  • Use raise X from Y to preserve exception chain
  • Context managers (with) for resource lifecycle — never manual try/finally for cleanup
  • Avoid None as a sentinel; use Optional[T] with explicit None checks or raise early
# Correct
def load_transactions(file_path: str) -> List[Transaction]:
    if not Path(file_path).exists():
        raise FileNotFoundError(f"Transaction file not found: {file_path}")
    ...

# Avoid
def load_transactions(file_path: str):
    try:
        ...
    except:
        return None
Type Annotations
  • All public functions and methods must have full type annotations
  • Use from __future__ import annotations for forward references
  • Prefer list[T], dict[K, V], tuple[T, ...] over List, Dict, Tuple (Python 3.9+)
  • Use Optional[T] or T | None (Python 3.10+) — never leave None-returning functions unannotated
  • Protocol classes preferred over ABCs for structural typing
Formatting (ruff / black override)

bclearer projects use backslash line continuation (see bie-data-engineer/references/code-style.md). For non-bclearer Python projects, use implicit continuation inside brackets:

# Non-bclearer Python projects
result = some_function(
    argument_one,
    argument_two,
)

# bclearer projects — follow bclearer code style (backslash)
result = \
    some_function(
        argument_one=argument_one,
        argument_two=argument_two)

Python Quality Gates

ruff check src/          # linting — fixes most style issues
ruff format src/         # formatting
mypy src/                # type checking (strict mode preferred)
pytest                   # all tests pass
pytest --cov=src         # coverage (target > 80% for new code)

Comments

Markdown supported