Skip to main content

PyLage

PyPI version Python versions License Tests GitHub

PyLage is a server-driven differential UI framework for Python.

Build interactive web applications using pure Python components, reactive state, routing, styling, themes, events, and live browser synchronization — without writing a separate frontend application.

import pylage as pl

count = pl.state(0)

def increment():
    count.set(count.value + 1)

app = pl.column(
    pl.heading("Hello PyLage"),
    pl.text(count),
    pl.button("Increment", on_click=increment),
)

pl.run(app)

Why PyLage?

PyLage keeps your application logic in Python while delivering a reactive browser UI.

Python Application
        │
        ▼
     PyLage
        │
        ├── Components
        ├── Reactive State
        ├── Layout
        ├── Styling & Themes
        ├── Events
        ├── Routing
        └── Differential UI Updates
                │
                ▼
             Browser

The browser communicates with the Python runtime over WebSocket. Updates are sent as targeted differential patches instead of full page rebuilds.

Features

  • Python-first UI development
  • Server-driven architecture
  • Reactive state management
  • Differential browser updates
  • WebSocket-based live synchronization
  • Component-based composition
  • Layout primitives (row, column, etc.)
  • Event handling
  • Input binding
  • Routing & navigation
  • Styling API + style overrides
  • Light & dark themes
  • Responsive support
  • Interactive Playground
  • CLI support
  • Python 3.10+
  • Comprehensive test suite + browser verification

Installation

Requires Python 3.10+.

pip install pylage

For development and browser testing:

pip install "pylage[test]"

Core runtime dependencies:

  • websockets >= 10.0
  • granian >= 2.7.4
  • msgpack >= 1.0.7

Quickstart

import pylage as pl

app = pl.column(
    pl.heading("Hello PyLage"),
    pl.text("A server-driven UI built entirely in Python."),
    pl.button("Click me"),
)

pl.run(app)

Import everything from the root package:

import pylage as pl

Common public APIs:

pl.column(...)
pl.row(...)
pl.text(...)
pl.heading(...)
pl.button(...)
pl.input(...)
pl.state(...)
pl.style(...)
pl.set_theme(...)
pl.get_current_theme(...)
pl.run(...)

Reactive State

import pylage as pl

count = pl.state(0)

def increment():
    count.set(count.value + 1)

app = pl.column(
    pl.heading("Counter"),
    pl.text(count),
    pl.button("Increment", on_click=increment),
)

pl.run(app)

When state changes, PyLage automatically tracks affected UI and sends only the required differential updates to the browser.

Components & Layout

import pylage as pl

app = pl.column(
    pl.heading("Dashboard"),
    pl.text("Welcome to PyLage"),
    pl.row(
        pl.button("Save"),
        pl.button("Cancel"),
    ),
)

pl.run(app)

Components support nesting, properties, event handlers, reactive values, and recursive layout composition.

Events

import pylage as pl

message = pl.state("Waiting...")

def save():
    message.set("Saved")

app = pl.column(
    pl.text(message),
    pl.button("Save", on_click=save),
)

pl.run(app)

Flow:

Browser Event → WebSocket → Python Handler → State Change → Differential Patch → Browser

Inputs & Binding

import pylage as pl

name = pl.state("")

app = pl.column(
    pl.heading("Profile"),
    pl.input(value=name),
    pl.text(name),
)

pl.run(app)

Routing

PyLage includes built-in routing for multi-view applications with navigation, browser history support, and reactive route state — all within the same server-driven model.

Styling & Themes

import pylage as pl

pl.set_theme("dark")

app = pl.column(
    pl.heading("Styled UI"),
    pl.button(
        "Save",
        style=pl.style(padding="1rem"),
    ),
)

pl.run(app)

Inspect the active theme:

pl.get_current_theme()

Architecture

Python Application
       │
       ▼
Component Tree
       │
       ▼
Reactive Runtime
       │
       ▼
Differential Update
       │
       ▼
WebSocket
       │
       ▼
Browser

Only the necessary changes are transmitted.

Playground

PyLage ships with a public Playground for interactive exploration of components, reactive behavior, and the public API.

CLI

pylage

Development

git clone https://github.com/aanalyst-rachit/pylage.git
cd pylage

python3 -m venv .venv
source .venv/bin/activate

pip install -e ".[test]"

Testing

# Full suite
pytest

# Browser tests
pytest test/browser -q

# Focused
pytest test/reactive -q

Current verification baseline:

  • 1326 tests collected
  • 1325 passed
  • 1 skipped

Additional tooling: Ruff, Playwright, package build verification, dependency auditing.

Documentation

Documentation lives in docs/ and is built with MkDocs:

mkdocs build

Key pages:

  • docs/index.md
  • docs/first_app.md
  • docs/deployment.md

Project Structure

pylage/
├── pylage/
│   ├── ENGINE/
│   ├── UI/
│   ├── __init__.py
│   └── cli.py
├── docs/
├── playground/
├── demo/
├── test/
├── scripts/
├── .github/
├── CHANGELOG.md
├── Dockerfile
├── mkdocs.yml
├── pyproject.toml
├── README.md
└── tracker.md

Deployment

See docs/deployment.md for production server configuration and deployment guidance.

Release Status

  • Current release: PyLage 1.0.3
  • Release status: Public release preparation complete

Release process includes full public API audit, documentation & playground verification, package builds, fresh-install checks, and regression testing.

License

This project is licensed under the Apache License 2.0.

See the LICENSE file for the full license text.

Links

Contributing

Contributions, bug reports, and documentation improvements are welcome.

Before submitting:

pytest
ruff check .
git diff --check

Release files for pylage 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylage 1.0.3
File Size Uploaded
pylage-1.0.3.tar.gz 108.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylage 1.0.3
File Interpreter ABI Platform
pylage-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 267.9 kB

Release files / pylage-1.0.3.tar.gz

Download URL pylage-1.0.3.tar.gz
Size 108.1 kB
Tags Source
SHA-256 checksum
How to use checksums
723e15eca2ad9f6f5d956fb848a832b6cacd66abd8510cd7992693f3371a099d
BLAKE2b-256 checksum
How to use checksums
eab55b814eeecee1ce12f266a9c9692930c345f6449494fdd463605581f6fefb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / pylage-1.0.3-py3-none-any.whl

Download URL pylage-1.0.3-py3-none-any.whl
Size 159.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c396b3937a06ca88de34048f1fc6dea5933bb28c4b2d916d0aef0d315da18df6
BLAKE2b-256 checksum
How to use checksums
d45da5560c0014e49fc40d53feea71d16463f41f4bb29fc0f134f04e25fe9d73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.7

2 release files

1.0.6

2 release files

1.0.4

2 release files

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page