Skip to main content

Yet Another Python HTML Builder

A single-file, zero-dependency, fully-typed HTML builder library

Usage:

from yahb import (
    Document,
    Element,
    body,
    h1,
    head,
    html,
    img,
    link,
    main,
    meta,
    p,
    title,
)


def app() -> Element:
    return main(
        h1("Welcome to HTML Builder"),
        p(
            "Here's a cat for you:",
            img(src="https://cataas.com/cat"),
        ),
    )


doc = Document(
    html(
        head(
            meta(charset="UTF-8"),
            meta(name="viewport", content="width=device-width, initial-scale=1.0"),
            title("My Awesome Page"),
            link(rel="stylesheet", href="https://cdn.simplecss.org/simple.css"),
        ),
        body(app()),
        lang="en",
    )
)
print(doc)

Output:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>
      My Awesome Page
    </title>
    <link rel="stylesheet" href="https://cdn.simplecss.org/simple.css"/>
  </head>
  <body>
    <main>
      <h1>
        Welcome to HTML Builder
      </h1>
      <p>
        Here&#x27;s a cat for you:
        <img src="https://cataas.com/cat"/>
      </p>
    </main>
  </body>
</html>

Metadata

Release files for yahb 0.3.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 yahb 0.3.0
File Size Uploaded Provenance Actions
yahb-0.3.0.tar.gz 13.2 kB Without provenance Details for yahb-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 24.7 kB

Release files / yahb-0.3.0.tar.gz

Download URL yahb-0.3.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5199decb19ff1b715b2df6c37fe95d435c0161be9ffa92b24a4afada77fff246
BLAKE2b-256 checksum
How to use checksums
20b2cc64ce8506b13430f153ecee3d24fcf7335c5a61863a9fd36694294f37cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.11

Release files / yahb-0.3.0-py3-none-any.whl

Download URL yahb-0.3.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec46aea9d42d80a8e2a20b86f07e631687c8962c8b48bc87c0fb696aa4c58366
BLAKE2b-256 checksum
How to use checksums
6cdfbccf8b25fbd8d5eb5a09c8cce74c660802bd821df913b6956161bf2d3560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.11

Security for yahb 0.3.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.

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