On this page
  1. parse-html5
  2. Role
  3. Install
  4. Quickstart
  5. When to Reach for It
  6. Gotchas & Pitfalls
  7. Pairs With
  8. Metadata

parse-html5

Prev: parse-md | Up: projects | Next: parse-mw
Rel: wispsy, Foundation, astree
Ref: wispsy on GitHub
Tags: #public #wispsy #project #foundation #tier/standard


Role

Source-preserving HTML5 parsing (parse, parse_fragment) and safe typed HTML rendering (render) for Python 3.14+ (0.1.0, zero runtime deps)—using immutable dataclass AST nodes with exact source slices, entity decoding, and safe default escaping.

Install

python -m pip install parse-html5

Quickstart

from parse_html5 import parse, parse_fragment, render

doc = parse("<main><h1>Hello &amp; welcome</h1><br></main>")
assert doc.children[0].name == "main"

fragment = parse_fragment("<p>one</p><p>two</p>")
assert render(fragment) == "<p>one</p><p>two</p>"

When to Reach for It

Gotchas & Pitfalls

Pairs With


Metadata

type: project-card
slug: parse-html5
org: wispsy
repo: wispsy/parse-html5
package: parse-html5
version: 0.1.0
requires_python: ">=3.14"
layer: foundation
topic: wispsy-foundation
status: active
language: python
source_docs: README.md, docs/

Linked from

Related notes