Zenaura #17
metaperl
started this conversation in
Framework Discussion: Specific
Zenaura
#17
Replies: 1 comment
-
https://www.reddit.com/r/Python/comments/1dazvjk/introducing_zenaura_python_framework_for_building/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Zenaura
Zenaura is a Python library built on top Pydide, PyScript, designed to empower Python developers to create light-weight, performant, stateful, component-based Single Page Applications (SPAs). By leveraging a virtual DOM implementation, Zenaura optimizes the performance, reactivity, responsiveness, and interactivity of web applications. This allows developers to build high-performance, dynamic web applications using familiar Python concepts and syntax.
Documentation
Zenaura documentation and API reference
note: hot-reloading is still under-development, it works, however working with cli, zenaura build after every change is better.
Installing zenaura
prerequisits:
This command will install zenaura library, client and server, CLI.
Creating your first zenaura app
In this example we will go over creating your first zenaura application, go over basic concepts as well.
Once you installed the library, the library, it comes with simple CLI tool.
CLI Commands:
First let's initials a basic zenaura application:
This command will auto generate basic zenaura application with the needed files auto generated for you, so you can get up to speed with the library.
Auto generated files from init command:
Building zenaura
This command will build index.html.
Running zenaura
This command will run the development server. Now open browser tab and go to localhost:5000. You will see the following Rendered HTML :
The Python Library For !
Building Modern Web User Interface
Now if we opened components.py, and changed the header text:
The development server have hot reloading feature built-in , it will trigger reloading of the page and we will see the changes live. And changes will be applied.
Rendered HTML :
The Python Library For, Hello world !
Building Modern Web User Interface
Adding new component to the page
Now we will add new component to the page, this component will be simply a header:
in public/components.py:
In public/main.py
Rendered HTML :
The Python Library For, Hello world !
Building Modern Web User Interface
Simple Header !
Adding State to the component
Now we will add state to the component, the state will be simple keyword rendered within the h1 tag.
Note if we took a look at public/presentational.py, we will notice a text node
with_text, or Node(text=text), is very important this is how you should render user text, the compiler will santize and render the text, to prevent known security issues.
Note this is very simple guide to help you start with zenaura library, in The Basics guide we will go over each building block in zenaura library and explain it, in rich details.
Beta Was this translation helpful? Give feedback.
All reactions