xlib
Python X Library
What it is and what it does
Xlib is a pure-Python implementation of an X11 client library, allowing Python programs to communicate directly with X servers via the X protocol over TCP/IP or Unix sockets. Unlike C-based X libraries, it requires no compiled extensions and runs on any system with Python installed. It provides both low-level protocol access and a high-level object-oriented interface for building GUI applications and window managers.
The library implements the complete X11R6 client-side protocol and includes support for several X extensions (RECORD, SHAPE, Xinerama, Composite, RANDR, XTEST). However, the package has been abandoned since 2018, with no releases or active maintenance for over six years, though the repository remains publicly available. It is stable enough to have powered real applications like the PLWM window manager, but users should expect no bug fixes or compatibility updates for modern Python or X11 environments.
Use it for:
- Build custom window managers or X11 desktop tools that need direct protocol-level control over windows and events.
- Write GUI automation or testing tools that interact with X11 applications without relying on external C libraries.
- Develop X11-based system utilities or monitoring applications that need to query or manipulate window state.
- Create portable X client applications that run on any Unix-like system with Python and X11 installed.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a pure-Python X11 client library for communicating with X servers via the X protocol, enabling GUI applications to interact with X11 window systems.
No, unless you are maintaining legacy code that already depends on it. The package is abandoned (last release 2018, no maintenance since), has no known security vulnerabilities but also no path to fixes, and is untested with Python versions beyond 3.6. For new X11 projects, consider alternatives or direct protocol libraries. If you must use it, treat it as a frozen dependency and test thoroughly in your target environment.
Install
xlib on PyPI
pip
pip install xlibuv
uv add xlibpoetry
poetry add xlibInstalling xlib
Before you install
Low friction to install, but the package is abandoned as of 2018 with no recent maintenance activity. The last commit was 2023-04-01, but the latest release remains from 2018-01-02. Only one runtime dependency (six) keeps installation simple.
License in practice
Licensed under LGPLv2+, a copyleft license. Any derivative work or modification must be released under compatible terms; static linking or bundling may trigger disclosure obligations depending on your distribution model.
Quickstart
pip install xlib
import Xlib
from Xlib import display
display.Display()
Requires an X11 server to connect to; will not function on systems without X11 (e.g., headless servers, Windows without WSL/X11 forwarding, or macOS without XQuartz).
Verify before relying
- Whether the package works reliably with Python versions beyond 3.6, given the last release was 2018 and classifiers only list up to 3.6.
- Current stability and compatibility with modern X11 server implementations, given the abandoned maintenance status.
- Whether the RECORD, SHAPE, Xinerama, Composite, RANDR, and XTEST extensions mentioned in the description are fully functional or partially implemented.
Package facts
| License | LGPLv2+ (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | abandoned — 3,146 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 160,475/month — #10,660 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: xlib-0.21-py2.py3-none-any.whl
Keywords: windows, x, x11, xlib
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
EWMHlibQuery and control window managers that…
permissive · top 15,000 on PyPI
python-xlibA pure-Python X11 client library that…
copyleft · top 5,000 on PyPI
xvfbwrapperManages headless X11 virtual displays using…
permissive · top 5,000 on PyPI
wmctrlwmctrl provides programmatic control over…
permissive · top 15,000 on PyPI
PyVirtualDisplayWraps Xvfb, Xephyr, and Xvnc to create virtual…
permissive · top 5,000 on PyPI
keysymdefProvides X11 and XF86 keysym definitions as…
unclear · top 15,000 on PyPI
pyds9pyds9 provides a Python interface to…
unclear · top 15,000 on PyPI
PyGetWindowPyGetWindow provides functions to query,…
permissive · top 5,000 on PyPI
wxPythonwxPython provides Python bindings to the…
unclear · top 15,000 on PyPI
jeepneyJeepney is a pure Python implementation of…
permissive · top 1,000 on PyPI