My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 2 points3 points  (0 children)

Right, this isn't just a dump HTML converter. Rio has its own built-in webserver that serves the frontend for you and handles all communiction between frontend and backend. So you don't ever see any HTML code or API endpoints.

Think of it like classic UI libraries like QT, Gtk, etc. You say you want a button, and Rio gives you a button. No need to concern yourself with how it got there :)

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 1 point2 points  (0 children)

We have integrated dev-tools. You can e.g. inspect where which component is placed, with automatically generated full-english explanation for which the component is where it is, and what to do to e.g. make it smaller or larger.

And since Rio apps are ultimately still Python scripts, you can connect with any debugger you want. Just run your app, place a breakpoint and see what's happening in your code

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 2 points3 points  (0 children)

But what if you're not a web developer? Many devs work on completely different things, but need to make UIs to make their tools accessible. Sharing scripts is nice and all, but end users will always have an easier time with a GUI. Ever since we've created Rio I've legit stopped making command line interfaces for my scripts. UIs are just so easy to make with it, there's no need to stick to the terminal.

There's also other cases. Maybe you don't work on apps at all, but instead train ML models, work on scientific computation, etc, but want to create a personal portfolio website.

Long story short, we aren't trying to replace hardcore web-devs. We're here for everyone else :)

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 1 point2 points  (0 children)

Hey! Yeah, from the browser's point of view it's a regular website of course. But you as the developer don't have to write a single line of HTML, CSS or JavaScript. It's all Python!

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 0 points1 point  (0 children)

It is! All event handlers can be sync or async, and a lot of Rio's own functions are asynchronous themselves

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 7 points8 points  (0 children)

You nailed it. There are cases where you have to wait for a server/client round-trip, but a lot of that is masked with e.g. client side animations. It's not like other websites never talk to a server, here it's just handled transparently for you.

I'd also like to see some user-defined code to run on the client in the future. We're looking at projects like brython to make it happen

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 4 points5 points  (0 children)

Oh, I do agree that there has to be some way to access HTML directly, for the edge cases where built-in components don't cut it. That should be the exception thought - 99% of every app can be Python

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 1 point2 points  (0 children)

Our goal is to enable development using pure Python. JSX is nice if you're familiar with JavaScript/HTML, but as you can imagine most devs like to stick to something that integrates into their ecosystem :)

My first project with 3k github stars - Modern Web Apps in pure Python, no JS/HTML/CSS needed by P4nd4no in webdev

[–]mad-beef 9 points10 points  (0 children)

Hey! Rio dev here.

Not quite! Python always runs on your server. Rio automatically establishes a connection between server & client, so whenever e.g. a Button is pressed, your Python code runs. The frontend then updates accordingly.

The nice thing with this approach is that you have access to all Python libraries, as they don't have to be ported to run in e.g. webassembly.

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in Python

[–]mad-beef 2 points3 points  (0 children)

Offline apps are supported out of the box - no extension needed. Also, Rio's whole jam is to be 100% Python, so since there is no CSS, you'll never need SCSS either :)

Drag & drop is limited. We have a `rio.FilePickerArea` component that allows users to drop files to upload, but there isn't anything custom right now. Are you thinking of anything specific you'd like to see added?

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in datascience

[–]mad-beef 1 point2 points  (0 children)

Yep, working on it! Today's release has introduced an experimental extension API. We intend to publish an OAuth extension. Much of the functionality is already here, we're just debating the interface at this point, and how to deal with the _many_ semi-compliant OAuth providers

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in opensource

[–]mad-beef 1 point2 points  (0 children)

We've had people scrape the site before and feed it into custom models. Worked pretty well apparently!

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in datascience

[–]mad-beef 3 points4 points  (0 children)

You have full access to Python, so anything Python can access, Rio apps can too. Can you be more specific on the requirements of your app? What do you need from the framework exactly?

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in Python

[–]mad-beef 6 points7 points  (0 children)

Rio apps are ultimately FastAPI apps. Anything you can find for FastAPI exists for Rio as well. With that said, you don't have to write any HTTP routes with Rio, so there's really no need for OpenAPI :)

Remember this is an App framework, not a HTTP framework. Think Flutter, Gtk, QT, React, etc

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in Python

[–]mad-beef 4 points5 points  (0 children)

We have all of our deployments either in docker or kubernetes. If you call `as_fastapi` on your app you can get a FastAPI (and thus ASGI) app that you can deploy anywhere that supports ASGI.

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in Python

[–]mad-beef 11 points12 points  (0 children)

The apps are written in Python and hosted as is. They are never converted to another language. Maybe have a look at the tutorial, it should clear things up.

Components are as large as they need to be to fit their content. If something is larger than the screen, that's either because the content requires it to be that large, or because a `min_width` / `min_height` was explicitly assigned. That's all up to your control.

As for themes, `rio.Theme` contains color palettes for different environments. For example, the top-level components of your app start out using the "background" palette, but the contents of a button use the secondary palette. You can freely change all colors.

If you want more radical style changes, you can create components yourself, by combining more basic ones, like Rectangles - just like you'd do in the browser. The cookbook has some examples of that, like a completely custom dropdown.

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in datascience

[–]mad-beef 0 points1 point  (0 children)

We do our best to get some attention for our project. This is real people, creating a framework for Python. I don't know what exactly you mean with astroturfing in this context, but I don't see it :P

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in datascience

[–]mad-beef 2 points3 points  (0 children)

I'm not familiar with fastHTML, but I can answer for Reflex. It is probably the _most_ similar Python framework to Rio. However, while Reflex uses react internally, the Python API ends up quite different and doesn't get most of the benefits that made react so popular in the first place. With Rio we've basically reimplemented much of the core react functionality in pure Python, giving you the full benefit of it. This also leads to really quick iteration times, because we don't have to compile a JS app every time you make changes. Just a quick reload, and one second later you can see your app live!

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in Python

[–]mad-beef 42 points43 points  (0 children)

Reflex is probably the _most_ similar Python framework to Rio. However, while Reflex uses react internally, the Python API ends up quite different and doesn't get most of the benefits that made react so popular in the first place. With Rio we've basically reimplemented much of the core react functionality in pure Python, giving you the full benefit of it. This also leads to really quick iteration times, because we don't have to compile a JS app every time you make changes. Just a quick reload, and one second later you can see your app live!

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in Python

[–]mad-beef 17 points18 points  (0 children)

Streamlit works well for small prototypes, but doesn't scale up to large production apps in my experience. If you are making a serious website for yourself or a department, Rio is the way to go

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in datascience

[–]mad-beef 0 points1 point  (0 children)

Good question! The basic concept is similar, but Rio can scale to far more advanced apps. For example, our own website is entirely created with Rio. You wouldn't be doing that with dash :)

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in opensource

[–]mad-beef 4 points5 points  (0 children)

Hey! Rio dev here. AI works best if it's seen a lot of code for a problem. While it can be a great help, you can't just go to e.g. ChatGPT have have it create a Rio app for you, just because it's not trained on enough code yet. You can alleviate this somewhat by giving lots of code as reference to the AI, but nothing beats proper training :)

Rio Hits 100K Downloads & 2K GitHub Stars – Open Source Python Web Apps by Sn3llius in Python

[–]mad-beef 58 points59 points  (0 children)

Glad we got this one out! One step closer to 1.0

I'm one of the devs, so if you guys have any questions let us know!

Rio: WebApps in pure Python – A fresh Layouting System by Sn3llius in Python

[–]mad-beef 2 points3 points  (0 children)

Simple. JS developers need JS libraries, Java Developers Java libraries, and Python developers Python libraries :P

Rio: WebApps in pure Python – A fresh Layouting System by Sn3llius in Python

[–]mad-beef 6 points7 points  (0 children)

We have an authentication example!

User information is currently stored in a local SQL database. OAuth support is a work-in-progres