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.8.7.tar.gz
.
File metadata
- Download URL: wotpy-0.8.7.tar.gz
- Upload date:
- Size: 92.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ddee9f2d29e28fcc7bd808418a3822f1c240ea64258de9f8191f88cd412ccd6 |
|
MD5 | 6a918a3b1aa96b4e938e2ca075ed698b |
|
BLAKE2b-256 | a78329a5dd86e61fba36ca3a589a9992178868f8054c3eec3cc01e691661601f |
File details
Details for the file wotpy-0.8.7-py3-none-any.whl
.
File metadata
- Download URL: wotpy-0.8.7-py3-none-any.whl
- Upload date:
- Size: 150.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44bcd5deda7f3edb582fdc54e98fd4749c8ba2a85a767d2b73a81f94073fb735 |
|
MD5 | d30fa8e2ed3fb063ed2ec6805ba09431 |
|
BLAKE2b-256 | d30fb3fd30385d51e2e27cba41a2dec182244c83cdbf28e577db1a284163eb24 |
File details
Details for the file wotpy-0.8.7-py2-none-any.whl
.
File metadata
- Download URL: wotpy-0.8.7-py2-none-any.whl
- Upload date:
- Size: 149.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 190c3ad87adc8019c5ae07b3a7ec3594f100d5ffc04af2e87936b02b3cc9a06c |
|
MD5 | 2caa038a6bf4d5f1f2aa3ce41b436b88 |
|
BLAKE2b-256 | 1c8d4c535b0a849f100f9877d9a452a27f1a6635de0b24771f324e0352dafff3 |