Runtime Python API Reference

The themis.runtime module provides functions and operations for applications launched by Themis.

themis.runtime.fetch_run()[source]

Return the themis.CompositeRun object for the current run.

Raises:

RuntimeError – if called outside of the Themis runtime environment.

themis.runtime.fetch_run_id()[source]

Return the integer ID of the current run.

Raises:

RuntimeError – if called outside of the Themis runtime environment.

themis.runtime.parse_file(source, destination, sample=None)[source]

Parse and token-replace a text file based on the key-value pairs in sample.

Parameters:
  • source – the path to the text file to parse.

  • destination – the destination for the resulting parsed file

  • sample – the key-value pairs to use for the token-replacement operation. If None, fetch the sample by calling themis.runtime.run().sample.

themis.runtime.set_result(result)[source]

Set the result for the current run.

result should be an arbitrary Python object consisting only of built-in types, rather than custom classes.

Raises:

RuntimeError – if called outside of the Themis runtime environment.

themis.runtime.themis_handle()[source]

Return a themis.Themis handle for the current ensemble.

Raises:

RuntimeError – if called outside of the Themis runtime environment.