Python Workers are now generally available
Cloudflare has made Python Workers generally available, enabling Python applications to run natively on its Workers platform with full support for frameworks like FastAPI, Django, and Flask.
Cloudflare introduced Python Workers two years ago to allow Python applications to run within its Workers runtime, mirroring the simplicity of TypeScript development. The platform now achieves general availability, making Python a fully supported language on Cloudflare’s Developer Platform. Developers can deploy Python code, libraries, and frameworks such as FastAPI, Django, and Flask directly within Workers. The runtime leverages WebAssembly and Pyodide to compile Python applications, ensuring compatibility and performance.
Python Workers now integrate natively with Cloudflare’s Developer Platform bindings, eliminating the need for manual type conversion between Python and JavaScript. Previously, developers had to write glue code to use bindings like Queues or R2, which often led to errors. The updated Python SDK encapsulates these conversions, allowing Pythonic usage of bindings without JavaScript involvement. This change simplifies development and reduces friction for Python developers using Cloudflare’s services.
Developers can now run Python web frameworks like FastAPI, Django, or Flask within Python Workers using the workers.asgi or workers.wsgi packages. These connectors act as lightweight bridges, translating incoming requests into WSGI/ASGI structures and piping responses back efficiently. The Workers platform handles scaling and load balancing, so developers focus on application logic without server configuration. This approach supports any Python web framework adhering to WSGI or ASGI standards.
Python Workers now support Hyperdrive for integrating relational databases like PostgreSQL or MySQL, addressing a prior limitation where TCP sockets were unavailable. The platform implements custom socket system calls to translate Python database driver operations into Workers-compatible JavaScript calls. This enables seamless use of packages like aiomysql or asyncpg without modifications. Additionally, Cloudflare has improved WebAssembly compatibility for Python packages, expanding the range of supported libraries.