/engineering:python-data-pipelinesfrom engineering
Builds ETL jobs, document intelligence pipelines, OCR, PDF/Excel ingestion, image/media processing, and external-API sync pipelines in Python with idempotency, validation, dead-letter queues, and multi-tenant isolation.
Ships in engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.
| Category | Artifact | Format | Example |
|---|---|---|---|
| Data safety | ETL job spec | Markdown doc covering source contracts, idempotency, DLQ handling, and retention | docs/python/etl-spec-orders.md |
| Operability | Pipeline runbook | Markdown doc per skill-composition-standards/references/runbook-template.md covering schedule, retries, and DLQ inspection | docs/python/etl-runbook.md |
references/ directory for deep detail after reading the core workflow below.Bring data into the SaaS from outside systems and unstructured inputs — APIs, files, images, PDFs — and transform it for downstream use. Every pipeline here is idempotent, validated, and observable.
Prerequisites: Load python-modern-standards and python-saas-integration before this skill.
Skill-specific references:
references/pipeline-architecture.mdreferences/etl-external-apis.mdreferences/ocr-tesseract.mdreferences/pdf-extraction.mdreferences/document-parsing-toolkit.md — full catalogue of PDF + EPUB Python libraries (PyMuPDF, pdfplumber, pypdf, camelot, ocrmypdf, pdf2image, ebooklib, unstructured) plus the poppler / tesseract / ghostscript system dependenciesreferences/image-processing-pillow.mdreferences/scheduling.mdreferences/validation-and-deadletter.mdreferences/multi-tenant-pipelines.mdreferences/observability-pipelines.mdEvery pipeline enforces the same five properties:
idempotency_key.tenant_id; every pipeline step validates it.See references/pipeline-architecture.md.
Source -> Extract -> Validate -> Transform -> Load -> Verify
| ^
v |
Dead-letter <---- validation failures |
|
Reconciliation <---------------------+
Typical pattern — nightly Stripe invoice sync:
from datetime import datetime, UTC
import structlog
from stripe import StripeClient
from sqlalchemy import text
from .checkpoints import load_watermark, save_watermark
log = structlog.get_logger()
def sync_stripe_invoices(tenant_id: int) -> SyncResult:
watermark = load_watermark(tenant_id, "stripe.invoices") or datetime(1970, 1, 1, tzinfo=UTC)
client = StripeClient(api_key=secrets.for_tenant(tenant_id).stripe_api_key)
total, ok, failed = 0, 0, 0
for page in client.invoices.list({"created": {"gte": int(watermark.timestamp())}, "limit": 100}):
for raw in page.data:
total += 1
try:
model = StripeInvoice.model_validate(raw) # Pydantic, strict
upsert_invoice(tenant_id, model) # ON DUPLICATE KEY UPDATE
ok += 1
except ValidationError as e:
send_to_dlq(tenant_id, "stripe.invoices", raw.id, str(e))
failed += 1
save_watermark(tenant_id, "stripe.invoices", datetime.now(UTC))
log.info("stripe_sync_done", tenant_id=tenant_id, total=total, ok=ok, failed=failed)
return SyncResult(total=total, ok=ok, failed=failed)
Key features:
Rate limits, pagination, auth refresh: all in references/etl-external-apis.md.
Tesseract is the default. For machine-printed receipts and invoices it's accurate enough. For handwriting or low-quality scans, consider Google Vision / AWS Textract, but budget the cost.
import pytesseract
from PIL import Image, ImageOps
import cv2
def ocr_receipt(path: Path) -> str:
img = cv2.imread(str(path))
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Adaptive threshold for uneven lighting
proc = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 11, 2)
text = pytesseract.image_to_string(proc, lang="eng", config="--psm 6")
return text
Preprocessing dominates accuracy:
See references/ocr-tesseract.md for multi-language, PSM modes, confidence extraction, and the decision table for when to use a cloud OCR service.
Two tools, different jobs:
import pdfplumber
with pdfplumber.open(path) as pdf:
for page in pdf.pages:
text = page.extract_text()
tables = page.extract_tables(table_settings={"vertical_strategy": "lines"})
Never trust uploaded PDFs — validate MIME type, size, and run through a scanner if doing anything beyond text extraction. See references/pdf-extraction.md. For the full library catalogue (PyMuPDF, pdfplumber, ebooklib, camelot, ocrmypdf, unstructured) plus system dependencies (poppler, tesseract, ghostscript), see references/document-parsing-toolkit.md.
Pillow for most work. For heavy resizing / format conversion, add pillow-simd for a speed bump.
from PIL import Image, ImageOps
def make_thumbnail(src: Path, dst: Path, size: tuple[int, int] = (400, 400)) -> None:
with Image.open(src) as img:
img = ImageOps.exif_transpose(img) # honor rotation EXIF
img.thumbnail(size, Image.LANCZOS)
img = img.convert("RGB")
img.save(dst, "WEBP", quality=85, method=6)
Always strip EXIF on user uploads before serving publicly — GPS coordinates leak. Use Image.open(src); data = list(img.getdata()); new = Image.new(img.mode, img.size); new.putdata(data) or piexif.remove.
Watermarking: render over a corner; scale watermark to image width. See references/image-processing-pillow.md.
Three options:
Rule: use the simplest one that meets the need. Don't adopt Celery for one nightly job.
Always make scheduled jobs:
See references/scheduling.md.
Pydantic at the boundary, always:
class StripeInvoice(BaseModel):
id: str = Field(..., pattern=r"^in_[a-zA-Z0-9]+$")
customer: str
amount_due: int = Field(..., ge=0)
currency: str = Field(..., pattern=r"^[a-z]{3}$")
status: Literal["draft", "open", "paid", "uncollectible", "void"]
created: int
model_config = {"extra": "ignore"} # tolerate new fields from the API
DLQ design:
{tenant_id, pipeline, source_id, payload, error, first_seen, retry_count}.See references/validation-and-deadletter.md.
(tenant_id, integration_name).tenant_id.tenant_id on every line. Never log another tenant's data in a given tenant's job context.See references/multi-tenant-pipelines.md.
Every pipeline run should answer these questions from a dashboard:
Standard metrics (Prometheus):
pipeline_run_total{pipeline, tenant, status}pipeline_records_total{pipeline, tenant, outcome} (outcome = ok | failed | skipped)pipeline_duration_seconds{pipeline, tenant} (histogram)pipeline_lag_seconds{pipeline, tenant} (gauge — how stale is the destination)Alerts:
See references/observability-pipelines.md.
while True: time.sleep(3600) — use a real scheduler.When a consumer must reproduce a past decision, keep source delivery, effective time, and revision identity distinct. Replay immutable input batches as known at the cutoff and reconcile accepted revisions, repeats, unavailable updates, and quarantined rows against a hand ledger. The repair queue example exercises this boundary and an ordered, shared parts catalogue round trip.
python-data-analytics — to analyze the data once loaded.python-document-generation — to produce reports from pipeline outputs.photo-management — for the web/mobile upload side of image pipelines.| Condition | Action |
|---|---|
| Source can resend records | Use stable keys and idempotent upserts |
| Record is malformed but non-blocking | Quarantine it with reason and lineage |
| Schema or tenant identity is ambiguous | Stop before downstream writes |
Read and search are required. Editing, execution, API access, and data mutation require authorisation and least-privilege credentials.
Fallback: without source access or execution, produce the pipeline contract, validation rules, and replay plan; mark throughput and accuracy unverified.
| Artefact | Required? | Purpose |
|---|---|---|
| Source/target contracts, volumes, freshness, quality, and recovery requirements | yes | Design pipeline semantics |
references/data-quality-checks-and-lineage.md (opens in a new tab)references/document-parsing-toolkit.md (opens in a new tab)references/etl-external-apis.md (opens in a new tab)references/image-processing-pillow.md (opens in a new tab)references/multi-tenant-pipelines.md (opens in a new tab)references/observability-pipelines.md (opens in a new tab)references/ocr-tesseract.md (opens in a new tab)references/pdf-extraction.md (opens in a new tab)references/pipeline-architecture.md (opens in a new tab)references/scheduling.md (opens in a new tab)references/validation-and-deadletter.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub peterbamuhigire/chwezi-dev-engine --plugin engineering169 skills in this plugin
/accounting-engineUse when designing or implementing double-entry accounting policy and an embedded ledger engine for invoices, payments, stock, balanced postings, mapped accounts, idempotency, reversals, period locks, audit trails, and financial statements./accounting-finance-controllerUse when coordinating accounting and finance implementation reviews, doctrine routing, control evidence, remediation priorities, and release decisions across a software system./advanced-testing-strategyUse when designing or reviewing test strategy for production systems, APIs, mobile apps, SaaS platforms, ERP workflows, and AI-enabled systems. Covers unit, integration, contract, end-to-end, regression, release-gate, and risk-based testing decisions.Other plugins' skills for the same job