Skip to main content

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

Project description

VO-WoT

This repository is an updated version of WoTPy.

PyPI

Introduction

This repository is a fork of the original WoTPy repository.

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 3 with versions >= 3.9
  • Fully-implemented WoT interface.
  • Asynchronous I/O programming model based on coroutines.
  • Multiple client and server Protocol Binding implementations.

Feature support matrix

Feature Python 3 Implementation based on
HTTP binding :heavy_check_mark: tornadoweb/tornado
WebSockets binding :heavy_check_mark: tornadoweb/tornado
CoAP binding :heavy_check_mark: chrysn/aiocoap
MQTT binding :heavy_check_mark: Yakifo/amqtt
Zenoh binding :heavy_check_mark: eclipse-zenoh/zenoh-python

Installation

pip install wotpy2

Development

To install in development mode with all the test dependencies:

pip install -U -e .[tests,docs]

Some WoTPy features (e.g. CoAP binding) are not available outside of Linux. If you have Docker available in your system, and want to easily run the tests in a Linux environment (whether you're on macOS or Windows) you can use the Docker-based test script:

$ WOTPY_TESTS_MQTT_BROKER_URL=mqtt://192.168.1.141 ./pytest-docker-all.sh
...
+ docker run --rm -it -v /var/folders/zd/02pk7r3954s_t03lktjmvbdc0000gn/T/wotpy-547bed6bacf34ddc95b41eceb46553dd:/app -e WOTPY_TESTS_MQTT_BROKER_URL=mqtt://192.168.1.141 python:3.9 /bin/bash -c 'cd /app && pip install -U .[tests] && pytest -v --disable-warnings'
...
Python 3.9 :: OK
Python 3.10 :: OK
Python 3.11 :: OK
Python 3.12 :: OK
Python 3.13 :: OK

WOTPY_TESTS_MQTT_BROKER_URL defines the url of the MQTT broker. It will listen to port 1883 by default. If your broker is set up in a different way, you can provide the port in the url as well.

WOTPY_TESTS_ZENOH_ROUTER_URL defines the url of the Zenoh router. An example router url value is tcp/192.168.1.1:7447 assuming the router is bound on the interface with the IP 192.168.1.1 and listens to port 7447. Check the Zenoh router's output (zenohd command) for more info.

You can also test only for a specific Python version with the PYTHON_TAG variable and the pytest-docker.sh script like this:

$ WOTPY_TESTS_MQTT_BROKER_URL=mqtt://192.168.1.141 PYTHON_TAG=3.9 ./pytest-docker.sh

Development in VSCode with devcontainers

We have also provided a convenient devcontainer configuration to better recreate your local development environment. VSCode should detect it if you have the Remote - Containers extension installed.

Docs

Move to the docs folder and run:

make html

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

wotpy2-0.1.0.tar.gz (89.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wotpy2-0.1.0-py3-none-any.whl (130.0 kB view details)

Uploaded Python 3

File details

Details for the file wotpy2-0.1.0.tar.gz.

File metadata

  • Download URL: wotpy2-0.1.0.tar.gz
  • Upload date:
  • Size: 89.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wotpy2-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0320ee69f9bbaac883315310aaab3be6b00aaa8b8e029bcce0a88233d16432ff
MD5 aca9897f4c600b1a46ddc60145958bc8
BLAKE2b-256 46a5019ef8ccd3567d6b73c6a6395a0e6722318008a6ba86e8561b74004b5c03

See more details on using hashes here.

File details

Details for the file wotpy2-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wotpy2-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 130.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wotpy2-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49147f6a7b4b88d1e5aab3159402b9afd9fa40bd7462368fb58c7f60fd8ee9c6
MD5 e1174d65f96c3323f2d14833b3aee6d9
BLAKE2b-256 84324f864e9fb38b2a81efe019370273280c512dc5b148eaef66da0d80308507

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page