A BERT-RPC client library for Python. A port of Tom Preston-Werner's Ruby library.
This is a fork of mjrusso/python-bertrpc.
See the full BERT-RPC specification at bert-rpc.org.
This library currently only supports the following BERT-RPC features:
call
requestscast
requests
Install from PyPI:
easy_install insight-bertrpc
Import the library and create an RPC client:
import bertrpc
service = bertrpc.Service('localhost', 9999)
response = service.request('call').calc.add(1, 2)
Note that the underlying BERT-RPC transaction of the above call is:
-> {call, calc, add, [1, 2]}
<- {reply, 3}
In this example, the value of the response
variable is 3
.
service.request('cast').stats.incr()
Note that the underlying BERT-RPC transaction of the above cast is:
-> {cast, stats, incr, []}
<- {noreply}
The value of the response
variable is None
for all successful cast calls.
To run the unit tests, execute the following command from the root of the project directory:
python tests.py
Copyright (c) 2009 Michael J. Russo. See LICENSE for details.