HTML Tag Names
This library provides a static list of known HTML tag names, encompassing both historical and current tags as defined by the HTML living standard. It is a Python port of the popular npm package `html-tag-names`. The current version is 0.1.2, with releases typically occurring infrequently, primarily for data updates or minor maintenance.
Warnings
- gotcha The `html-tag-names` list includes all known HTML tags, which means it contains many deprecated or obsolete tags (e.g., `<font>`, `<center>`, `<marquee>`) alongside modern ones. Developers should be aware of current HTML standards (HTML5+) and use CSS for presentation rather than relying on deprecated HTML tags.
- gotcha All tag names in the `html_tag_names` list are in lowercase. If comparing against sources or inputs that might use uppercase or mixed-case HTML tag names, conversion to lowercase will be necessary for accurate checks.
- gotcha This library provides a static list of tag names for reference. It does not offer any HTML parsing, validation, manipulation, or rendering capabilities. It is simply a data source of valid tag names.
Install
-
pip install html-tag-names
Imports
- html_tag_names
from html_tag_names import html_tag_names
Quickstart
from html_tag_names import html_tag_names
print(f"Total HTML tags: {len(html_tag_names)}")
print(f"First 5 tags: {html_tag_names[:5]}")
if 'div' in html_tag_names:
print("'div' is a known HTML tag.")
# Example of checking for a deprecated tag (which are included)
if 'font' in html_tag_names:
print("'font' is in the list, though it is a deprecated tag.")