skillfed

python-xlib

Python X Library

python-xlib v0.33 3.5M downloads/30d#2,609 on PyPI462
Copyleft license LGPLv2+ Abandoned released

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-xlib

uv

uv add python-xlib

poetry

poetry add python-xlib

Installing 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

Development Status :: 5 - Production/StableEnvironment :: X11 ApplicationsIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)Operating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: User Interfaces

Tags

x11 client library pythonx protocol pythonxlib python bindingsx server communicationunix x11 gui programming
x11unix-onlyabandoned

More Libraries packages