LoadYAML

MacroModule
genre Other
author Jan-Martin Kuhnigk
package FMEwork/ReleaseMeVis
definition LoadYAML.def
see also ReadYAML
keywords yaml, json, config, file, load, open, python, object

Purpose

Converts the content of a YAML (https://en.wikipedia.org/wiki/YAML) file into a python object.

Usage

Choose the source file at YAML File Name and press update. The loaded object will become available at outPythonObject.

Details

Note that an empty file will result as an error as a None object cannot be transmitted as a python object.

Windows

Default Panel

../../../Projects/YAMLSupport/Modules/mhelp/Images/Screenshots/LoadYAML._default.png

Output Fields

outPythonObject

name: outPythonObject, type: MLBase

Python object (string, number, list, dict) representing the YAML input file contents, or None on error/empty file.

Parameter Fields

Visible Fields

YAML File Name

name: inFilename, type: String

Name of the YAML file to load.

Expand environment variables (e.g. ${HOME}) in values

name: inExpandEnvironmentVariables, type: Bool, default: FALSE

If enabled, values (not keys!) referencing valid environment variables via $ABC or ${ABC} are expanded during import.

Output Object Datatype

name: outDatatype, type: String, persistent: no

Datatype of the toplevel python object read.

Update

name: update, type: Trigger

Initiates update of all output field values.

Clear

name: clear, type: Trigger

Clears all output field values to a clean initial state.

On Input Change Behavior

name: onInputChangeBehavior, type: Enum, default: Clear, deprecated name: shouldAutoUpdate,shouldUpdateAutomatically

Declares how the module should react if a value of an input field changes.

Values:

Title Name Deprecated Name
Update Update TRUE
Clear Clear FALSE

[]

name: updateDone, type: Trigger, persistent: no

Notifies that an update was performed (Check status interface fields to identify success or failure).

Has Valid Output

name: hasValidOutput, type: Bool, persistent: no

Indicates validity of output field values (success of computation).

Status Code

name: statusCode, type: Enum, persistent: no

Reflects module’s status (successful or failed computations) as one of some predefined enumeration values.

Values:

Title Name
Ok Ok
Invalid input object Invalid input object
Invalid input parameter Invalid input parameter
Internal error Internal error

Status Message

name: statusMessage, type: String, persistent: no

Gives additional, detailed information about status code as human-readable message.

Hidden Fields

doNotClearOnFailedUpdate

name: doNotClearOnFailedUpdate, type: Bool, persistent: no

Prevents automated clear after update failed. This does not affect status fields. It enables the developer to analyze module’s state after failure.