data.interface package

Submodules

data.interface.exceptions module

Defines exceptions that can occur when interacting with data interfaces

exception data.interface.exceptions.InvalidInterface(name, description)

Bases: util.exceptions.ValidationException

Exception indicating that the interface is invalid

exception data.interface.exceptions.InvalidInterfaceConnection(name, description)

Bases: util.exceptions.ValidationException

Exception indicating that the interface connection is invalid

data.interface.interface module

Defines the class for handling a data interface

class data.interface.interface.Interface

Bases: object

Represents a grouping of parameters

add_parameter(parameter)

Adds the parameter to the interface

Parameters:parameter (data.interface.parameter.Parameter) – The parameter to add

:raises data.interface.exceptions.InvalidInterface: If the parameter is a duplicate

add_parameter_from_output_interface(input_name, output_name, output_interface)

Adds an output parameter from the given output interface to this interface with the given input name. This is used to create a connecting interface that can be validated for passing to another interface.

Parameters:
  • input_name (string) – The name of the input parameter to add
  • output_name (string) – The name of the output parameter in the output interface
  • output_interface (data.interface.interface.Interface) – The output interface
Returns:

A list of warnings discovered during validation

Return type:

list()

:raises data.interface.exceptions.InvalidInterfaceConnection: If the interface connection is invalid

validate()

Validates this interface

Returns:A list of warnings discovered during validation
Return type:list()

:raises data.interface.exceptions.InvalidInterface: If the interface is invalid

validate_connection(connecting_interface)

Validates that the given connecting interface can be accepted by this interface

Parameters:connecting_interface (data.interface.interface.Interface) – The interface attempting to connect to this interface
Returns:A list of warnings discovered during validation
Return type:list()

:raises data.interface.exceptions.InvalidInterfaceConnection: If the interface connection is invalid

data.interface.parameter module

Defines the classes for handling a data parameter for an interface

class data.interface.parameter.FileParameter(name, media_types, required=True, multiple=False)

Bases: data.interface.parameter.Parameter

Represents a file(s) parameter

PARAM_TYPE = u'file'
validate_connection(connecting_parameter)

See data.interface.parameter.Parameter.validate_connection()

class data.interface.parameter.JsonParameter(name, json_type, required=True)

Bases: data.interface.parameter.Parameter

Represents a JSON parameter

PARAM_TYPE = u'json'
VALID_JSON_TYPES = [u'array', u'boolean', u'integer', u'number', u'object', u'string']
validate()

See data.interface.parameter.Parameter.validate()

validate_connection(connecting_parameter)

See data.interface.parameter.Parameter.validate_connection()

class data.interface.parameter.Parameter(name, param_type, required=True)

Bases: object

Represents an interface parameter

copy()

Returns a copy of this parameter

Returns:A copy of this parameter
Return type:data.interface.parameter.Parameter
validate()

Validates this parameter

Returns:A list of warnings discovered during validation
Return type:list()

:raises data.interface.exceptions.InvalidInterface: If the interface is invalid

validate_connection(connecting_parameter)

Validates that the given connecting parameter can be accepted by this parameter

Parameters:connecting_parameter (data.interface.parameter.Parameter) – The parameter attempting to connect to this parameter
Returns:A list of warnings discovered during validation
Return type:list()

:raises data.interface.exceptions.InvalidInterfaceConnection: If the interface connection is invalid

Module contents