Skip to content
This repository has been archived by the owner on Dec 9, 2017. It is now read-only.

teaminsight-legacy/python-bertrpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BERTRPC

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 requests
  • cast requests

Installation

Install from PyPI:

easy_install insight-bertrpc

Examples

Import the library and create an RPC client:

import bertrpc
service = bertrpc.Service('localhost', 9999)

Make a call:

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.

Make a cast:

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.

Running the unit tests

To run the unit tests, execute the following command from the root of the project directory:

python tests.py

Copyright

Copyright (c) 2009 Michael J. Russo. See LICENSE for details.

About

BERTRPC is a Python BERT-RPC client library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%