A reactive web framework for Python built on PyScript

Hello everyone. I hope I’m announcing this in the right place. If anyone is interested in a “pure Python” frontend framework for the web, I took PyScript and built a reactive framework on top of it called PuePy. It’s inspired by Vue.js, where you make pages and components with reactive data that causes the page to update as needed. Eg,

class CounterPage(Page):
    def initial(self):
        return {"current_value": 0}

    def populate(self):
        with t.div(classes="inc-box"):
            t.button("-", on_click=self.on_decr)
            t.span(str(self.state["current_value"]))
            t.button("+", on_click=self.on_incr)

    def on_decr(self, event):
        self.state["current_value"] -= 1

    def on_incr(self, event):
        self.state["current_value"] += 1

That creates a page with a counter and two buttons (that’s the example on puepy.dev).

I’ve put a fair amount of work into it, and am now trying to get any feedback on what I’ve done, so if it piques your interest, give it a try and let me know.

Cheers!

-Ken

5 Likes