Installation¶
tagz is a single-file pure-Python module published on PyPI.
Requirements¶
Python 3.10, 3.11, 3.12, 3.13, or 3.14
No runtime dependencies
Install¶
pip install tagz
With uv:
uv add tagz
Add to your own pyproject.toml¶
[project]
dependencies = ["tagz>=0.7"]
Verify the install¶
import tagz
assert hasattr(tagz, "html")
assert hasattr(tagz, "Page")
assert hasattr(tagz, "parse")
What you get¶
tagz exports the following from its top-level module — see the
API reference for the full signatures:
html— the tag factory (html.div,html["my-tag"], …)Tag,TagInstance— the underlying element classesFragment,Raw— wrapper-less and unescaped containersPage— full-document helper with DOCTYPE and<html>/<head>/<body>parse— HTML-string-to-TagparserStyle,StyleSheet— CSS helpersdata_uri,open_data_uri— base64 encoding fordata:URIsABSENT— sentinel for conditionally removing an attributeHTML,TagParser— lower-level building blocks