Skip to main content

Python CoAP library

Project description

aiocoap -- The Python CoAP library

The aiocoap package is a Python implementation of CoAP, the Constrained
Application Protocol (`RFC 7252`_, more info at

It uses the asyncio module introduced in Python 3.4 to facilitate concurrent
operations while maintaining a simple to use interface and not depending on
anything outside the standard library.

aiocoap is originally based on txThings_. If you want to use CoAP in your
existing twisted application, or can not migrate to Python 3 yet, that is
probably more useful to you than aiocoap.

.. _`RFC 7252`:
.. _txThings:


For details on how to use the aiocoap library, have a look at the :mod:`aiocoap`
module documentation, or at the :doc:`examples` and :doc:`tools` provided.

All examples can be run directly from a source code copy. If you prefer to
install it, the usual Python mechanisms apply.


The core aiocoap functionality works out of the box with Python_ 3.4; with the
additional asyncio_ module, it works with version 3.3 as well.

When application/link-format typed resources (`RFC 6690`_) are supposed to be
used, the `link_header`_ module is required as well. When the respective code
paths are used without the module, an `ImportError` will be raised, or a `5.00`
status code will be returned.

.. _Python:
.. _asyncio:
.. _`RFC 6690`:
.. _`link_header`:


aiocoap tries to stay close to PEP8_ recommendations and general best practice,
and should thus be easy to contribute to. Unit tests are implemented in the
``./tests/`` directory; complete test coverage is aimed for, but not yet
complete (and might never be, as the error handling for pathological network
partners is hard to trigger with a library designed not to misbehave).

Documentation is built using sphinx_; hacks used there are described in

Bugs from design goal and wishlist to typos are currently tracked in github
(see below).

.. _PEP8:
.. _sphinx:

Relevant URLs


This is where the latest source code can be found, and bugs can be reported.
Generally, this serves as the project web site.


Online documentation built from the sources.


aiocoap is published under the MIT License, see :doc:`LICENSE` for details.

Copyright (c) 2012-2014 Maciej Wasilak <>,
2013-2014 Christian Amsüss <>

Project details

Download files

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

Files for aiocoap, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size aiocoap-0.2.tar.gz (50.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page