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.6.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for puepy-0.4.6.tar.gz
Algorithm Hash digest
SHA256 e11f1795d98fcd5545b338c8b0943bfaf01934a6de7c070de50007898c770a2a
MD5 16951dcb1ed96ef64c995a63f4256f0c
BLAKE2b-256 69349db87c5764194ba520818e98dc0d4c2f7194b230108394270770245f4088

See more details on using hashes here.

File details

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

File metadata

  • Download URL: puepy-0.4.6-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.7

File hashes

Hashes for puepy-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0a1c8d2df1cfeaf94608a503aabbdb16c2942d59dbaf82e6c6dcf4df9a5f4e
MD5 747148461f1bf427b2c59a110bd15a19
BLAKE2b-256 e189e468fd11ac60a1f3de84d523ba776d76aabb9adb708974ce2c33730317a8

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