ivwjson

JSON Module API

Bindings for converting Inviwo Properties, Inports, and Outports to and from JSON-compatible Python objects (dicts, lists, etc). The conversions go through the converter registries owned by the JSONModule.

Example:

import inviwopy
import ivwjson

prop = inviwopy.properties.FloatProperty("threshold", "Threshold", 0.5)
data = ivwjson.toJson(prop)        # -> Python dict
ivwjson.fromJson(prop, data)       # update prop from a dict

Functions

fromJson(*args, **kwargs)

Overloaded function.

getJSONInportConverter()

Get the global JSONInportConverter from the JSON module.

getJSONOutportConverter()

Get the global JSONOutportConverter from the JSON module.

getJSONPropertyConverter()

Get the global JSONPropertyConverter from the JSON module.

toJson(*args, **kwargs)

Overloaded function.

Classes

JSONInportConverter

JSONOutportConverter

JSONPropertyConverter

class ivwjson.JSONInportConverter

Bases: pybind11_object

__init__(*args, **kwargs)
fromJson(self: ivwjson.JSONInportConverter, data: object, obj: inviwopy.Inport) → None
hasConverter(self: ivwjson.JSONInportConverter, classIdentifier: str) → bool
toJson(self: ivwjson.JSONInportConverter, obj: inviwopy.Inport) → object
class ivwjson.JSONOutportConverter

Bases: pybind11_object

__init__(*args, **kwargs)
fromJson(self: ivwjson.JSONOutportConverter, data: object, obj: inviwopy.Outport) → None
hasConverter(self: ivwjson.JSONOutportConverter, classIdentifier: str) → bool
toJson(self: ivwjson.JSONOutportConverter, obj: inviwopy.Outport) → object
class ivwjson.JSONPropertyConverter

Bases: pybind11_object

__init__(*args, **kwargs)
fromJson(self: ivwjson.JSONPropertyConverter, data: object, obj: inviwopy.properties.Property) → None
hasConverter(self: ivwjson.JSONPropertyConverter, classIdentifier: str) → bool
toJson(self: ivwjson.JSONPropertyConverter, obj: inviwopy.properties.Property) → object
ivwjson.fromJson(*args, **kwargs)

Overloaded function.

  1. fromJson(property: inviwopy.properties.Property, data: object) -> None

Update a Property from a JSON-compatible Python object.

  1. fromJson(inport: inviwopy.Inport, data: object) -> None

Update an Inport from a JSON-compatible Python object.

  1. fromJson(outport: inviwopy.Outport, data: object) -> None

Update an Outport from a JSON-compatible Python object.

ivwjson.getJSONInportConverter() → ivwjson.JSONInportConverter

Get the global JSONInportConverter from the JSON module.

ivwjson.getJSONOutportConverter() → ivwjson.JSONOutportConverter

Get the global JSONOutportConverter from the JSON module.

ivwjson.getJSONPropertyConverter() → ivwjson.JSONPropertyConverter

Get the global JSONPropertyConverter from the JSON module.

ivwjson.toJson(*args, **kwargs)

Overloaded function.

  1. toJson(property: inviwopy.properties.Property) -> object

Convert a Property to a JSON-compatible Python object.

  1. toJson(inport: inviwopy.Inport) -> object

Convert an Inport to a JSON-compatible Python object.

  1. toJson(outport: inviwopy.Outport) -> object

Convert an Outport to a JSON-compatible Python object.