Markup Processing Modules

html.entities

Provides mappings for HTML named character references, including the HTML5 table. Names in html5 may include a trailing semicolon, and some values contain multiple Unicode characters. Prefer html.unescape() for decoding complete text.

Formal Syntax & Structure

python syntaxpython
import html.entities

Return Value

module

Module namespace available through import; import is a statement, not a value-returning expression.

Working Example

Example Snippetpython
from html.entities import html5print(html5["amp;"])print(html5["copy;"])
Python Reference