Skip to main content

Bidirectionnal RPC Api on top of pyzmq

Project description

Travis-CI Status Coverage Status Documentation Status

Pythonic bidirectional-rpc API built on top of ØMQ with pluggable encryption, authentication and heartbeating support.


  1. ØMQ transport layer.
  2. All native python types supported (msgpack).
  3. First citizen exceptions.
  4. Bi-bidirectional (server can initiate calls to connected clients).
  5. Encryption based on CURVE.
  6. Pluggable Authentication.
  7. Pluggable Heartbeating.
  8. Pluggable Remote Call Routing.
  9. Built-in proxy support. A server can delegate the work to another one.
  10. SyncClient (using zmq.REQ) to use within non event based processes. (Heartbeating, Authentication and job execution are not supported with the SyncClient.)


$ pip install pseud


The Server

from pseud import Server

server = Server('service')

def hello(name):
    return 'Hello {0}'.format(name)

await server.start()  # this will block forever

The Client

from pseud import Client

client = Client('service', io_loop=loop)

# Assume we are inside a coroutine
async with client:
    response = await client.hello('Charly')
    assert response == 'Hello Charly'

The SyncClient

# to use within a non-asynchronous process or in a command interpreter
from pseud import SyncClient

client = SyncClient()

assert client.hello('Charly') == 'Hello Charly'

The Server send a command to the client

It is important to note that the server needs to know which peers are connected to it. This is why the security_plugin trusted_peer comes handy. It will register all peer id and be able to route messages to each of them.

from pseud import Server

server = Server('service', security_plugin='trusted_peer')

def hello(name):
    return 'Hello {0}'.format(name)

await server.start()  # this will block forever

The client needs to send its identity to the server. This is why plain security plugin is used. The server will not check the password, he will just take into consideration the user_id to perform the routing.

from pseud import Client

client = Client('service',

# Action that the client will perform when
# requested by the server.
def sheep():
    return 'beeeh'

Back on server side, we can send to it any commands the client is able to do.

# assume we are inside a coroutine
sheep = await server.send_to('alice')
assert sheep == 'beeeh'


Pseud on Readthedocs

Copyright 2014 ezeep GmbH

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details

Download files

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

Files for pseud, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size pseud-1.0.1-py3-none-any.whl (16.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pseud-1.0.1.tar.gz (12.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page