Check Version Example

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

import json
import sys
import logging

# import mvg library with python bindings to mvg-API
from mvg import MVG
root_logger = logging.getLogger()
stream_handler = logging.StreamHandler(stream=sys.stderr)
TOKEN = "NO TOKEN"  # no token is needed for querying the version

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).

version = json.dumps(session.check_version())

Checking versions for:
mvg version: 0.9.0
Highest tested API version: 0.2.0