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

Uploaded Source

Built Distributions

wotpy-0.14.4-py3-none-any.whl (151.4 kB view details)

Uploaded Python 3

wotpy-0.14.4-py2-none-any.whl (151.4 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: wotpy-0.14.4.tar.gz
  • Upload date:
  • Size: 94.0 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.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.15

File hashes

Hashes for wotpy-0.14.4.tar.gz
Algorithm Hash digest
SHA256 d03c765682ee17f45621ac1b25175a7432801ac76ef3c40a82f0c06cc2c98b18
MD5 585ddcf6d56a759ba0710a8bb271fc1e
BLAKE2b-256 8d72565379df7dec23211448e9e3998a9a930075406bbc59ca7a2d3c3f6ab751

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wotpy-0.14.4-py3-none-any.whl
  • Upload date:
  • Size: 151.4 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.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.7

File hashes

Hashes for wotpy-0.14.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc7dcaee6357b7d83612a22a410f7c71ed90db631a4c703b6d0003b1db0412e5
MD5 5e9a3acaae864e33bd68088cae114b49
BLAKE2b-256 ccdeb4455d3f00b8cc6029bda76aecba3552ce4d1530c1b3e425df1486dfc9f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wotpy-0.14.4-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.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.15

File hashes

Hashes for wotpy-0.14.4-py2-none-any.whl
Algorithm Hash digest
SHA256 d90a1d57dadd96c9fcefb9aad2663e293a7bf682ad161e09c2cd99940bcb65bf
MD5 50093d27c45bf32f2abe7421b8b5d016
BLAKE2b-256 7e494135138ffa6ee94f564dc571575ebd3eb144fc2a96ba235ac6fbc3f4fa8a

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