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.
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
| Issue | Error | Prevention |
|---|---|---|
| Legacy handlers | on_fetch is not defined | Use WorkerEntrypoint class |
| Sync HTTP | blocking call in async context | Use httpx/aiohttp |
| Native packages | ModuleNotFoundError | Pure Python only |
| Missing flags | python_workers required | Add compatibility flag |
| Workflow I/O | State not persisted | I/O inside steps |
| Serialization | not JSON serializable | JSON-safe returns |
| Cold starts | High latency | Lazy imports |
| Package install | Install failures | Check Pyodide compat |
Token Efficiency
| Scenario | Without Skill | With Skill | Savings |
|---|---|---|---|
| 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)
| Package | Version |
|---|---|
| workers-py | 1.7.0 |
| workers-runtime-sdk | 0.3.1 |
| wrangler | 4.54.0 |
| Python | 3.12+ |
Official Documentation
Related Skills
cloudflare-worker-base- JavaScript Worker foundationcloudflare-workflows- JavaScript Workflowscloudflare-d1- D1 database patternsfastapi- FastAPI framework patterns