Metadata-Version: 2.3
Name: rio-ui
Version: 0.5.10
Summary: Build modern Websites and Apps just with Python
Project-URL: homepage, https://rio.dev
Project-URL: documentation, https://rio.dev/docs
Author: Paul Pinterits
Author-email: Jakob Pinterits <jakob.pinterits@gmail.com>
License: LGPL-3.0
License-File: LICENSE.txt
Keywords: app,framework,functional,local-app,modern,react,rio,type-safe,typed,typing,user-interface,web,web-app,web-development,web-framework
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: aiofiles~=23.2.1
Requires-Dist: fastapi~=0.110
Requires-Dist: fuzzywuzzy~=0.18.0
Requires-Dist: gitignore-parser~=0.1.9
Requires-Dist: httpx~=0.25.1
Requires-Dist: imy~=0.2.5
Requires-Dist: introspection~=1.7.14
Requires-Dist: isort~=5.13.2
Requires-Dist: keyring~=24.3.0
Requires-Dist: pillow~=10.2.0
Requires-Dist: pytest~=7.3.1
Requires-Dist: python-levenshtein~=0.23.0
Requires-Dist: python-multipart~=0.0.6
Requires-Dist: pytz~=2024.1
Requires-Dist: revel~=0.9.0
Requires-Dist: timer-dict~=1.0.0
Requires-Dist: tomlkit~=0.12.3
Requires-Dist: typing-extensions>=4.5.0
Requires-Dist: unicall~=0.1.5
Requires-Dist: uniserde~=0.3.12
Requires-Dist: uvicorn[standard]~=0.23.2
Requires-Dist: watchfiles~=0.21.0
Requires-Dist: yarl~=1.9.2
Provides-Extra: window
Requires-Dist: cefpython3~=66.1; (sys_platform == 'win32') and extra == 'window'
Requires-Dist: platformdirs~=3.11.0; extra == 'window'
Requires-Dist: pygobject~=3.44.1; (sys_platform == 'linux') and extra == 'window'
Requires-Dist: pywebview~=4.2.2; extra == 'window'
Description-Content-Type: text/markdown

![Rio](https://img.shields.io/badge/Rio-outline.svg?color=%2311e8e3e&link=https%3A%2F%2Frio.dev&style=flat-square&logo=data:image/svg%2bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgd2lkdGg9IjEwMDIuMTA1IgogICBoZWlnaHQ9IjE0OTkuODA1NyIKICAgdmlld0JveD0iMCAwIDI2NS4xNDAyOSAzOTYuODIzNTkiCiAgIHZlcnNpb249IjEuMSIKICAgaWQ9InN2Zzg5NiIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+PGRlZnMKICAgICBpZD0iZGVmczg5MCIgLz48bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGE4OTMiPjxyZGY6UkRGPjxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj48ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD48ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+PC9jYzpXb3JrPjwvcmRmOlJERj48L21ldGFkYXRhPjxnCiAgICAgaWQ9ImxheWVyMSIKICAgICB0cmFu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5OCAtMzkuODc3MTksLTI2Ljc3MTcyIC0zMC4zNzYwNiwtMTUuMDcxMTUgLTYwLjgwMDczLC0zMC4xNDExNyAtOTEuMTQ2NDIsLTQ1LjIxMzA0IDM0LjUwODc5LC0xNy4zNzM3NyA2OS40NTU5NywtMzMuOTI1NjUgMTAzLjY3Mjk4LC01MS44NDY2MyAyMC4xOTUxMywtMTEuMDA2MjggMzUuMzg2NDQsLTM2LjMwMDA1IDI1LjYwMzM4LC01OC45ODA5NCBDIDIyNC43MDYyMyw1OC44NzI1MzQgMTk2LjA1MDY3LDUwLjQ4NjY0MSAxNzMuMTY3MjYsMzguMjM4MTkxIDE1MS4xOTIyNiwyNy4zNDkyOTUgMTI2LjI0NjM5LDE0LjkzOTYzOCAxMDYuMTIxMTcsNC45OTc2Mjc4IDcwLjA0MTcxOSwtMTIuODk5Mjk5IDMzLjk2MjI2OCwtMzAuNzk2MjI1IC0yLjExNzE4MzQsLTQ4LjY5MzE1MiBsIC0zLjM3MjY3NzcsLTEuMjE4NDkyIHoiIC8+PC9nPjwvc3ZnPgo=)
![Version](https://img.shields.io/pypi/v/rio-ui?color=%2311e8e3e&style=flat-square)
![Discord](https://img.shields.io/discord/1213589765484576818?color=%2311e8e3e&label=discord&style=flat-square)
![Python Version](https://img.shields.io/pypi/pyversions/rio-ui?style=flat-square)
![License](https://img.shields.io/pypi/l/rio-ui?color=%2311e8e3e&style=flat-square)
![GitHub Stars](https://img.shields.io/github/stars/rio-labs/rio?style=flat-square)

<!-- https://shields.io/badges -->

<img src="https://github.com/rio-labs/rio/blob/dev/rio/assets/hosted/rio-logos/logo-and-text-horizontal.png?raw=true" alt="Rio Logo" style="width: 16rem" />

🌊 You've arrived at **Rio**, an easy to use framework for creating websites and
apps.

🐍 Rio is based **entirely on Python**. You **won't need a single line of HTML, CSS, or
JavaScript** to create beautiful, modern apps.

[Tutorial](https://rio.dev/get-started) - [Examples](https://rio.dev/examples) - [Discord](https://discord.gg/7ejXaPwhyH) - [Docs](https://rio.dev/docs) - [Source Code](https://github.com/rio-labs/rio)

Rio brings React-style components to Python. Pull from a wealth of built-in
components and combine them to create your own custom components. Then combine
those into entire apps. Best of all, Rio apps can run both locally on your
machine and on the web.

## Features 🧩

-   Modern, **declarative UI** framework
-   **100% Python** - Zero HTML, CSS, or JavaScript required
-   Over **50 Built-in components** for common UI elements, such as `rio.Switch`, `rio.Button`, and `rio.Text`, and many more
-   Integrates with **modern Python tooling**: Thanks to being **entirely Type Safe** editors can give you instant suggestions and highlight problems right away
-   Apps can run **both locally and on the web**
-   **Open Source & Free forever**

## Installation 🛠️

Rio is available on PyPI, so you can install it using pip:

```bash
pip install rio-ui
```

## Getting Started 🎓

Rio comes with a very helpful command line utility to help you out. Create a new project in one short command:

```bash
rio new
```

You can choose from a variety of built-in templates to get you started. Here's a complete example to create a project based on the tic-tac-toe template:

```bash
rio new my-project --type website --template "Tic-Tac-Toe"
cd my-project
rio run
```

You'll have your first app up and running in seconds!

## How it works 🧠

TODO: Minimal example

```python
from typing import *  # type: ignore
import rio
from openai import AsyncOpenAI

client = AsyncOpenAI()


class DallEPage(rio.Component):
    prompt: str = ""
    image_url: str = ""
    is_loading: bool = False

    async def get_image(self) -> None:
        """Get an image by prompt."""

        self.is_loading = True
        await self.force_refresh()

        if self.prompt == "":
            self.image_url = ""
            self.is_loading = False
            return

        try:
            response = await client.images.generate(
                model="dall-e-2",
                prompt=self.prompt,
                size="256x256",
                quality="standard",
                n=1,
            )
            self.image_url = response.data[0].url

        finally:
            self.is_loading = False

    def build(self) -> rio.Component:

        return rio.Rectangle(
            content=rio.Card(
                rio.Column(
                    rio.Text("DALL-E", style="heading1"),
                    rio.TextInput(
                        text=self.bind().prompt,
                        label="Prompt:",
                    ),
                    rio.Button(
                        "Create Image",
                        on_press=self.get_image,
                        is_loading=self.is_loading,
                    ),
                    # Add the image to the page if it exists
                    *(
                        [
                            rio.Image(
                                rio.URL(self.image_url),
                                height=36,
                            )
                        ]
                        if self.image_url
                        else []
                    ),
                    spacing=1,
                    margin=2,
                ),
                width=40,
                align_x=0.5,
                align_y=0.5,
                margin=2,
            ),
            fill=rio.Color.GREY,
        )


# Run the app
app = rio.App(
    pages=[
        rio.Page(
            name="Home",
            page_url="",
            build=DallEPage,
        ),
    ],
)
```

## Status: In Development 🚧

Rio is still in development. We're working hard to bring you the best possible
experience. If you have any feedback, please let us know on [our Discord server](https://discord.gg/7ejXaPwhyH).

## Contributing 🤝

TODO: Write how someone can contribute to the project. :)
