Bridging vuejs and python (e.g., to leverage numpy)
Project description
Vuejs-python brings the concepts of vuejs to Python. You can write your model/data as a Python object and your HTML UI/view with the very convenient vuejs syntax. As soon as part of your model changes, all dependent variables are updated and the HTML UI is automatically refreshed.
The goal is to use not only Python the language but Python the platform (with numpy, system APIs, and other "native" things).
Installation
pip install vuejspython
Tiny Example
# example.py
...
@model
class App:
radius = 5
def computed_area(self):
return pi * self.radius ** 2
vuejspython.start(App())
# example.html
<div id="main">
Fill the radius in the text field: <input v-model.number="radius"/>.
(or with <button @click="radius += 1">+1</button> <br/>
A disk with radius {{ radius }} has an area of {{ area }}.
</div>
<script src="lib/vuejspython.js"></script>
<script>vuejspython.start()</script>
Similar projects?
If you're interested only in using Python the language with Vue.js, you can try brython and the brython vue demo
There are projects that try to help integrating Vue.js with different Python web frameworks. The goal is different: Vuejs-python makes python and vue tightly integrated, in a common, reactive model.
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
Built Distribution
Hashes for vuejspython-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea611b46289d7d9a572d5538eb52fae815505828b0fced44f826cf2b240655f2 |
|
MD5 | 3f0d7a4e7f0fa5fddb3e1159ec58b3b4 |
|
BLAKE2b-256 | ffd9801d1292e94ef29d481f9f5381d84bd5b2311ab4d6f83422f81eadf33c87 |