Pysig is a framework designed to manage event dispatching between two or more registered endpoints. The main philosophy behind a signaling framework, like pysig is, is to simplify the process by whitch a certain endpoint receives events from another, in an efficient and simple way.
One of the most interesting features of pysig is that it has the ability to dispatch messages over network, between different machines or different processes running on the same machine.
To make a very short summary of what pysig can do, we could list the followings:
- it enables subscription mechanisms that are able to:
- register for a specific event triggered by a specific sender
- register for broadcast events triggered by any event fired by a specific sender
- register for broadcast events triggered by any event of any sender
- register for channel events triggered by those senders that share same event
- register listeners without depending on the sender registration
supports firing on-demand requests to connected senders, for accessing data on reply
stateful sender connection, automatically firing connect and disconnect events
distribute events intra-process, inter-process or over a given network
built-in TCP server and TCP client implementation with customizable date encoding (default JSON)
permits custom transport carrier implementation for dispatching events over different communication mediums (like serial connections) or for transporting them under a different format
You can install pysig library using python pip installer:
pip install pysig
Or checkout the latest version from bitbucket using:
hg clone https://bitbucket.org/madlex/pysig
Previously released versions are tagged on hg, so to list them use:
For example, for checking the code corresponding to
hg update 0.7.1
To always use the latest version in your python applications, or a version of your choice, on Linux you can add a symlink in the location where python keeps it’s packages.
mkdir ~/code cd ~/code hg clone https://bitbucket.org/madlex/pysig # hg update <insert_your_desired_version_here> # optional sudo ln -s ~/code/pysig/sig /usr/local/lib/python2.7/dist-packages/sig
Next time you update your repository at
~/code/pysig all your python applications
will automatically import the latest
Throughout this documentation, several examples are provided inline, but most of them
are stored in the
/examples folder, as ready to use applications.
For signaling events locally please see this:
For examples on how to implement a pysig server or a pysig client, how to register a sender that triggers an event over a network, a sender that supports responding to requests and last but not least, how to register remote listeners please check this section:
The current version of pysig is
- improved overall documentation
- refactored requests support
- when a sender connects/disconnects the automatically triggered
#disconnectevent promotes the list of events and requests the sender supports using the data parameter (use data[“events”] and data[“requests”] to fetch the list)
- Initial version
Until pysig reaches it’s first stable version, which will be
1.0.0, the author reserves the right
of changing the API if it’s necessary.
1.0.0 all the versions of pysig sharing the same major number will be API compatible.
The modifications targeted for
1.0.0 version are:
- improve coverage of unit-tests
- improve multi-threading support
- improve ServerRouter and ClientRouter implementation
- improve CarrierTCPClient and CarrierTCPServer implementation
- improve examples
- improve overall documentation structure
- add validation of communication protocol between ServerRouter and ClientRouter
- add SSL support to built-in TCP carriers
- add support for using multiple carriers at once for the very same server
Far fetched objectives:
- add ACL (Access Control List) support, for allowing access only to some listeners
The pysig library is released under the terms and conditions of
For further documentation please check the
LICENCE.txt file located at the root
of the repository.