Skip to content
Incomplete type stubs for the lxml package
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



This repository contains external type annotations (see PEP 484) for the lxml package. Such type annotations are normally included in typeshed, but lxml's annotations were frequently problematic and have therefore been deleted from typeshed. In particular, the stubs are incomplete and it has been difficult to provide complete stubs.

This repo provides lxml stubs as they existed in typeshed for those who find them useful. Eventually, it should become a PEP 561-style stubs package.


To use these stubs, clone this repo and point your type checker to it. For example, to use them in mypy, you can set the $MYPYPATH environment variable or set mypy_path = /path/to/lxml-stubs in your mypy.ini.


Contributions should follow the same style guidelines as typeshed.

Git history

The early git history of this repo contains commits from typeshed, filtered to only changes that affect typeshed (using git filter-branch).


This repository was created by Jelle Zijlstra. Numerous others have contributed to the lxml stubs; see the git history for details.


  • Provide testing (both a local test script and a Travis setup)
  • Provide a PEP 561-style setup script.
You can’t perform that action at this time.