Skip to main content

Python CoAP library

Project description

The aiocoap package is an implementation of CoAP, the Constrained Application Protocol.

It is written in Python 3 using its native asyncio methods to facilitate concurrent operations while maintaining an easy to use interface.

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.

Usage

For how to use the aiocoap library, have a look at the guidedtour, or at the examples and tools provided.

A full reference is available in the API documentation.

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

Features / Standards

This library supports the following standards in full or partially:

  • RFC7252 (CoAP): Supported for clients and servers. Multicast is supported on the server side, and partially for clients. DTLS is supported but experimental, and lacking some security properties. No caching is done inside the library.

  • RFC7641 (Observe): Basic support for clients and servers. Reordering, re-registration, and active cancellation are missing.

  • RFC7959 (Blockwise): Supported both for atomic and random access.

  • RFC8323 (TCP, WebSockets): Supports CoAP over TCP, TLS, and WebSockets (both over HTTP and HTTPS). The TLS parts are server-certificate only; preshared, raw public keys and client certificates are not supported yet.

  • RFC7967 (No-Response): Supported.

  • RFC8132 (PATCH/FETCH): Types and codes known, FETCH observation supported.

  • draft-ietf-core-resource-directory: A standalone resource directory server is provided along with a library function to register at one. They lack support for groups and security considerations, and are generally rather simplistic.

  • RFC8613 (OSCORE): Full support client-side; protected servers can be implemented based on it but are not automatic yet.

  • draft-ietf-core-oscore-groupcomm-11 (Group OSCORE): Supported for both group and pairwise mode in groups that are fully known. (The lack of an implemented joining or persistence mechanism makes this impractical for anything but experimentation.)

If something described by one of the standards but not implemented, it is considered a bug; please file at the github issue tracker. (If it’s not on the list or in the excluded items, file a wishlist item at the same location).

Dependencies

Basic aiocoap works out of the box on Python 3.7 or newer (also works on PyPy3). For full support (DTLS, OSCORE and link-format handling) follow the installation instructions as these require additional libraries.

aiocoap provides different network backends for different platforms. The most featureful backend is available for Linux, but most operations work on BSDs, Windows and macOS as well. See the FAQ for more details.

If your library depends on aiocoap, it should pick the required extras (as per installation) and declare a dependency like aiocoap[linkheader,oscore] >= 0.4b2.

Development

aiocoap tries to stay close to PEP8 recommendations and general best practice, and should thus be easy to contribute to.

Bugs (ranging from “design goal” and “wishlist” to typos) are currently tracked in the github issue tracker. Pull requests are welcome there; if you start working on larger changes, please coordinate on the issue tracker.

Documentation is built using sphinx with ./setup.py build_sphinx; hacks used there are described in ./doc/README.doc.

Unit tests are implemented in the ./tests/ directory and easiest run using tox (though still available through ./setup.py test for the time being); 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). The tests are regularly run at the CI suite at gitlab, from where coverage reports are available.

Relevant URLs

Licensing

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

When using aiocoap for a publication, please cite it according to the output of ./setup.py cite [--bibtex].

Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>,

2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at>

Project details


Download files

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

Source Distribution

aiocoap-0.4.2.tar.gz (210.0 kB view details)

Uploaded Source

Built Distribution

aiocoap-0.4.2-py3-none-any.whl (188.8 kB view details)

Uploaded Python 3

File details

Details for the file aiocoap-0.4.2.tar.gz.

File metadata

  • Download URL: aiocoap-0.4.2.tar.gz
  • Upload date:
  • Size: 210.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.9

File hashes

Hashes for aiocoap-0.4.2.tar.gz
Algorithm Hash digest
SHA256 175f8af9228703bee8df5ad0b09949ba465853755c8a0c1206536312d4cc70d0
MD5 fb27d8f49372c914187c300ee489d87b
BLAKE2b-256 96c22051217ba34b6fe37c5c7a88953beb5a00acf2304d92ffb9f84e832f0178

See more details on using hashes here.

File details

Details for the file aiocoap-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: aiocoap-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 188.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.9

File hashes

Hashes for aiocoap-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81432c26672d3c5b961a368226d390926570ee1f70bbeeed035e04cad124e3c4
MD5 95fa23234e93e16a0dc11b701bf1273c
BLAKE2b-256 61f2e80d9d5965d2ff65f671edbb3684e1d64d11f6e7bc1b1ad732eb88dbfc4b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page