Module pyfx.internal.runenv

Running python scripts in controlled environments.

This module facilitates running a python script interacting with the Pricefx platform in a controlled environmment (e.g. a docker container in a k8s cluster).

Functions

def main() ‑> None

Initialise the job context from environment variables and run the script.

def run(source: str, context: JobContext) ‑> None

Run the source code in the given context.

Classes

class EngineParameters (script: str, parameters: Dict[str, Any])

Represents the parameters given to the engine when launched from a groovy logic.

Class variables

var parameters : Dict[str, Any]
var script : str

Static methods

def from_env() ‑> EngineParameters

Parse the parameters from the env.ENVAR_PARAMETERS environment variable.

This variable should contain a valid json object containing - at least the "script" entry which should be a string - optionally the "parameters" entry which should be a dictionnary that will be used by the script as parameter values (see JobContext.parameters()). The default value is an empty dictionary