Skip to main content

Virtual Object python implementation using a W3C WoT Runtime and the WoT Scripting API

Project description

VO-WoT

This repository is based on the Web of Things Python implementation WoTPy.

PyPI

Introduction

This repository is a fork of the original WoTPy repository.

VO-WoT 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 Eclipse thingweb GitHub page.

Features

  • Supports Python 3 with versions >= 3.8
  • 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

Installation

pip install vo-wot

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.8 :: OK
Python 3.9 :: OK
Python 3.10 :: OK
Python 3.11 :: 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.8 ./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

The documentation is currently hosted here.

Alternatively to build the documentation, 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

vo_wot-0.18.12.tar.gz (99.8 kB view details)

Uploaded Source

Built Distribution

vo_wot-0.18.12-py3-none-any.whl (146.6 kB view details)

Uploaded Python 3

File details

Details for the file vo_wot-0.18.12.tar.gz.

File metadata

  • Download URL: vo_wot-0.18.12.tar.gz
  • Upload date:
  • Size: 99.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for vo_wot-0.18.12.tar.gz
Algorithm Hash digest
SHA256 572719f8ab07a8fa8bda6e36f11a9a42aa4089b7eaabee89947d94de7808d292
MD5 17a1ea9fa1081e5475b70a7405049179
BLAKE2b-256 15fc027f7e4d6d5d487ef26a1130a653ade01b970e57ab603e6fd04b5e1a2a6e

See more details on using hashes here.

File details

Details for the file vo_wot-0.18.12-py3-none-any.whl.

File metadata

  • Download URL: vo_wot-0.18.12-py3-none-any.whl
  • Upload date:
  • Size: 146.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for vo_wot-0.18.12-py3-none-any.whl
Algorithm Hash digest
SHA256 8ddd8e8b387c178ea7e40e75ec69e9485fe1a2679f32c4db92cefdedd37a5afd
MD5 dd2958e6b7671b89e59ac9eae6a5be4f
BLAKE2b-256 61c9fe371212c55bea4de89b8a3e7fcd27186a9917a532dbf3d39c6eca61445d

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