Python Workers are now generally available
Article URL: https://blog.cloudflare.com/python-workers-ga/ Comments URL: https://news.ycombinator.com/item?id=49787142 Points: 260 # Comments: 40
Python Workers, a feature allowing developers to run Python applications in the Cloudflare Workers runtime, have reached general availability (GA). This means Python is now a fully supported language on the Cloudflare Developer Platform, alongside TypeScript. Python Workers can be used to create applications that seamlessly connect to various Cloudflare services, including AI, R2, D1, Hyperdrive, Durable Objects, Queues, Workflows, and more.
Developers can now run popular Python frameworks like FastAPI, Django, and Flask within Python Workers. This is achieved through built-in connectors that allow the application to work with Cloudflare features without the need for explicit JavaScript code. For instance, developers can use FastAPI to build an API server in Python Workers with just a few lines of code.
The introduction of Python Workers was made possible by Cloudflare's support for WebAssembly since 2018. Pyodide was utilized to quickly support a wide range of Python applications in Cloudflare Workers. With Python Workers now GA, developers can build infinitely scalable Python apps, and the process is as easy and performant as developing Python apps elsewhere.
Python Workers now natively support Cloudflare Developer Platform bindings, eliminating the need for explicit conversion of Python objects into TypeScript objects. This eliminates common errors and makes it easier for Python developers to work with Cloudflare bindings.
Additionally, Python Workers can now integrate with Hyperdrive, allowing developers to use relational databases like PostgreSQL or MySQL within their Python apps. This is made possible by implementing socket system calls using the Workers connect API, enabling database drivers to establish connections without relying on POSIX networking syscalls, which are not available in WebAssembly sandbox.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- Python Workers are now generally available blog.cloudflare.com