Vue.js in python !
Vaste is a python library for building web interfaces. It enables to use the power of the Vue.js framework, from server-side python.
from vaste import (
VasteApp,
component,
)
from vaste.vue.lib.html import button
@component
class MyComponent:
def data(self):
self.count = 0
class methods:
def inc(self):
self.count += 1
def render(self):
return button(
children=[
"Count : ", self.count,
],
onClick=self.inc,
)
app = VasteApp(MyComponent)This library is still in early development, the interface is not stable and can change drastically.
git clone https://github.com/astralien3000/vaste.git
cd vastepython -m pip install -e .An ASGI-compatible webserver is also needed :
python -m pip install uvicornTo run the basic example shown in this README :
python -m uvicorn basic:app --reloadA more complex showcase :
python -m uvicorn main:app --reloadThen http://127.0.0.1:8000 can be visited.
Server-side javascript can also be run :
python example.pyI still don't know what would be the use of this but it is possible ! ^^