Skip to main content

Frontend Framework for PyScript

Project description

PuePy — PyScript Frontend Framework

➡️ https://puepy.dev

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 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 Rep 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"Why 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.3.5.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

puepy-0.3.5-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: puepy-0.3.5.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for puepy-0.3.5.tar.gz
Algorithm Hash digest
SHA256 ce3c482f96b8caafa9d48743501f2f332bc0877411f4c2a9d8e97ffb515acd3d
MD5 5fb7cc6a9b89d232692147d645dea40c
BLAKE2b-256 654eefa8a52e45e3d5561520a2525293313194a226c6630d77127578f1c1d58f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: puepy-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for puepy-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2c58e8a0d2bbec9287f731e45231eb6cc5486c926619a04dfeca3166f899ec70
MD5 dfb9342a3e0c67fbf27d0a60a5546a7d
BLAKE2b-256 e0144b1e363164d5d85859c21eff592f6240f759b559a8c73b6f16690983e024

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