Skip to main content

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


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.6.0.tar.gz (7.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refast-0.6.0-py3-none-any.whl (7.5 MB view details)

Uploaded Python 3

File details

Details for the file refast-0.6.0.tar.gz.

File metadata

  • Download URL: refast-0.6.0.tar.gz
  • Upload date:
  • Size: 7.8 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

Hashes for refast-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b505926f9e62802917f161948621b5b11c420045d42db2e848f4babee2f8a482
MD5 e7bc64ac264a31c0a75e17303c6fc94c
BLAKE2b-256 6b20dc069bc434814096ac26b403c702c8facfd89c7994bd56fce62e0237d4b5

See more details on using hashes here.

File details

Details for the file refast-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: refast-0.6.0-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

Hashes for refast-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 035fccf23ae6b01db82b817f1ed2f9601dffc523a7407b5b58d647ced8fe794a
MD5 51e4dc1aa1d48fc578f73ce8d65bc76f
BLAKE2b-256 e8b707175e3c0b9c5256698270e7199f618b5e4f31d20cbf6644b6ab1a5101e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page