Skip to main content

An implementation of some functionalities of gobject/glib/gio in pure python, but adding a lot of new features.

Project description


*pygel* is a pure-python event loop library that works on *Python 2.7+*, *Python 3.4+* and PyPy as well

*pygel* implements its own event loop library from scratch using [socketqueue](

it was initially based on pygtk2/gobject interfaces but has gained its own life and its own interfaces and the pygtk2/gobject is no longer supported anymore

it can interface with another event libraries as Qt4, Qt5, Gi(work in progress), pygtk2(work in progress)

in some level it mimicks single flow application in some methods as: *sleep*, *selector* and *@threaded_wrapper*

A more deatailed documentation is in progress.

Usage Example


example using pygel

import socket
from gel import Gel

reactor = Gel()
socket_server = socket.socket()
socket_server.bind(("", 12345))
my_socket = socket.socket()
connection, _ = socket_server.accept()

def application():
connection.send(b"some data")
print("sleeping doesn't stop the main_loop")

def on_socket_read(sock):
print("data received", sock.recv(1024))

def timeout():
print("i'm called after the timeout.")

reactor.timeout_call_seconds(3.0, timeout)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygel-0.6.5.tar.gz (13.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page