tracesuite – tracesuite commons

Python interface to TRACE and POST.

This is the root module of the Python interface of TRACE and POST. It contains common attributes of both interfaces like shared enumeration classes and basic information like the version of the Python interface:

print(f"TraceSuite Version: {tracesuite.version}")
print(f"PyTraceSuite API:   {tracesuite.api_version}")

The specific interfaces for TRACE and POST are implemented in the sub-packages trace and post respectively.

tracesuite.api_version = <TraceSuiteVersion('1.0')>

Current pytracesuite API version.

It is recommended in any script importing pytracesuite to check for the correct API version. This allows for early error messages and warnings if the interface did change. api_version does have a major (the first number) and a minor part (the second number). These are accessible as attribute as well.

The minor part is changed, when there is new functionality in the API, that means there are new classes, functions or new optional arguments to one of the former.

A change in the major version number indicates a broken backwards compatibility. Some functions were removed from the API or some arguments changed their meaning or were removed.

#!/usr/bin/env python3
import tracesuite

assert(1 <= tracesuite.api_version.major <= 2)  # only allow API version 1 or 2

print(f"Using pytracesuite API {tracesuite.api_version}")

post = tracesuite.post.POST()

if tracesuite.api_version.major == 1:
    post.version_1_function()
else:
    assert(tracesuite.api_version.major == 2)
    post.version_1_function(changed_args)
    post.version_2_function()
    if tracesuite.api_version.minor >= 3:
        post.function_new_in_2_3()
tracesuite.version = <TraceSuiteVersion('9.8.1')>

tracesuite version.

This is the version of the TraceSuite. It is based on the semantic versioning standard.

It consists of three parts (MAJOR.MINOR.PATCH). MAJOR and MINOR are increased every official release, while the PATCH part is increased every single commit. These are accessible as attributes.

#!/usr/bin/env python3
import tracesuite

print(f"Using tracesuite version {tracesuite.version}")