python-xlib
Python X Library
What it is and what it does
Python Xlib is a pure-Python implementation of an X11 client library, written entirely in Python rather than as a wrapper around the C Xlib. It communicates directly with X servers via the X protocol over TCP/IP or Unix sockets, making it portable across any system with Python installed and an X server. The library provides both a low-level protocol interface and a high-level object-oriented API for building X client applications.
The package implements client-side X11R6 with support for a resource database, ICCCM window manager conventions, and several X extensions including RECORD, SHAPE, Xinerama, Composite, RANDR, DAMAGE, SECURITY, XFIXES, XInput, XTEST, and others. It has been used in production applications like the PLWM window manager and includes regression tests for stability, though the project has not received updates since late 2022.
Use it for:
- Build X11 window managers or desktop environment components that need direct protocol-level control
- Write X11 client applications for Linux and Unix systems without C extension dependencies
- Automate X server interactions or create testing tools that need to communicate with X servers
- Develop GUI applications on Unix systems using a pure-Python X protocol implementation
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pure-Python X11 client library that implements the X protocol to allow Python programs to interact with X servers on Unix-like systems.
Yes, if you are building X11 client applications on Unix systems and need a pure-Python solution without C dependencies. No, if you require active maintenance, bug fixes, or compatibility updates—the project is abandoned. Consider only for stable, long-term-maintenance applications where the lack of recent updates is acceptable.
Install
python-xlib on PyPI
pip
pip install python-xlibuv
uv add python-xlibpoetry
poetry add python-xlibInstalling python-xlib
Before you install
Low install friction with a single lightweight dependency (six). However, the project is marked abandoned with no releases since 2022-12-25 and last commit 2023-04-01, meaning bug fixes and compatibility updates are unlikely.
License in practice
Licensed under LGPLv2+, a copyleft license. Any derivative work or modifications must be released under compatible terms, and source code must be made available to users.
Quickstart
pip install python-xlib
import Xlib
from Xlib import display
display_obj = display.Display()
screen = display_obj.screen()
print(screen.root.get_geometry())
Requires an X server to be running on a Unix-like system (Linux, BSD, etc.). Will not work on Windows or macOS. Requires Python 2.7 or newer.
Verify before relying
- Current compatibility with Python versions beyond 3.8 (classifiers list 3.8 as highest tested)
- Whether the library remains functional with modern X11 implementations and extensions
Package facts
| License | LGPLv2+ (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | abandoned — 1,328 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,476,409/month — #2,609 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_xlib-0.33-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
xlibProvides a pure-Python X11 client library for…
copyleft · top 15,000 on PyPI
EWMHlibQuery and control window managers that…
permissive · top 15,000 on PyPI
xvfbwrapperManages headless X11 virtual displays using…
permissive · top 5,000 on PyPI
keysymdefProvides X11 and XF86 keysym definitions as…
unclear · top 15,000 on PyPI
jeepneyJeepney is a pure Python implementation of…
permissive · top 1,000 on PyPI
dbus-pythonProvides Python bindings to libdbus, allowing…
permissive · top 15,000 on PyPI
PyVirtualDisplayWraps Xvfb, Xephyr, and Xvnc to create virtual…
permissive · top 5,000 on PyPI
ftputilftputil provides a high-level FTP client…
permissive · top 15,000 on PyPI
pyghmiPyghmi provides Python bindings for IPMI…
permissive · top 15,000 on PyPI
pyobjc-framework-libxpcProvides Python bindings to the macOS XPC…
permissive · top 15,000 on PyPI