gitmyhub

Robyn

Python ★ 7.3k updated 12h ago

Robyn is a Super Fast Async Python Web Framework with a Rust runtime.

A fast Python web framework powered by a Rust runtime that lets you build web APIs and servers with Flask-like decorator syntax but significantly more throughput.

PythonRustWebSocketsJinja2PydanticOpenAPIsetup: easycomplexity 3/5

Robyn is a Python web framework built for speed. Its performance comes from running on a Rust runtime underneath, which allows it to handle many requests at once without slowing down. The framework targets developers who want to build web APIs or servers in Python but need more throughput than the standard Python options provide. According to the README, it has ranked highly on the TechEmpower benchmarks, an industry benchmark suite that compares web framework speeds across different languages.

The basic usage is simple: you write a Python file, import Robyn, define your URL routes using decorators (the same pattern used in Flask and FastAPI), and start the server. A minimal working server takes about six lines of code. Robyn supports both synchronous and asynchronous route handlers, so you can write either style depending on your preferences.

The feature set is broad for a framework of its age. It supports WebSockets, middleware hooks that run before and after each request, built-in form data handling, hot reloading during development, automatic OpenAPI documentation generation, Jinja2 templating for HTML pages, static file serving, CORS configuration, streaming responses, and dependency injection. There is also experimental support for io-uring, a Linux feature for faster file and network operations. More recently, the project added built-in support for AI agent routing and the Model Context Protocol, which lets the server connect to AI applications.

Installing Robyn requires Python 3.10 or newer and a single pip command. An optional extended install adds Pydantic validation and Jinja2 templating. The framework comes with a command-line tool that includes a project scaffolding command, a dev mode that restarts the server on file changes, and a flag to open the browser automatically on startup.

The project is open source under the BSD 2.0 license and describes itself as community-first. Documentation lives at robyn.tech, and there is an active Discord server for questions and contributions.

Where it fits