cara: Capnproto Alternative RPC API

Build Status Coverage Status Codacy Badge Documentation Status PyPI Version PyPI License

What is this?

This is a Python library that provides Cap'n proto as the schema layer on top of an RPC layer.

Currently, cara works with pseud, but it has been designed to work with any RPC library. If you use another one, feel free contact us to help integrate it.

Getting Started

Once you've installed capnproto and cara, you should be ready to go.

This script installs capnp to /usr/local/, but feel free to put it anywhere, as long as 'capnp' is on the PATH later on.


From here, we're going to assume you want to use this with pseud as the RPC layer. If you don't, then refer to your RPC layer's installation instructions.

Installing pseud

pseud requires zeromq 4.1 or later, so install that first.

export CARA_EXTRA="[pseud]"

Installing cara

Now you can install cara and this will build everything you need. If you're using an extra, such as pseud, set CARA_EXTRA to that.

pip install .$CARA_EXTRA

Using schemas with cara

Then you can define a schema in a .capnp file:

capnp compile -ocara filename.capnp
# Outputs

Using structs, interfaces, etc.

Refer to Structs and Interfaces, and Advanced Usage if you're interested.