Skip to main content

Frontage

frontage.optersoft.com · documentation · PyPI

A fine-grained reactive UI framework for Python in the browser. Signals, memos and effects; templates that clone once and bind only their holes; a keyed For; a nested router; running on PyScript over WebAssembly, on Pyodide or MicroPython. No JavaScript, no Node, no bundler: you write Python and the browser runs it.

Status: pre-alpha, being rewritten. main holds milestone M0 of the plan in DESIGN.md: the runtime bridge, the renderer seam and a static view builder. Reactivity, the DOM renderer and templates follow. The previous code, a fork of PuePy, lives on the puepy-reference branch and still works if you need something today.

from frontage import Signal, html

def counter(initial=0):
    count = Signal(initial)
    return html(t"""
        <div class="counter">
            <button on:click={lambda e: count.update(lambda n: n - 1)}>-</button>
            <span>Value: {count}!</span>
            <button on:click={lambda e: count.update(lambda n: n + 1)}>+</button>
        </div>
    """)

That is the target syntax (M2). What runs today:

from frontage import h, render_to_string

with h.ul(cls="menu") as menu:
    for label in ("Home", "About"):
        h.li(label)

print(render_to_string(menu))  # <ul class="menu"><li>Home</li><li>About</li></ul>

Why

Python in the browser exists (PyScript, Pyodide, MicroPython) and the frameworks that use it either carry a server into the browser (Streamlit's stlite, Shiny's Shinylive: tens of seconds to start) or rebuild and diff the page on every change. Frontage is browser-first: no session, no transport, no DSL, and a state change touches only the DOM nodes that read it. The whole reasoning, with the frameworks it learned from, is in DESIGN.md; the behaviours it must have, one line each, are in SPEC.md.

Develop

The repo uses uv and mkrun (mk).

mk sync                 # .venv with every dependency group
mk check                # lint, types, unit tests: the gate
mk pyscript.fetch       # PyScript's offline bundle (core + both interpreters) into tools/pyscript/
mk serve                # the examples at http://127.0.0.1:8000/examples/, package read live
mk test --browser       # the examples in Chromium, under MicroPython and Pyodide
mk site.deploy          # publish frontage.optersoft.com (Cloudflare Pages)

Without mk: uv sync --all-groups, uv run pytest, uv run ruff check, uv run ty check.

Contributing

Contributions are welcome and are accepted under the Apache License 2.0, the same terms the project is published under. By opening a pull request you agree that your contribution may be distributed under that license, including its patent grant (section 3). There is no separate contributor agreement. The rewrite is clean-room: code is written from SPEC.md, not from any reference framework's source, and a pull request says so.

License

Apache License 2.0, copyright Optersoft, S.L. See LICENSE and NOTICE.

Frontage and the Frontage logo are trademarks of Optersoft, S.L. The license grants no rights to the name or the logo (Apache License section 6). You may say that your work uses or is built with Frontage; a fork or a derivative must ship under another name.

Frontage's reactive model follows Solid and Leptos; the project began as a fork of PuePy.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frontage-0.0.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

frontage-0.0.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file frontage-0.0.1.tar.gz.

File metadata

  • Download URL: frontage-0.0.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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 frontage-0.0.1.tar.gz
Algorithm Hash digest
SHA256 518572a2a450a8ad453e1c34e96971a22a72d69917ded38edac2348cf1d43d12
MD5 b50ff211998fc05d82737b076093c038
BLAKE2b-256 6c3fcf1e823abf49aead3cc43d88386972d459922584875236ef55113eb94b76

See more details on using hashes here.

File details

Details for the file frontage-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: frontage-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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 frontage-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cee6a87b9a4450490cbf640647b8be60cc6f7cdea543dd924a03c7d980feea90
MD5 c2c8538a8223ca35ad9fd8258655462d
BLAKE2b-256 36a25c85ba66d14bc4e46fce121725ff543a647fb5a8dc8a0343d81ae792aafe

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

This release

0.0.1 This release

2 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