cloudflare-python-workers

Verified·Scanned 2/18/2026

This skill provides templates and documentation to build Python APIs on Cloudflare Workers using pywrangler and WorkerEntrypoint. It includes example shell commands like uv run pywrangler deploy, network calls to https://api.example.com and uses bindings/env names such as MY_KV and DB.

by jezweb·v10a1f16·43.5 KB·321 installs
Scanned from main at 10a1f16 · Transparency log ↗
$ vett add jezweb/claude-skills/cloudflare-python-workers

Cloudflare Python Workers

Status: Beta Package Versions: workers-py@1.7.0, workers-runtime-sdk@0.3.1, wrangler@4.54.0 Last Updated: 2026-01-03

Auto-Trigger Keywords

Claude automatically uses this skill when you mention:

Primary Technologies

  • Python Workers
  • Cloudflare Python
  • pywrangler
  • workers-py
  • Python serverless
  • Python edge computing
  • WorkerEntrypoint
  • Python on Cloudflare

Secondary Keywords

  • pyproject.toml workers
  • uv pywrangler
  • Pyodide
  • Python async workers
  • Python Workflows
  • DAG workflows Python
  • step.do decorator

Error-Based Keywords

  • "python_workers compatibility flag"
  • "WorkerEntrypoint not found"
  • "Package not found in Pyodide"
  • "cannot use blocking call in async context"
  • "on_fetch is not defined"
  • "No module named" (Python Worker context)
  • "python_workflows"

Framework Keywords

  • FastAPI Workers
  • httpx Cloudflare
  • aiohttp Workers
  • Python FFI Cloudflare

What This Skill Does

  • Sets up Python Worker projects with pywrangler CLI
  • Implements WorkerEntrypoint class pattern (current standard)
  • Configures Python Workflows with @step.do decorators
  • Accesses Cloudflare bindings (D1, KV, R2, AI) from Python
  • Uses FFI for JavaScript interop
  • Handles async HTTP with httpx/aiohttp
  • Prevents 8 common Python Worker errors

Known Issues Prevented

IssueErrorPrevention
Legacy handlerson_fetch is not definedUse WorkerEntrypoint class
Sync HTTPblocking call in async contextUse httpx/aiohttp
Native packagesModuleNotFoundErrorPure Python only
Missing flagspython_workers requiredAdd compatibility flag
Workflow I/OState not persistedI/O inside steps
Serializationnot JSON serializableJSON-safe returns
Cold startsHigh latencyLazy imports
Package installInstall failuresCheck Pyodide compat

Token Efficiency

ScenarioWithout SkillWith SkillSavings
Setup Python Worker~12k tokens~4k tokens~67%
Create Workflow~10k tokens~4k tokens~60%
Debug handler error~6k tokens~2k tokens~67%

When to Use This Skill

Use When

  • Building Python APIs on Cloudflare Workers
  • Migrating existing Python code to edge
  • Using Python ML/data libraries (Pyodide-compatible)
  • Creating durable multi-step workflows in Python
  • Need Python-specific patterns for Cloudflare

Don't Use When

  • Building JavaScript/TypeScript Workers (use cloudflare-worker-base)
  • Need lowest possible cold starts (use JavaScript)
  • Require native/compiled packages (not supported)
  • Building Pages sites (use Workers with Static Assets)

Latest Versions (Jan 2026)

PackageVersion
workers-py1.7.0
workers-runtime-sdk0.3.1
wrangler4.54.0
Python3.12+

Official Documentation


Related Skills

  • cloudflare-worker-base - JavaScript Worker foundation
  • cloudflare-workflows - JavaScript Workflows
  • cloudflare-d1 - D1 database patterns
  • fastapi - FastAPI framework patterns