Skip to main content

Project description



Why SimRpc

all of the popular rpc framework today, is fast and stable.

but it is kind of not good enough for you to easily start. you have to accept all the rpc's definition,learn their structure, and you have to adapt your code to them.

so if you dont like them,and you havn't have other alternatives. may be SimRpc is suit for you


SimRpc is an rpc tools for you to easily transfer your code to rpc service(both client-side and server-side),built on top of zeromq and msgpack.

  • zeromq

    assures the message transfer extremely fast and stable

  • msgpack

    enables the message blazing small


Your Original Code

class a:
    def minus(self, x, y):
        print("x+y=", x - y)
        return x - y
def add(x, y):
    return x + y

Client Side

1) start an client instance

from simrpc.client import SimRpcClient
rpc_client = SimRpcClient()

or maybe you want to start a specific address

from simrpc.client import SimRpcClient
rpc_client = SimRpcClient(server_address="tcp://localhost:6666")

the server_address is a zeromq address.

for more information you can refer to zeromq.

2) add @rpc_client.task decorator to your code

# response_only=True means you only want the result

class a:

    def minus(self, x, y):
        print("x+y=", x - y)
        return x - y

# func=True means this is a funcion,not a class service

def add(x, y):
    return x + y

3) Use these functions as usual


you must point it out this a rpc client(as use rpc_client=True prameter), otherwise will use local code

Server Side

1) start an server instance

from server import SimRpcServer
server = SimRpcServer()

like client,you can also give specific addresses to server.

parameter value instruction
device_front_address "tcp://" address that receive message. used for client to connect.
device_backend_address "tcp://" address that send message to service worker.
worker_address "tcp://" address that worker connect to. usually the same with device_backend_address.for advanced infomation,you can refer to zeromq

more ways of address(like ipc) are supported, you can refer to zeromq

2) register your service to server

  • initial your class service as usual
service = a()
  • or you let server to initial your service(just pass your init arguments to server.)
settings = {
    "a": {
        "kwargs": {
            "name": "test"
service = a()
# or you can have this class init with server
# server.register_with_init(cls_list=[a], settings=settings)

3) start your rpc server broker

# if you also want to start worker in process ,you could use,this will start a few workers.


with this broker,you can easily expand your service from both client-side and server-side

4) start more workers

# the same as above but without server.start_broker()

For details,you can refer to examples



  • like this project, star it
  • any suggestion is welcome
  • this project is under MIT lisense

more docs are writing.

Download files

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

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

simrpc-1.3.1-py3-none-any.whl (8.0 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