Webei UI Kit (Python)
webei is a revolutionary UI kit that allows you to design and build beautiful, modern web frontends entirely within Python. Forget about switching between HTML, CSS, and JavaScript. Describe your UI with simple, human-readable Python code, and webei will generate the necessary HTML and scoped CSS for you.
This new version focuses on ultimate flexibility and a magical, DSL-like experience.
Features
- Python-Native: Design UIs using Python objects and functions. No HTML/CSS required.
- Ultimate Flexibility: Style any standard HTML element with any CSS property, directly from Python.
- Human-Readable: Use intuitive arguments like
font_size="2rem"orshadow="large". - Component-Based: Comes with helpful pre-styled components like
CardandButton, or build your own fromdivs. - Scoped Styles: The engine automatically generates scoped CSS, so you don't have to worry about class name conflicts.
- Magic Activation: A simple
act()call injects all the necessary tools into your environment.
Installation
(This package is not on PyPI yet. To install locally for development:)
# Run this from the webei/pip directory
pip install -e .
How to Use
The new webei is incredibly simple.
-
Activate Webei: Call
act()at the top of your script. This magically makes all the component functions (p,c,div,h1, etc.) available. -
Build Your UI: Compose your UI by calling and nesting component functions. A
p()(Page) component is usually your root. -
Render: Call the
.render()method on your root component to generate the final HTML document.
Here's a minimal example with Flask:
from flask import Flask
from webei import act
# 1. Activate the Webei magic!
act()
app = Flask(__name__)
@app.route('/')
def home():
# 2. Build the UI entirely in Python
my_ui = p( # p is an alias for Page
div(
h1("Hello from Webei!", text_align="center"),
c( # c is an alias for Card
para("This is a card component."),
shadow="large",
margin_top="20px"
),
padding="2rem"
)
)
# 3. Render the UI to an HTML string
return my_ui.render()
if __name__ == '__main__':
app.run(debug=True)
Available Components & Tags
After calling act(), you have access to:
- High-Level Components:
Page,Card,Button,Text. - Aliases:
p(forPage),c(forCard). - Standard HTML Tags:
div,h1-h6,a,img,span,section,header,footer,nav,ul,li,form,input,textarea, and more.pis aliased toparato avoid conflict with thePagealias.
Styling
Style any element by passing keyword arguments. webei automatically converts them to CSS.
div(
"I'm a styled div!",
background_color="#eef",
border_left="5px solid #aae",
padding="20px",
font_family="monospace"
)
Metadata
Release files for webei 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| webei-0.2.0.tar.gz | 4.8 kB | Without provenance | Details for webei-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| webei-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for webei-0.2.0-py3-none-any.whl |
Total release size: 9.5 kB
Release files / webei-0.2.0.tar.gz
| Download URL | webei-0.2.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe7f0ec239971eb98775075d397f484c4f16b496062a3788a0f5360395766de8
|
|
BLAKE2b-256 checksum How to use checksums |
9f145b5c726afd9a766ca0d47181632646092d15451f0db9e9d6a9e7ce2ec52e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / webei-0.2.0-py3-none-any.whl
| Download URL | webei-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab09959ad9c9ca898b8f8655c50fc430bf11194ad944dc776f5e05b1b12bfd2c
|
|
BLAKE2b-256 checksum How to use checksums |
d1d08855a114ae68214a00337b998acd6f141c47cef20573e3bae002d6351c0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for webei 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.