aiocoap module

aiocoap

The aiocoap package is a library that implements CoAP, the Constrained Application Protocol (RFC 7252, more info at http://coap.technology/).

Usage

In all but the most exotic applications, you will want to create a single Context instance that binds to the network. The Context.create_client_context() and Context.create_server_context() coroutines give you a readily connected context.

On the client side, you can request resources by assembling a Message and passing it to your context’s Context.request() method, which returns a protocol.Request object with a protocol.Request.response future (which is a Message again).

On the server side, a resource tree gets built from aiocoap.resource.Resource objects into a aiocoap.resource.Site, which is assigned to the context at creation time.