Python implementation of a W3C WoT Runtime and the WoT Scripting API
Project description
WoTPy
Introduction
WoTPy is an experimental implementation of a W3C WoT Runtime and the W3C WoT Scripting API in Python.
Inspired by the exploratory implementations located in the thingweb GitHub page.
Features
- Supports Python 2.7, 3.6 and 3.7.
- Fully-implemented
WoT
interface. - Multicast discovery based on mDNS.
- Asynchronous I/O programming model based on coroutines.
- Multiple client and server Protocol Binding implementations.
Feature support matrix
Feature | Python 2.7 | Python 3 | Implementation based on |
---|---|---|---|
HTTP binding | :heavy_check_mark: | :heavy_check_mark: | tornadoweb/tornado |
WebSockets binding | :heavy_check_mark: | :heavy_check_mark: | tornadoweb/tornado |
CoAP binding | :heavy_multiplication_x: | :heavy_check_mark: | chrysn/aiocoap |
MQTT binding | :heavy_multiplication_x: | :heavy_check_mark: | beerfactory/hbmqtt |
mDNS discovery | :heavy_multiplication_x: | :heavy_check_mark: | jstasiak/python-zeroconf |
Couroutine APIs
WoTPy is based on the Tornado Framework. Users therefore have two different API options to write code based on coroutines:
- Users on Python 3 may use the native asyncio module. This is, in fact, the recommended approach. It should be noted that Tornado on Python 3 acts basically as a wrapper around
asyncio
. - Users on Python 2.7 are restricted to writing Tornado coroutines (
asyncio
is not available on Python 2.7).
ToDo
- Add missing sections to docs and deploy on a public site.
- Subscription to Thing Description changes.
- Validation of data schemas.
- Enable Action handlers to return Observables.
- Update protocol bindings to accept event subscription and cancellation data.
Installation
pip install wotpy
Development
To install in development mode with all the test dependencies:
pip install -U -e .[tests]
To run the tests in all supported environments:
WOTPY_TESTS_MQTT_BROKER_URL=mqtt://broker-url tox
Docs
Move to the docs
folder and run:
make html
If you attempt to build the docs on a non-Linux platform or with Python 2.7 _autosummary
will complain about being unable to import the unsupported modules (e.g. MQTT on Python 2.7). In this case the docs will be missing the sections regarding unsupported features.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file wotpy-0.14.5.tar.gz
.
File metadata
- Download URL: wotpy-0.14.5.tar.gz
- Upload date:
- Size: 94.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd7307657f71bec5cc2fbfe81e44cd5d09eeac81fe99706473d85b7d17216803 |
|
MD5 | 2872364330a202e7c7fb3a644768795f |
|
BLAKE2b-256 | 40658d18f4996b6d9e79813cd15a4f2c2c389e895ad772c19fd23a62e1290430 |
File details
Details for the file wotpy-0.14.5-py3-none-any.whl
.
File metadata
- Download URL: wotpy-0.14.5-py3-none-any.whl
- Upload date:
- Size: 151.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8465728fb0c1d69c317ef7098a47392d1e4b3a45e74396522b90c229fec05ccd |
|
MD5 | 3191b0dc11a486a4488a963c6bbfcc8e |
|
BLAKE2b-256 | a2a3c5c4b39d13188a8042faadab59fd8e2d603650a692498d7716954b99c4d7 |
File details
Details for the file wotpy-0.14.5-py2-none-any.whl
.
File metadata
- Download URL: wotpy-0.14.5-py2-none-any.whl
- Upload date:
- Size: 151.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad23da885fe001091d3a4b197eb7b079679615b1f97df5ac33000b61b26aa778 |
|
MD5 | aac8e005bac1cbbd731480cd2139dd82 |
|
BLAKE2b-256 | 907f9d506032eba301ff1313e7180d85894622bf8e03135d947b519b94ba1903 |