Check Version

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

[1]:
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"
ENDPOINT = "https://api.beta.multiviz.com"
[4]:
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).

[5]:
session.check_version()
Checking versions for:https://api.beta.multiviz.com
mvg version: 0.12.2
Highest tested API version: 0.3.2
[5]:
{'api_version': '0.3.2',
 'mvg_highest_tested_version': '0.3.2',
 'mvg_version': '0.12.2'}
[ ]: