sgmllib3k
Py3k port of sgmllib.
What it is and what it does
sgmllib3k is a minimal port of Python's old sgmllib module to Python 3, created by running 2to3 on the original code. It provides an event-driven SGML/HTML parser that works by subclassing and overriding handler methods for different document elements. The module was dropped from the stdlib because more robust alternatives exist, and the maintainer explicitly disclaims any intention to maintain this port.
The package has not been updated since its initial release on 2010-08-24 and is classified as abandoned. While it shows substantial download volume, this likely reflects transitive dependencies or legacy codebases still relying on it rather than active new adoption. The maintainer recommends finding another module for new projects.
Use it for:
- Porting old Python 2 code that depended on sgmllib to Python 3 with minimal changes
- Parsing legacy SGML documents in Python 3 when the original module is unavailable
- Maintaining existing projects with hard dependencies on sgmllib3k that cannot be refactored
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python 3 port of the deprecated stdlib sgmllib module for parsing SGML and HTML documents using an event-driven interface.
No. This package is abandoned (no updates since 2010-08-24, no maintenance commitment) and the maintainer explicitly recommends finding an alternative. Install only if you are maintaining legacy code with a hard dependency on sgmllib3k and cannot refactor to a maintained alternative.
Install
sgmllib3k on PyPI
pip
pip install sgmllib3kuv
uv add sgmllib3kpoetry
poetry add sgmllib3kInstalling sgmllib3k
Before you install
High install friction: the package is abandoned (last release 2010-08-24, no activity for 5834 days) with no runtime dependencies. The maintainer explicitly states they do not intend to maintain it and recommend finding an alternative module.
License in practice
BSD License (permissive) imposes no significant restrictions on use or redistribution.
Quickstart
pip install sgmllib3k
from sgmllib3k import SGMLParser
class MyParser(SGMLParser):
def handle_data(self, data):
print(data)
parser = MyParser()
parser.feed('<html><body>Hello</body></html>')
No Python version constraint specified; compatibility with modern Python 3 versions is unverified.
Verify before relying
- Whether sgmllib3k actually works on modern Python 3 versions or only those contemporary with 2010
- Whether the 2to3 conversion was complete and handles Python 3 string/bytes distinctions correctly
- What specific parsing tasks drive the 10088849 monthly downloads given the abandoned status
Package facts
| License | BSD License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 5,834 days since the last release |
| First released | |
| Downloads | 10,088,849/month — #1,482 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sgmllib3k-1.0.0.tar.gz
Tags
More HTML packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
lxmllxml provides Python bindings to libxml2 and…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
MarkdownConverts Markdown text to HTML using a Python…
permissive · top 1,000 on PyPI
feedparser-sgmllibProvides the sgmllib SGML parser from Python…
permissive · top 5,000 on PyPI
DocumentTemplateDocumentTemplate implements the Document…
unclear · top 15,000 on PyPI
audioop-ltsProvides the `audioop` module for Python 3.13+,…
permissive · top 5,000 on PyPI
BeautifulSoupBeautiful Soup parses HTML and XML documents…
permissive · top 15,000 on PyPI
standard-sunauProvides the sunau module, a standard library…
permissive · top 5,000 on PyPI
standard-imghdrProvides the `imghdr` module, a Python standard…
permissive · top 5,000 on PyPI
stdlibsProvides a static listing of all known modules…
permissive · top 5,000 on PyPI
mjmlConverts MJML (a markup language for responsive…
permissive · top 15,000 on PyPI
standard-chunkProvides the chunk module, a removed Python…
permissive · top 5,000 on PyPI