Skip to main content

Frontend Framework for PyScript

Project description

PuePy - PyScript Frontend Framework

➡️ Project Website 📝 Project Documentation

PuePy is a lightweight web framework that uses WebAssembly via PyScript to put Python right in your browser with all the modern conveniences of a web framework, but none of the headaches of Webpack, NPM or even JavaScript.

  • Reactive data binding with component-based architecture
  • Single Page App (SPA) router included
  • No build layer: direct execution like other Python projects
  • Choice of full Pyodide or Micropython

🐒 Try a demo app

See ExpenseLemur.com and the Expense Lemur Github Repo for a demonstration of what PuePy is capable of.

🧑‍💻 See some code

from puepy import Page, Application, t

app = Application()


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

    def populate(self):
        with t.div(classes=["container", "mx-auto", "p-4"]):
            t.h1("Welcome to PyScript", classes=["text-xl", "pb-4"])
            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")
            t.button("Continue", classes="btn btn-lg", on_click=self.on_button_click)

    def on_button_click(self, event):
        print("Button clicked")  # This logs to console


app.mount("#app")

Learn

License

PuePy is licensed under the Apache 2 license, for your coding convenience.

Project details


Download files

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

Source Distribution

puepy-0.4.5.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

puepy-0.4.5-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file puepy-0.4.5.tar.gz.

File metadata

  • Download URL: puepy-0.4.5.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for puepy-0.4.5.tar.gz
Algorithm Hash digest
SHA256 df7c673ddb7f08f13dbfc76d5d818a848879fa5b87a6c4486b0a0797e6b444c7
MD5 9c2ad645c1960a7b4b28c1e91c3aefc5
BLAKE2b-256 05e83e1bd80e669652545dc494fb98263d04b96ca7306b95d4876dbc5c331379

See more details on using hashes here.

File details

Details for the file puepy-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: puepy-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for puepy-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 34959c273d0e336765ed6fd06cc149a4a31dab9cc97af11ff6dd198a8b8f39c6
MD5 cc9c6033c8b14f6bc8ca2c0645931821
BLAKE2b-256 142a3378dd6ac8279c77de462749ef0574c4bec130ed1ba0ee1edbbfa96ff02a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page