Skip to main content

PyLage

PyPI version Python versions License Tests GitHub

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

Current release: 1.0.4

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:

  • 1333 tests collected
  • 1332 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.4

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.4
File Size Uploaded
pylage-1.0.4.tar.gz 109.1 kB Details

Built distribution (wheel)

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

Total release size: 269.7 kB

Release files / pylage-1.0.4.tar.gz

Download URL pylage-1.0.4.tar.gz
Size 109.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8fc795f91e87901e134c1a7d5373e0f984570558af56204c4543e1ca650d72a2
BLAKE2b-256 checksum
How to use checksums
47f38bbedcbe21780f04755153775f349314bd1adfd0cf2144e33193a1ac13e3
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.4-py3-none-any.whl

Download URL pylage-1.0.4-py3-none-any.whl
Size 160.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d39bce03b8075af382146cc9ebd848171dca5c3ae70558a944f9904ce2a625e3
BLAKE2b-256 checksum
How to use checksums
e45eb30ca3626160aea30920760ffafcdcc4bac34c63ec903929e8ffa5b525f8
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

This release

1.0.4 This release

2 release files

1.0.3

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