I made a React-like web framework for Python 👋
I'm Paul, one of the creators of Rio. Over the years I've tried many different established python GUI frameworks, but none of them really satisfied me. So I teamed up with a few like minded developers and spent the last few months to create our own framework. Rio is the result of this effort.
What My Project Does
Rio is a brand new GUI framework that lets you create modern web apps in just a few lines of Python. Our goal is to simplify web and app development, so you can focus on the things you care about, instead of wasting countless hours on frustrating user interface details.
We do this by following the core principles of Python that we all know and love. Python is supposed to be simple and compact - and so is Rio. There is no need to learn any additional languages such as HTML, CSS or JavaScript, because all of the UI, Logic, Components and even layouting is done entirely in Python. There’s not even a distinction between front-end and back-end. Rio handles all of the communication transparently for you.
Key Features
- Full-Stack Web Development: Rio handles front-end and backend for you. In fact, you won't even notice they exist. Create your UI, and Rio will take care of the rest.
- Python Native: Rio apps are written in 100% Python, meaning you don't need to write a single line of CSS or JavaScript.
- Modern Python: We embrace modern Python features, such as type annotations and asynchrony. This keeps your code clean and maintainable, and helps your code editor help you out with code completions and type checking.
- Python Debugger Compatible: Since Rio runs on Python, you can connect directly to the running process with a debugger. This makes it easy to identify and fix bugs in your code.
- Declarative Interface: Rio apps are built using reusable components, inspired by React, Flutter & Vue. They're declaratively combined to create modular and maintainable UIs.
- Batteries included: Over 50 builtin components based on Google's Material Design
Target Audience
Whether you need to build dashboards, CRUD apps, or just want to make a personal website, Rio makes it possible without any web development knowledge. Because Rio was developed from the ground up for Python programmers, it was designed to be concise and readable, just like Python itself.
Comparison
Rio doesn't just serve HTML templates like you might be used to from frameworks like Flask. In Rio you define components as simple dataclasses with a React/Flutter style build method. Rio continuously watches your attributes for changes and updates the UI as necessary.
class MyComponent(rio.Component):
clicks: int = 0
def _on_press(self) -> None:
self.clicks += 1
def build(self) -> rio.Component:
return rio.Column(
rio.Button('Click me', on_press=self._on_press),
rio.Text(f'You clicked the button {self.clicks} time(s)'),
)
app = rio.App(build=MyComponent)
app.run_in_browser()
Notice how there is no need for any explicit HTTP requests. In fact there isn't even a distinction between frontend and backend. Rio handles all communication transparently for you. Unlike ancient libraries like Tkinter, Rio ships with over 50 builtin components in Google's Material Design. Moreover the same exact codebase can be used for both local apps and websites.
We Want Your Feedback!
The first alpha version of Rio is available on PyPi now:
pip install rio-ui
rio new my-project --template tic-tac-toe
cd my-project
rio run
Let us know what you think - any feedback, ideas, or even a helping hand are hugely welcome! Just hop on our Discord server and say hello!
8 comments · 98% upvoted · other discussions
Hi, I’m also part of the rio team and I hope rio can help you with your projects! :)
Currently, our main efforts are directed towards fine-tuning the rio concept, enhancing the overall user experience, and fostering a more conducive environment for community involvement.
Additionally, we're striving to streamline the deployment processes by working towards seamless integration with hosting platforms, enabling users to deploy their Rio applications with just a single click.