Python + React UI framework for building reactive web applications
Project description
Refast
Python + React UI Framework for Building Reactive Web Applications
Refast is a framework that enables building reactive web applications with Python-first development. It uses FastAPI for the backend and React with shadcn/ui for the frontend.
Features
- Python-First Development: Build your UI logic entirely in Python
- Reactive Components: Real-time updates via WebSocket
- shadcn/ui Integration: Beautiful, accessible components out of the box
- FastAPI Integration: Plug into any existing FastAPI application
- Type Safety: Full type hints and Pydantic validation throughout
Installation
pip install refast
Quick Start
from refast import RefastApp, Context
ui = RefastApp(title="My App")
@ui.page("/")
def home(ctx: Context):
return Container(
Text("Hello, World!"),
Button("Click me", on_click=ctx.callback(handle_click))
)
async def handle_click(ctx: Context):
await ctx.show_toast("Button clicked!")
# Mount to FastAPI
from fastapi import FastAPI
app = FastAPI()
app.include_router(ui.router, prefix="/ui")
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
# Run linting
ruff check src/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
refast-0.7.1.tar.gz
(7.7 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file refast-0.7.1.tar.gz.
File metadata
- Download URL: refast-0.7.1.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2fb0029077650e83e86d7f51f598699652ec71169c7c8a74f75810ee4b3d66a
|
|
| MD5 |
4ad5f0a97bfb2e594cf39cf43adff8bc
|
|
| BLAKE2b-256 |
6cbfc6df2c17c9cedd457f8e331592de41edc1645d429c7af99e13bee40983ab
|
File details
Details for the file refast-0.7.1-py3-none-any.whl.
File metadata
- Download URL: refast-0.7.1-py3-none-any.whl
- Upload date:
- Size: 7.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29edbea305ef8da92f029f4038d164d7e6dcdcd0e7cb3d6c56be99fc9a041490
|
|
| MD5 |
ad5301351c2668127c0642ad22d511dc
|
|
| BLAKE2b-256 |
776f2cdeef203d907106bb835fb9dadfe76b19baca40d78220866bab54bf265c
|