--- id: html5rdf version: "1.2.1" license: Copyright (c) 2006-2013 James Graham and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # html5rdf — HTML parser based on the WHATWG HTML specification License: permissive · Maintenance: aging · Downloads: 862.5K/mo ## What it is and what it does html5rdf is a Python library that parses HTML documents into tree structures suitable for use with RDFLib, the semantic web toolkit. It is a fork of html5lib designed to conform to the WHATWG HTML specification as implemented by major web browsers. The parser accepts HTML from files, strings, or HTTP responses and can output to multiple tree formats—xml.etree (default), lxml.etree, or xml.dom.minidom—allowing flexibility in how you work with the parsed structure. The library has no runtime dependencies and supports Python 3.8 through 3.12 on both CPython and PyPy (with caveats around lxml). It is intended for developers who need to extract or transform HTML into RDF-compatible structures, particularly when working within the RDFLib ecosystem. Optional dependencies like lxml, genshi, and chardet can enhance functionality for specific use cases. Use it for: - Extract structured data from HTML documents for conversion to RDF graphs using RDFLib. - Parse HTML with WHATWG-compliant error recovery when building semantic web applications. - Integrate HTML parsing into RDF data pipelines where standard HTML5 compliance is required. - Use alternative tree builders (lxml, minidom) when specific XML processing workflows are needed. - Handle HTTP responses with charset detection for proper encoding when fetching remote HTML. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses HTML documents into tree structures compatible with RDFLib, implementing the WHATWG HTML specification and supporting multiple tree builders like xml.etree, lxml, and xml.dom.minidom. Yes, if you need WHATWG-compliant HTML parsing specifically for RDFLib workflows. The library has low install friction, no runtime dependencies, and permissive licensing. However, the 653-day gap since last release combined with aging maintenance status suggests limited active development—suitable for stable use cases but verify that it meets your RDF integration needs before adopting in new projects. ## Install pip install html5rdf uv add html5rdf poetry add html5rdf ## Installing html5rdf Before you install: Low install friction with no runtime dependencies. Last release was 653 days ago and the repository shows aging maintenance signals, though the codebase remains archived-free and the last commit is recent. License in practice: MIT license permits unrestricted use, modification, and distribution with only attribution and liability disclaimer required—suitable for both open and proprietary projects. Quickstart: import html5rdf # Parse from file with open("mydocument.html", "rb") as f: document = html5rdf.parse(f) # Or parse from string document = html5rdf.parse("Hello World!") # Use alternative tree builder parser = html5rdf.HTMLParser(tree=html5rdf.getTreeBuilder("lxml")) lxml_document = parser.parse("") Requires Python 3.8 or later; lxml tree builder is not supported on PyPy due to known segfault issues. Verify before relying: - Whether the 653-day gap since last release indicates active maintenance or dormancy despite recent commits. - Performance characteristics compared to other HTML parsers for large documents. - Specific RDFLib integration patterns and whether this is the standard approach for RDF extraction from HTML. ## Package facts - License: Copyright (c) 2006-2013 James Graham and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 862.5K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags HTML parser RDFLib, WHATWG HTML parsing, HTML to RDF, HTML tree builder, semantic HTML parsing, RDF document extraction, HTML5 parser Python, rdf-integration, html-parsing, semantic-web [View on SkillFed](https://skillfed.io/packages/html5rdf) · [View on PyPI](https://pypi.org/project/html5rdf/)