Frontage

A Python frontend framework for the browser.

Reactive components, an SPA router and two-way data binding, running on PyScript over WebAssembly. No JavaScript, no Node, no bundler. You write Python and the browser runs it.

from frontage import Application, Page, t

app = Application()


@app.page()
class Hello(Page):
    def initial(self):
        return dict(name="")

    def populate(self):
        with t.div(classes="container"):
            t.h1("Welcome to Frontage")
            if self.state["name"]:
                t.p(f"Hello there, {self.state['name']}")
            else:
                t.p("Why don't you tell me your name?")
            t.input(placeholder="Enter your name", bind="name")


app.mount("#app")

What you get

See it run

The tutorial examples run live on this site, straight from the same files the documentation walks through. Start with Hello, World and end with a full app.

Install

Frontage is a client-side library: installing it means telling PyScript where the wheel is. The documentation walks through a first project.

pip download frontage --no-deps --dest .