Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkinder/puepy
Python+Webassembly Frontend Framework via PyScript
https://github.com/kkinder/puepy
framework frontend frontend-framework pyscript python reactive webassembly
Last synced: about 1 month ago
JSON representation
Python+Webassembly Frontend Framework via PyScript
- Host: GitHub
- URL: https://github.com/kkinder/puepy
- Owner: kkinder
- License: apache-2.0
- Created: 2023-12-31T16:39:33.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-28T09:56:59.000Z (about 1 month ago)
- Last Synced: 2024-07-28T09:57:02.726Z (about 1 month ago)
- Topics: framework, frontend, frontend-framework, pyscript, python, reactive, webassembly
- Language: Python
- Homepage: https://puepy.dev
- Size: 218 KB
- Stars: 142
- Watchers: 6
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PuePy — PyScript Frontend Framework
➡️ [https://puepy.dev](https://puepy.dev)
PuePy is a lightweight web framework that uses Webassembly via [PyScript](https://pyscript.net) 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](https://pyodide.org/en/stable/) or [Micropython](https://micropython.org/)## 🐒 Try a demo app
See [ExpenseLemur.com](https://expenselemur.com) and the [Expense Lemur Github Rep](https://github.com/kkinder/expenselemur) for a demonstration of what PuePy is capable of.
## 🧑💻 See some code
```python
from puepy import Page, Application, tapp = 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 consoleapp.mount("#app")
```## Learn
- **Project Website**: [puepy.dev](https://puepy.dev/)
- **Documentation**: [docs.puepy.dev](https://docs.puepy.dev/)## License
PuePy is licensed under the Apache 2 license, for your coding convenience.