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-examples
cd hello
npx wrangler@latest dev
b
key to open a browser tab, and make a request to your WorkerYou 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.
Need to deploy your Worker to Cloudflare? Python Workers are in open beta and have a few limitations.
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 Workerspython_workers
compatibility flag to your Worker, while Python Workers are in open beta.We’d love your feedback. Join the #python-workers channel
in the Cloudflare Developers Discord and let us know what you’d like to see next.
The Apache 2.0 license.