Packages
Converts HTML documents and HTML tables into JSON structures, optionally capturing element attributes, text values, and nested tags.
ColorAide is a pure Python library for creating, converting, and manipulating colors across many color spaces with support for modern CSS color syntax and utilities like mixing, interpolation, and gamut mapping.
Displays annotated text with labels and optional styling in Streamlit apps, accepting strings, tuples with annotations, or htbuilder elements for flexible markup.
Genshi is a Python library for parsing, generating, and processing HTML, XML, and other textual content, with a built-in template language inspired by Kid for web output generation.
However, verify Python version support for your target runtime, as classifiers list both Python 2 and 3 without specifying which versions are actually supported.
Adds an include directive to Python-Markdown that lets you embed the contents of other files into Markdown documents, with support for line-range selection and heading-depth adjustment.
htbuilder lets you construct HTML strings using Python function calls and operators instead of template syntax, supporting attributes, nested elements, and conditional rendering through pure Python code.
Converts CSS stylesheets to inline styles in HTML documents, using BeautifulSoup and cssutils to embed external or embedded CSS directly into element attributes.
However, verify compatibility with your Python version and library versions before relying on it in production, and be prepared to fork or patch it if issues arise.
htpy lets you write HTML directly in Python using bracket syntax and Python expressions, generating valid HTML without a template language.
Provides HTMLParser from Python 2.7 as a backport for Python 2.6 environments to parse HTML documents.
Install only if you are maintaining legacy Python 2.6 code that cannot be upgraded—a scenario that should be extremely rare.
Converts Excel spreadsheets (.xlsx files) to HTML tables while preserving cell formatting, with support for locale-specific number and date rendering.
Generates self-contained or modular HTML test reports for pytest, using Jinja2 templates to display test results, phases, documentation, markers, and fixtures with expandable sections.
Converts GitHub-flavored Markdown to HTML with support for offline conversion, image optimization, LaTeX formulas, PDF export, and emoji shortcodes.
However, it is dormant—no updates in 788 days—so compatibility with current versions of its dependencies is unverified.
Sumy extracts summaries from HTML pages or plain text using multiple automatic summarization algorithms (LSA, LexRank, Luhn, Edmundson) and provides evaluation tools for summary quality.
Provides the core build and CLI infrastructure for JupyterLite, a browser-based Jupyter environment that runs in the browser without a server.
Install only if you need the build toolchain; end users of JupyterLite sites do not need this package.
Extracts text, images, and metadata from PDFs and converts them to Markdown or HTML, powered by a Rust core compiled to native wheels with no system dependencies.
Beautiful Soup parses HTML and XML documents into a navigable tree, allowing you to search, iterate, and modify the parsed structure using Python idioms.
Install only if you are maintaining legacy code that cannot be updated and have no other option; for any new project, use beautifulsoup4.
A Django template filter that converts Markdown text to sanitized HTML, wrapping the markdown and bleach libraries for safe rendering in templates.
Django MarkdownX provides a Markdown editor widget for Django applications with live preview, drag-and-drop image uploads, and image manipulation capabilities.
Click Extra is a wrapper around Click that adds configuration file loading, colored help screens, standard CLI options, and theming to make building professional command-line tools faster and with less boilerplate.
Provides 25 Bootswatch + Bootstrap 5 themes for Shiny Python applications, allowing you to apply pre-designed visual themes to your web UI.
Install it if you're building Shiny applications and want professional-looking themes out of the box.
z3c.pt is a fast ZPT (Zope Page Template) engine that compiles templates to bytecode using Chameleon, providing page template rendering with path expressions and TALES support.
Renders HTML5 safely from Python expressions using a functional API with automatic escaping and compact output.
meld3 is an HTML/XML templating system that separates template markup from rendering logic using ElementTree-based element manipulation and namespace-qualified identifiers.
Install only if you are maintaining legacy code that already depends on it (e.g., Supervisor versions before 4.1.0).
Extracts the main readable content from HTML pages by identifying and isolating the article text while removing boilerplate, navigation, and ads.
Install only if you can satisfy the lxml build dependency; otherwise, consider it a straightforward choice.
Pelican is a static site generator that converts text files in Markdown, reStructuredText, or HTML into a complete, ready-to-serve website without requiring a database or server-side code.
Parse, query, edit, and serialize HTML and XML documents with a C-accelerated core, supporting CSS selectors, XPath, markdown export, sanitization, and form extraction.
Install it if you need fast, typed HTML handling and are willing to learn its API.
Airium generates HTML from Python code using indentation and context managers instead of templates, and can also parse HTML back into Python.
Render HTML by writing Python code, using classes to represent tags and leveraging Python's syntax and object-oriented features instead of template languages.
However, note that the last release was in 2021; if you encounter bugs or need new features, community support may be limited.
Plim translates a concise Ruby-inspired template syntax into HTML and Mako markup, letting you write cleaner template code that compiles down to valid Mako templates.
No—install only if you are maintaining legacy code already using Plim.
Extracts the main article content from web pages, handling both direct URL fetching and pre-fetched HTML strings to isolate readable text from web articles, blogs, and news sites.
Install only if you have a legacy codebase already using it and cannot migrate.
Extracts main content from HTML pages and outputs it in HTML, text, or Markdown format, preserving element hierarchy and link information for use with LLM frameworks.
However, proceed with caution: the package has been dormant since 2023-12-10 with no updates, maintenance status is unclear, and the XML-to-HTML conversion is lossy.
Parses HTML tables into nested lists of rows and cells without requiring external dependencies, stripping tags and extracting text content.
The AGPL-3.0-or-later license requires careful review for proprietary use.
Renders individual Jinja2 template blocks as HTML fragments instead of full pages, enabling partial template rendering for HTMX and other dynamic HTML patterns.
Install it if you're already using Jinja2 and need to render template fragments.