Check Version Example

This script shows how to check for version compatibility with server side

[1]:
import json
import sys
import logging

# import mvg library with python bindings to mvg-API
from mvg import MVG
[2]:
root_logger = logging.getLogger()
root_logger.setLevel("INFO")
stream_handler = logging.StreamHandler(stream=sys.stderr)
root_logger.addHandler(stream_handler)
[3]:
TOKEN = "NO TOKEN"  # no token is needed for querying the version
ENDPOINT = "https://api.beta.multiviz.com"
session = MVG(ENDPOINT, TOKEN)

It is advised to always check the version of the API against the MVG version. The check_version method will return a dictionary with the server API version, the mvg version and the API version the MVG version it has been tested against. If there is mismatch or incompatibility it will raise an exception and if there is a newer compatible version running on the server it will raise a warning. In the latter case, you should upgrade the MVG version (but you are not required to do so).

[4]:
version = json.dumps(session.check_version())



Checking versions for:https://api.beta.multiviz.com
mvg version: 0.9.0
Highest tested API version: 0.2.0