modern web gui using python
Project description
brue
write in python, transpile to js, run in browser
Install
using pip(stable)
pip3 install brue
using git(dev)
pip3 install https://github.com/eseunghwan/brue.git
Cli
create project with cli
brue-cli --init [dest]
// example
brue-cli --init ./test2
[output]
extracting files...
brue project initialized in [dest]
run with server
brue-cli --serve [port]
// example
brue-cli --serve 8080
[output]
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
build project file to standalone .html and .js
brue-cli --build [dest]
// example
brue-cli --build ./build
[output]
copying public files...
copying asset files...
compiling component files...
...
Compiled file [dest]
Component define
component python file
from brue import brueElement
from brue.decorators import defineElement
@defineElement("app-elm")# register element as [name]
class App(brueElement):
def __init__(self):
super().__init__()# must be called
def created(self):# evalute when component created(initialized)
print("created")
def mounted(self):# evalute when componet rendered in html
print("mounted")
def render(self):# define render template as html-string
return """
<div>
<div>
<router-link url="/">Welcome</router-link>
<router-link url="/counter">Counter</router-link>
<router-link url="/datagrid">DataGrid</router-link>
</div>
<router-view />
</div>
"""
repeat(for)
...
state = {
"columns": [ "A", "B", "C", "D" ]
}
...
{repeat(self.state.columns, lambda c: f"<th>{c}</th>")}
...
[expected output]
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
brue-2021.11.15.tar.gz
(5.1 kB
view hashes)
Built Distribution
brue-2021.11.15-py3-none-any.whl
(108.4 kB
view hashes)
Close
Hashes for brue-2021.11.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4618c02696aae304369c05df37867a6042d1bfab0c53ec1d1a3262320f6672e |
|
MD5 | 359be38fb67d008eb28fbc44db2b02c0 |
|
BLAKE2b-256 | 1ec8fd21daded8290240c771a83963b4ed9498dd3c3192e4e5505d802fcd20f4 |