Skip to main content

aioxlib

Human-friendly asyncio interface to the X11 protocol

PyPI Python Versions License: GPL-3.0

aioxlib is a pure-Python library that speaks the X11 wire protocol over asyncio—without blocking the event loop and without linking to libX11.

Documentation

Installation

From within your favorite python environment:

pip install aioxlib

Quick start

The root package exposes the functional API and get_display only:

import asyncio
import aioxlib


async def main():
    wnd = await aioxlib.create_window(640, 480, title="Hello from aioxlib")
    await wnd.show()

    async for event in aioxlib.events():
        if wnd.is_delete_window(event):
            break


asyncio.run(main())

Explicit display (object API)

import asyncio
import aioxlib


async def main():
    display = await aioxlib.get_display()
    async with display:
        screen = display.default_screen()
        wnd = await screen.create_window(640, 480, title="Hello from aioxlib")
        await wnd.show()

        async for event in display.events():
            if wnd.is_delete_window(event):
                break


asyncio.run(main())

Package layout

Module Contents
aioxlib (root) Constants/enums + functional API + get_display
aioxlib.constants X11 constants and enumerations
aioxlib.protocol Constants, enums, pack/unpack
aioxlib.connection Socket connection, Xauthority
aioxlib.resource Resource, Drawable, ResourceManager
aioxlib.display (Window, Screen, GC, …) Window, Screen, GC
aioxlib.display Display, Pipeline
aioxlib.render / shm / dbe / … Extensions

Root functional API (selection)

Function Role
get_display / get_default_display Open connection
create_window, map_window, … Windows
events(), pipeline() Event stream / batched writes
flush, query_extension, get_atom, … Display operations
close_default_display Tear down default connection

Classes such as Display, Window, and EventType are not re-exported from the root; import them from their modules.

Documentation

pip install mkdocs mkdocs-material 'mkdocstrings[python]'
mkdocs serve

Examples

python examples/basic.py
python examples/functional.py

Requirements

  • Python ≥ 3.12
  • An X11 server and $DISPLAY (or an explicit URI)

License

GPLv3 or later — see LICENSE.

Author

José Tiago Macara Coutinho https://codeberg.org/tiagocoutinho

Release files for aioxlib 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioxlib 0.6.0
File Size Uploaded
aioxlib-0.6.0.tar.gz 124.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aioxlib 0.6.0
File Interpreter ABI Platform
aioxlib-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 204.6 kB

Release files / aioxlib-0.6.0.tar.gz

Download URL aioxlib-0.6.0.tar.gz
Size 124.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1200a1b6f1cb067a27f90a4d8bcaa4d313fced04234c804eb011d73862bebe12
BLAKE2b-256 checksum
How to use checksums
4c0efa66ba2c2958e2f4f4aebd993754ce28b0cd239144f7e3ce0234f5994507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / aioxlib-0.6.0-py3-none-any.whl

Download URL aioxlib-0.6.0-py3-none-any.whl
Size 80.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b94224f4f302fdabbfba01d7a6d449d90ace60aca4d2879fc529e073a67310f
BLAKE2b-256 checksum
How to use checksums
634854bc36da9ef3b137e09f4233a28ec5ed9db76574afb8457c1e92a08e8bab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release history Release notifications | RSS feed

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page