Skip to main content

Converter between WoT TD and SDF (including protocol bindings). Work in Progress.

Project description

Build Status codecov Code style: black

SDF-WoT-Converter (Python Edition)

This repository provides a Python-based converter from SDF to WoT TD including Thing Models.

The converter is both usable as a library and a command line tool. It is based on my Rust implementation but is (when it comes to the conversion from SDF to Thing Models) already more mature as development in Python turned out to be much faster. The final version of this converter, however, will be reimplemented in Rust once it is finished to also support more constrained environments.

The CI pipeline is set up to automatically convert all (valid) models from the oneDM playground to WoT Thing Models and upload to the results to this repository.

Installation

After cloning the repository run the following commands in the repo's directory:

pip install -q build
python -m build
pip install --find-links dist/ sdf-wot-converter

You need at least Python 3.6 and pip installed.

Using the command line tool

After installing the libary you should be able to call the converter in your terminal using sdf-wot-converter. You can display available parameters by typing sdf-wot-converter --help. So far, you can only convert from SDF to WoT Thing models but the other direction will be added soon.

Example

# Convert an SDF model to a WoT Thing Model
sdf-wot-converter --from-sdf examples/sdf/example.sdf.json --to-tm converted-example.tm.json

License

This project is licensed under the MIT license.

SPDX-License-Identifier: MIT

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

sdf-wot-converter-0.1.4.tar.gz (14.6 kB view hashes)

Uploaded Source

Built Distribution

sdf_wot_converter-0.1.4-py3-none-any.whl (17.8 kB view hashes)

Uploaded Python 3

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