Skip to main content

Effortless Python RPC with ZeroMQ

Project description


Effortless python remote procedure calling with pickle over ZeroMQ. Allows you to expose a single class instance as an API server over every transport layer that ZeroMQ provides.

Quick Setup

Install wirepickle using your favorite package manager:

$ pip install wirepickle


Next, on your server, annotate the methods you want to expose with the @expose decorator:

from wirepickle.server import expose, Server

class Foo:
    def bar(self):
        return 0

    def baz(self, arg1, kwarg1='baz'):
        return + arg1

Note that you can return anything that can be pickled as a return value, and that stdout will be mirrored to the client.

Then, pass an instance of the class to the Server constructor to create the server. To start listening, call the Server#listen() method on the constructed server with a bind URI:

if __name__ == '__main__':
    instance = Foo()



Simply pass a URI to connect to and start using the methods.

from wirepickle.client import Client

foo = Client('tcp://')

If desired, you can pass a timeout kwarg to the Client constructor:

foo = Client('tcp://', timeout=1_000) # milliseconds

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

wirepickle-1.0.1.tar.gz (4.3 kB view hashes)

Uploaded source

Built Distribution

wirepickle-1.0.1-py3-none-any.whl (5.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page