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

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


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.14.0.tar.gz (93.9 kB view details)

Uploaded Source

Built Distributions

wotpy-0.14.0-py3-none-any.whl (151.3 kB view details)

Uploaded Python 3

wotpy-0.14.0-py2-none-any.whl (151.2 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: wotpy-0.14.0.tar.gz
  • Upload date:
  • Size: 93.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/2.7.15

File hashes

Hashes for wotpy-0.14.0.tar.gz
Algorithm Hash digest
SHA256 b1ab975a62aff045b08b918f6fcbb0b1c2beea1655ff9d9d3a4241a308f4c21b
MD5 71e0bde644563472c6d8522ea28653b9
BLAKE2b-256 5b103a8a3e71fd77cfec248a24ecc58c8f60cb7230a2101dc83f275c34715da1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wotpy-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 151.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.7

File hashes

Hashes for wotpy-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 577f05bffe964a46825ad5f2a33f8a74f3602b58078508d399632be79bf4e05f
MD5 f4e7e75c0588e1de3757646d32e763c8
BLAKE2b-256 8562e7952cba4d58eb773ec76aaafaa88599488fc550d0806975f7589af0a70e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wotpy-0.14.0-py2-none-any.whl
  • Upload date:
  • Size: 151.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/2.7.15

File hashes

Hashes for wotpy-0.14.0-py2-none-any.whl
Algorithm Hash digest
SHA256 82efec198e13e2c4fe7248767c78d47124c697fef983824f5db47e23eaebb904
MD5 df0821027cc6d66f9a61551cfe0cd99a
BLAKE2b-256 ede394b8f578e0608d403fed47e00a72e3b1794bed51111212a7c01d4521a51c

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