htmlkit
Write HTML in Python.
The htmlkit package allows developers to skip Jinja templates and use familiar Python tools like linters, formatters, and debuggers to build web apps more easily.
from htmlkit import body, h1, head, html, p, title
page = html(
head(title("Hello from Python")),
body(
h1("Hello from Python", id="banner", style="font-style: italic;"),
p("Write HTML in Python with htmlkit.", class_="intro"),
),
lang="en",
)
print(page)
The output, formatted here for readability, is:
<!doctype html>
<html lang="en">
<head>
<title>Hello from Python</title>
</head>
<body>
<h1 id="banner" style="font-style: italic">Hello from Python</h1>
<p class="intro">Write HTML in Python with htmlkit.</p>
</body>
</html>
Installation
Requires Python 3.14 or newer.
Install htmlkit with the awesome uv package manager:
uv add htmlkit
Or with pip:
pip install htmlkit
Or install the development version directly from GitHub:
uv add git+https://github.com/wigging/htmlkit
Documentation
Documentation is available at https://gavinw.me/htmlkit.
The documentation is written as Markdown files in the docs/content/ directory. The docs/build.py script renders them into HTML pages in docs/ using the layout in docs/layout.py. Build the documentation locally with:
uv run docs/build.py
Contributing
See the contributing guide for how to report a bug, run the checks, or submit a pull request.
Metadata
Release files for htmlkit 26.11.1
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 |
|---|---|---|---|---|
| htmlkit-26.11.1.tar.gz | 12.2 kB | Without provenance | Details for htmlkit-26.11.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| htmlkit-26.11.1-py3-none-any.whl | Python 3 | none | any | Details for htmlkit-26.11.1-py3-none-any.whl |
Total release size: 25.2 kB
Release files / htmlkit-26.11.1.tar.gz
| Download URL | htmlkit-26.11.1.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89e1df6c91303d44b310f94133c87a35709920496588606b1988516dd0de5822
|
|
BLAKE2b-256 checksum How to use checksums |
d0f46dd141d1ffa27a7580fad129a357f78696ab0bd7513dfd6699dd2bf2374f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / htmlkit-26.11.1-py3-none-any.whl
| Download URL | htmlkit-26.11.1-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f9a56f6a4dc02abdce2604955dbdb18551eacb112220843bbccabaafb7f2fc7
|
|
BLAKE2b-256 checksum How to use checksums |
f0c530a647f1adb5878713e093be340ecfa56defce4f8f05d33e9c5baf2a0b6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for htmlkit 26.11.1
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.