Skip to main content

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

  • 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.5.tar.gz (92.7 kB view details)

Uploaded Source

Built Distributions

wotpy-0.8.5-py3-none-any.whl (149.8 kB view details)

Uploaded Python 3

wotpy-0.8.5-py2-none-any.whl (149.8 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: wotpy-0.8.5.tar.gz
  • Upload date:
  • Size: 92.7 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/3.6.7

File hashes

Hashes for wotpy-0.8.5.tar.gz
Algorithm Hash digest
SHA256 164326778ec2ca3f228d0818456bf6557f5f905c70b627a4fb044d105586b116
MD5 023e80c493ee9468e159984130e0a34c
BLAKE2b-256 294572048944d7e731c510a87f5d719f3e6f2ed9b43f30df8a71847bb640acc7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wotpy-0.8.5-py3-none-any.whl
  • Upload date:
  • Size: 149.8 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c2e8bf7fd910fc387a20aa829fc6780a0603e9a297e9ae0705c28222f4e448cf
MD5 80725d6b1d0fdda6767f88531d75d9f2
BLAKE2b-256 2df0f21bc287a8e773990f924128d94ca7ef55b5cb229fd9ad0491c95476e636

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wotpy-0.8.5-py2-none-any.whl
  • Upload date:
  • Size: 149.8 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.5-py2-none-any.whl
Algorithm Hash digest
SHA256 c5d90c39b2d6646646d39cca6762c7a239997e0258ec6639436c4b2ad0fe2e0b
MD5 e1f0185a5146a333d1711160a753a4a3
BLAKE2b-256 5c5679727bfdfa813d3cc841e041434c04f594eb54d6678806724d1c02515592

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