Skip to main content

A Pythonic UI framework using context managers and signals

Project description

PyFuse

A Pythonic UI framework for building interactive web applications entirely in Python.

PyFuse uses Python's context managers to define UI hierarchy (indentation = topology) and a reactive signal system for state management. No JavaScript required.

Prerequisites

  • Python 3.14+ (No-GIL build required)
  • uv package manager

Quick Start

# Clone and setup
git clone https://github.com/pproenca/pyfuse.git
cd pyfuse
make setup

Demo Examples

PyFuse includes four example applications demonstrating different capabilities.

Web Examples

Run any of these in separate terminals:

# Todo App - Signal reactivity and Effect persistence
cd examples/todo && uv run pyfuse dev --web
# Open http://localhost:8000

# Dashboard - Computed values and Flexbox layout
cd examples/dashboard && uv run pyfuse dev --web
# Open http://localhost:8001

# Chat - @rpc decorator for server functions
cd examples/chat && uv run pyfuse dev --web
# Open http://localhost:8002

TUI Example

# Console - Terminal-based system monitor
cd examples/console && uv run pyfuse dev
# Renders directly in terminal (press 'q' to quit)

Web vs TUI Mode

PyFuse supports two rendering modes:

Mode Command Output
TUI (default) pyfuse dev Terminal-based UI
Web pyfuse dev --web Browser at localhost

Core Concepts

Signals (Reactive State)

from pyfuse import Signal

count = Signal(0)
count.value += 1  # Triggers reactive updates

Context Manager UI

from pyfuse.ui import Flex, Box, Text

with Flex(direction="column"):
    with Box(padding=10):
        Text("Hello, PyFuse!")

RPC (Server Functions)

from pyfuse import rpc

@rpc
def save_data(data: dict) -> bool:
    # Runs on server, client gets fetch stub
    db.save(data)
    return True

Architecture

See MANIFEST.md for architectural principles.

Development

make test      # Run tests
make lint      # Run linters
make check     # All pre-commit hooks

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

wtfui-0.1.0a1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

wtfui-0.1.0a1-py3-none-any.whl (127.1 kB view details)

Uploaded Python 3

File details

Details for the file wtfui-0.1.0a1.tar.gz.

File metadata

  • Download URL: wtfui-0.1.0a1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wtfui-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 b5266ac84b9ba913b063f10791c1d4e17fd0dbb093306772acd2516c42842a18
MD5 d298bf7cd52568fb049016981ec1afd7
BLAKE2b-256 8a3ad5803f70018b75087262520bfac598f46c806d8b4aa3d291e6d7afb37019

See more details on using hashes here.

File details

Details for the file wtfui-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: wtfui-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 127.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wtfui-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 c81218a63a4c676b7c8bf2495b85fad228f782421c2609c64f21bc52edd11039
MD5 3a9a2839ebe5da27b59c99b0b54bbf50
BLAKE2b-256 0dcebcb7f85b233382d75865de3f7d9240abcb5e64c111c564dd2a4f74bed3b2

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