This is a collection of examples for writing Cloudflare Workers in Python. Use these examples to learn how Python Workers work.
git clone https://github.com/cloudflare/python-workers-examplescd hellonpx wrangler@latest dev- Press the
bkey to open a browser tab, and make a request to your Worker npx wrangler@latest deployto deploy your Worker to Cloudflare
You can run npx wrangler@latest dev in any example project directory to run a local development server using Wrangler, the CLI for Cloudflare Workers. This local development server is powered by workerd, the open-source Workers runtime.
01-hello/— the most basic Python Worker02-binding/— shows how bindings work in Python Workers. Put a key into Workers KV, and then read it.03-fastapi/— demonstrates how to use the FastAPI package with Python Workers04-langchain/— demonstrates how to use the LangChain package with Python Workers
The Apache 2.0 license.