[Xcb] ooxcb, a Python X binding based on xcb

Friedrich Weber fred.reichbier at googlemail.com
Sat May 7 08:58:37 PDT 2011


Hello!

I want to "announce" ooxcb, a X binding for Python, originally developed
for use with the samurai-x window manager (http://samurai-x.org).
However, samurai-x was discontinued due to lack of motivation. I
continued to develop ooxcb because I found it interesting to work with
the very basic X protocol, but also lost some motivation over time
(developing a X binding without any application feels a bit pointless
:D). Although ooxcb is far from complete, I now decided to present it on
this mailing list to make some people aware of the project. Maybe it's
useful to someone. ;-)

Alternatives such as python-xlib and xpyb already existed, but I decided
to write a new binding anyway. My reasons were that python-xlib didn't
seem to use the asynchronous request handling approach and xpyb looked
good, but its design was not object-oriented at all. So I decided to
start ooxcb, an object-oriented X binding based on xpyb's code. It is
based on xpyb's binding code generator, but it generates object-oriented
binding code. Because of that, the bindings can't be fully
auto-generated (information about object structures are missing), so
every X extension requires an interface file that describes the
object-oriented and Python-specific aspects of the binding. Due to that,
ooxcb is not as complete as xpyb, because not all extensions are wrapped
yet.

ooxcb is a 3-clause-BSD-licensed Python module that uses ctypes (a
Python FFI) to access libxcb's base functions. Everything of ooxcb's
code is implemented in Python (no C extensions involved). ooxcb's focus
isn't performance (It will perform worse than xpyb and python-xlib (I
think), but I haven't done much benchmarking and performance work yet),
but usability. X development in Python should feel "pythonic".

The core protocol is wrapped (but not fully tested, sorry), also some
useful extension modules. There are also some extra helpful modules
under `ooxcb.contrib`. Some documentation exists; if you want to have a
look at it:

    http://docs.samurai-x.org/ooxcb/

If you want to check ooxcb out:
   
    git clone git://samurai-x.org/ooxcb.git

Run `python setup.py install` and run some scripts in `examples/`. There
is also a little tutorial here:
http://docs.samurai-x.org/ooxcb/getting-started.html

I'd appreciate any feedback and criticism :-) (and hope the mailing list
is the right place for this)

Also, thanks to the xcb and xpyb developers for the great base. ;-)

Cheers!

Friedrich Weber


More information about the Xcb mailing list