$npx skillfedfor your agent

types-lxml

Complete lxml external type annotation

Worth itPyPI MarkupReleased Feb 20263.8M downloads / moApache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — types_lxml-2026.2.16-py3-none-any.whl
v2026.2.16 · released 2026-02-17 · Python >=3.9 · 4 runtime deps: typing_extensions, cssselect, beautifulsoup4, types-html5lib

Yes. types-lxml is actively maintained, has no known vulnerabilities, installs with low friction, and is essential for any project using lxml that wants static type checking. The Apache-2.0 license poses no restriction. Install it if you use lxml and rely on type checking or IDE support.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Mypy plugin requires explicit configuration in mypy config file to enable.
  • Low friction installation as a pure-Python wheel.

License · maintenance · safety

Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in most projects without significant restrictions. Safe for both open-source and commercial codebases.

last release 2026-02-17 (178 days) · last repo commit 2026-06-29 · 84 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,813,233 downloads/mo, #2,492 on PyPI

Verify before relying

pip install types-lxml

# In mypy.ini or pyproject.toml, enable the plugin:
# [mypy]
# plugins = mypy_plugin_lxml.main

import lxml.etree as etree
root = etree.Element('root')
  • Whether the package's mypy plugin is required for basic type checking or only for advanced features like XMLParser.set_element_class_lookup() behavior.
  • Performance impact of enabling the mypy plugin on type-check times for large projects.
Same gist for agents: .md · .json

What it is and what it does

types-lxml is a stub package that provides complete external type annotations for the lxml library, allowing Python type checkers and IDEs to understand and validate code that uses lxml's XML and HTML processing APIs. It works with multiple type checkers—mypy, pyright, basedpyright, pyrefly, and ty—and includes a mypy plugin that adds specialized type-checking behavior for lxml-specific patterns.

The package is built around four goals: complete annotation coverage (no longer marked as partial), support for multiple type checkers, extensive review and testing against real runtime behavior, and developer-friendly features like contextual docstrings and warnings for problematic usage patterns. It includes both a standard build and a multi-subclass variant for projects that create multiple lxml element subclasses, and supports Python 3.9 through 3.14.

Use it for

  • Enable static type checking in IDEs and CI pipelines for projects using lxml for XML or HTML parsing.
  • Catch type errors in lxml code before runtime, such as incorrect method calls or type mismatches.
  • Get IDE autocomplete and inline documentation for lxml APIs in Visual Studio Code and other editors.
  • Use the mypy plugin to enforce correct patterns for lxml element class lookups and inheritance.
  • Validate lxml code against multiple type checkers to ensure broad compatibility.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

types-lxml is actively maintained, has no known vulnerabilities, installs with low friction, and is essential for any project using lxml that wants static type checking. The Apache-2.0 license poses no restriction. Install it if you use lxml and rely on type checking or IDE support.

Install

types-lxml on PyPI

Before you install

Low friction installation as a pure-Python wheel. Actively maintained with recent releases; last commit 2026-06-29. Supports current Python versions (3.9–3.14) and works with multiple type checkers including mypy, pyright, basedpyright, pyrefly, and ty.

Requires Python 3.9 or later. Mypy plugin requires explicit configuration in mypy config file to enable.

License in practice

Apache-2.0 permissive license allows use in most projects without significant restrictions. Safe for both open-source and commercial codebases.

Quickstart

pip install types-lxml

# In mypy.ini or pyproject.toml, enable the plugin:
# [mypy]
# plugins = mypy_plugin_lxml.main

import lxml.etree as etree
root = etree.Element('root')

Verify before relying

  • Whether the package's mypy plugin is required for basic type checking or only for advanced features like XMLParser.set_element_class_lookup() behavior.
  • Performance impact of enabling the mypy plugin on type-check times for large projects.

Package facts

LicenseApache-2.0 permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
4 packages
typing_extensionscssselectbeautifulsoup4types-html5lib
MaintenanceActively maintained 178 days since the last release
Last repo commit
First released
Downloads3,813,233 / month, #2,492 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Typing :: Stubs Only

Evidence: types_lxml-2026.2.16-py3-none-any.whl

Tags

Capabilities
lxml type stubslxml type annotationsstatic type checking xmllxml mypy plugintype hints for lxmllxml ide supportlxml type hints
Topics
type-stubslxmlstatic-analysis
PyPI keywords
lxmltypingstubsannotation

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “lxml type stubs”

  • types-lxmlProvides complete external type annotations for lxml, enabling static…
  • lxml-stubsProvides type annotations for the lxml package to enable static type…
  • types-assertpyProvides type stubs enabling static type checkers like mypy and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Markup packages

PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
markdown-it-py Worth it
PyPI · Python Modules · released May 2026

A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.

Install it if you need reliable markdown-to-HTML conversion.

MITpure Python · 3.10+
613.8Mdownloads / mo
beautifulsoup4 Worth it
PyPI · Python Modules · released Jun 2026

Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.

Install it if you need to parse or extract data from markup documents.

MITpure Python · 3.7.0+
432.1Mdownloads / mo
et-xmlfile With conditions
PyPI · Markup · released Oct 2024

et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.

Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.

MITpure Python · 3.8+dormant
343.3Mdownloads / mo
tomlkit Worth it
PyPI · Markup · released Jul 2026

Parses and edits TOML files while preserving formatting, comments, and structure, then serializes them back with layout intact.

Install it if you're building tools that touch TOML files and user readability of the source matters.

MITpure Python · 3.9+
338.0Mdownloads / mo
docstring-parser Worth it
PyPI · Python Modules · released Apr 2026

Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.

Install it if you need to programmatically read and extract structured data from Python docstrings.

MITpure Python · 3.8+
274.9Mdownloads / mo

See also lxml-stubs · types-Pygments · types-setuptools · types-openpyxl · types-beautifulsoup4 · types-braintree · types-yt-dlp · types-dateparser · types-gevent · basedpyright