Skip to main content

wBuilder

    wBuilder
    (c) 2020 Rodney Maniego Jr.
    MIT License

HTML template generator for Python.

Read: Introducing wBuilder: An HTML5 Generator for Python

Requirements:

  • Arkivist, BS4, Namari

Future Features

  • Simple JQuery generator

WebBuilder Usage

Import

from wbuilder import WebBuilder

Initialize

html = WebBuilder()
html = WebBuilder("web.html")
html = WebBuilder(html="<span id='label'></span>")

HTML head

html.prop("html", "lang", "en")
html.at("head").append("title", text="WebBuilder")
html.at("head").append("meta", charset="UTF-8")
html.at("head").append("meta", name="viewport", content="width=device-width, initial-scale=1, shrink-to-fit=no")
html.at("head").append("link", rel="icon", href="icon.png", type_="image/png", sizes="96x96", static=True)
html.at("head").append("link", rel="stylesheet", href="reset.css", static=True)
html.at("head").append("link", rel="stylesheet", href="design.css")

Basic usage

html.at("body").append("div", id="#popup .popup")
html.at("#popup").append("header3", id=".header", text="Welcome!")

CSS selectors

html.at("#popup").append("span", id="#popup-txt .popup-txt", text="Hello, user!")
html.at("#popup").append("button", id="#ok .blue", text="OK")

# CSS as a string
html.inlineCss("div", {"color": "#000"})
html.inlineCss("div", "font-size:12px;", reset=True))

# CSS as a dictionary
design = { "font-size": "12px", "color": "#222", "background-color": "#f0f0f0" }
html.at("#popup").append("div", id=".message", text="Lorem ipsum...", style=design)

Update element properties

html.prop("html", "lang", "en")
html.prop("#popup", "data-name", "container")
html.prop("#popup", "data-title", "message")
html.prop("div", "style", "font-size:12px;")

Preview HTML

content = html.build()
print(content)

Save to HTML file

html.save()
html.save("saveAsNewFile.html")

Save to/Read from JSON file

html.toJson("test.json")
html.fromJson("test.json")

Metadata

Release files for wbuilder 3.0.5

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

Source distribution (sdist)

Source distribution for wbuilder 3.0.5
File Size Uploaded Provenance Actions
wbuilder-3.0.5.tar.gz 11.1 kB Without provenance Details for wbuilder-3.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wbuilder 3.0.5
File Interpreter ABI Platform Actions
wbuilder-3.0.5-py3-none-any.whl Python 3 none any Details for wbuilder-3.0.5-py3-none-any.whl

Total release size: 20.4 kB

Release files / wbuilder-3.0.5.tar.gz

Download URL wbuilder-3.0.5.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cd0d76ddbff1853f1326cdffa5099c5c1ff7d9746d0794ac56bfabfb902194ba
BLAKE2b-256 checksum
How to use checksums
bb044b16f7b6aa229af3d6686ee2f31baab66b13cbbc1f9b8451b919dff8c9fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Release files / wbuilder-3.0.5-py3-none-any.whl

Download URL wbuilder-3.0.5-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7219cb672e24efaa499150669375762603101b3ff0bfa22f31743f3853b626c
BLAKE2b-256 checksum
How to use checksums
479f030a6a705411e8130eef95c14f9dfa54d6320571b359ec3a579f20e353c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.4

Security for wbuilder 3.0.5

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.

Release history Release notifications | RSS feed

This release

3.0.5 This release

2 release files No provenance

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