Skip to main content

Python implementation of a W3C WoT Runtime and the WoT Scripting API

Project description

WoTPy

Build Status Coverage Status

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

Install in development mode:

pip install -U -e .[tests]

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


Download files

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

Source Distribution

wotpy-0.8.6.tar.gz (92.9 kB view details)

Uploaded Source

Built Distributions

wotpy-0.8.6-py3-none-any.whl (149.9 kB view details)

Uploaded Python 3

wotpy-0.8.6-py2-none-any.whl (149.9 kB view details)

Uploaded Python 2

File details

Details for the file wotpy-0.8.6.tar.gz.

File metadata

  • Download URL: wotpy-0.8.6.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

Hashes for wotpy-0.8.6.tar.gz
Algorithm Hash digest
SHA256 dc29b18021dfe7a72fe33b559f333c9cafc5eb40e503e48254cdd41580e6d543
MD5 284d54b0ed57c5b942153f4717de45c7
BLAKE2b-256 467af00b65e693abfbbf134919a23795d3c3ab9795fdac2109acdbba1734d11f

See more details on using hashes here.

File details

Details for the file wotpy-0.8.6-py3-none-any.whl.

File metadata

  • Download URL: wotpy-0.8.6-py3-none-any.whl
  • Upload date:
  • Size: 149.9 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

Hashes for wotpy-0.8.6-py3-none-any.whl
Algorithm Hash digest
SHA256 122710752678ba2d22231c0f40d1a319b56755c1613152861dd0ee5ea79bde96
MD5 f6965a848e23d9c36ce440f3b2db3bd4
BLAKE2b-256 585a779e88e8750ec2312bced788b455ff8b543c45b27ade23545844f43490b3

See more details on using hashes here.

File details

Details for the file wotpy-0.8.6-py2-none-any.whl.

File metadata

  • Download URL: wotpy-0.8.6-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

Hashes for wotpy-0.8.6-py2-none-any.whl
Algorithm Hash digest
SHA256 fd53e59889ef952c3f39ab174d25e46fbe2f1cbcbb8d7a199b619d4c1466ed93
MD5 71abe4cd56c8b32f9f22569e7976b216
BLAKE2b-256 5fced7e9c338aef545777eca09c6123a10c47f6b4c521ccb3af6132cdd0a3471

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