Skip to main content

wZony

Quickly Build WebUI with Python

Installation

Via Pip

pip install wZony

Quick Start

Rapid Construction with HBulider

from wzony import *
from wzony.HNodes import *
from wzony.HBulider import *

page=Page(
          HTMLSet([
            NavigationBar("Demo",[A("1",href="#1"),A("2",href="#2"),A("1",href="#3")]),
            VStack(HTMLSet([
                 VStack(HTMLSet([
                     Span("Hello World!")
                         .text_align('left'),
                 ]))
            ]))
          ])
)

HTML-Only Construction

from wzony import *
from wzony.HNodes import *

page=Html(HTMLSet([
        Head(HTMLSet([
        	Meta(charset='utf-8'),
          Link(href="./css.css",rel="stylesheet"),
        ])),
        Body(HTMLSet([
            Div(String("1234").wrapped(Sup())),
            H1("Hello"),
            Thead(HTMLSet([
                String("1234"),
                String("1234"),
            ]))
                .style("color:red;")

       ]))
]))

Save as HTML

with open('./demo.html','w') as html:
    html.write(str(page))

Integration with Django

from django.http import HttpResponse
from wzony import *
from wzony.HNodes import *
from wzony.HBulider import *

page=Page(
          HTMLSet([
#            ...
          ])
)

def demoPage(request):
    return HttpResponse(page)

Examples

Student Roster

Demo

from wzony import *
from wzony.HNodes import *
from wzony.HBulider import *

class Person:
    def __init__(self,name,age,gender,photo='./image.jpg'):
        self.name=name
        self.age=age
        self.gender=gender
        self.photo=photo

students=[Person("Tom",18,'Male'),Person("Alice",19,'Female'),Person("Ken",20,'Male')]

page=Page(HTMLSet([
    NavigationBar("Students",[A("Roster",href="#").color('gray').text_decoration('none')]),
    VStack(HTMLSet([
        ForEach(students,lambda student: HTMLSet([
            HStack(HTMLSet([
                Img(student.photo)
                    .width('60px')
                    .border_radius('500px'),
                VStack(HTMLSet([
                    Span(f"Name: {student.name}"),
                    Span(f"Age: {student.age}"),
                    Span(f"Gender: {student.gender}")
                ]))      
            ]))
                .width('100%')
                .text_align('left')
                .border_bottom('rgb(218, 218, 218) 1px solid')
                .font_size('25px')
                .padding_left('50px')
                .justify_content('start'),
        ]))
    ])), 
]),head=HTMLSet([
    Title("Students")
]))

Release files for wZony 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wZony 0.2.0
File Size Uploaded
wzony-0.2.0.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wZony 0.2.0
File Interpreter ABI Platform
wzony-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / wzony-0.2.0.tar.gz

Download URL wzony-0.2.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f1dd6be8d9821a76f5e5e8c53a2e65b1c888a0618b5fab20594f87abf0ce5e44
BLAKE2b-256 checksum
How to use checksums
01a8047787750392bd4500e7528d3437c94be1aa35f3a4dcb11b4f048cc3179f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / wzony-0.2.0-py3-none-any.whl

Download URL wzony-0.2.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
089c3973c0aa180b0f2566cee17f72b47f5f15d6c7f70630c315d31004843472
BLAKE2b-256 checksum
How to use checksums
c268ef1523d48ddadbc6b27fb21c9ef4449e5c0fd3a43d7fb3b81464d739fd12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page