queenbee.io.reference module

Objects to reference parameters, files and folders from inputs, tasks and items.

class queenbee.io.reference.FileReference(*, type: ConstrainedStrValue = 'FileReference', annotations: Dict[str, Any] = None, path: str)[source]

Bases: _BaseReference

Reference to a file.

path: str
type: ConstrainedStrValue
class queenbee.io.reference.FolderReference(*, type: ConstrainedStrValue = 'FolderReference', annotations: Dict[str, Any] = None, path: str)[source]

Bases: _BaseReference

Reference to a folder.

path: str
property referenced_values: Dict[str, List[str]]

Get referenced variables if any.

Returns:

Dict[str, List[str]] – A dictionary where keys are attributes and values

are lists contain referenced value string.

type: ConstrainedStrValue
class queenbee.io.reference.InputFileReference(*, type: ConstrainedStrValue = 'InputFileReference', annotations: Dict[str, Any] = None, variable: str)[source]

Bases: _InputReferenceBase

An input file reference

property source
type: ConstrainedStrValue
class queenbee.io.reference.InputFolderReference(*, type: ConstrainedStrValue = 'InputFolderReference', annotations: Dict[str, Any] = None, variable: str)[source]

Bases: _InputReferenceBase

An input folder reference

property source
type: ConstrainedStrValue
class queenbee.io.reference.InputPathReference(*, type: ConstrainedStrValue = 'InputPathReference', annotations: Dict[str, Any] = None, variable: str)[source]

Bases: _InputReferenceBase

An input file or folder reference

property source
type: ConstrainedStrValue
class queenbee.io.reference.InputReference(*, type: ConstrainedStrValue = 'InputReference', annotations: Dict[str, Any] = None, variable: str)[source]

Bases: _InputReferenceBase

An input parameter reference which is not a file or a folder.

For a file or a folder use InputFileReference, InputFolderReference or InputPathReference instead.

property source
type: ConstrainedStrValue
class queenbee.io.reference.ItemReference(*, type: ConstrainedStrValue = 'ItemReference', annotations: Dict[str, Any] = None, variable: str = None)[source]

Bases: _BaseReference

An Item Reference.

property source
to_ref_string()[source]

Generate a reference string from an item reference

Returns:

str – A reference string

type: ConstrainedStrValue
variable: str
class queenbee.io.reference.TaskFileReference(*, type: ConstrainedStrValue = 'TaskFileReference', annotations: Dict[str, Any] = None, name: str, variable: str)[source]

Bases: _TaskReferenceBase

A reference to a file that is generated in a task.

property source
type: ConstrainedStrValue
class queenbee.io.reference.TaskFolderReference(*, type: ConstrainedStrValue = 'TaskFolderReference', annotations: Dict[str, Any] = None, name: str, variable: str)[source]

Bases: _TaskReferenceBase

A reference to a folder that is generated in a task.

property source
type: ConstrainedStrValue
class queenbee.io.reference.TaskPathReference(*, type: ConstrainedStrValue = 'TaskPathReference', annotations: Dict[str, Any] = None, name: str, variable: str)[source]

Bases: _TaskReferenceBase

A reference to a file or folder that is generated in a task.

property source
type: ConstrainedStrValue
class queenbee.io.reference.TaskReference(*, type: ConstrainedStrValue = 'TaskReference', annotations: Dict[str, Any] = None, name: str, variable: str)[source]

Bases: _TaskReferenceBase

A Task reference for parameters other than files or folders.

property source
type: ConstrainedStrValue
class queenbee.io.reference.ValueFileReference(*, type: ConstrainedStrValue = 'ValueFileReference', annotations: Dict[str, Any] = None, path: str)[source]

Bases: _BaseReference

A reference to a fixed file.

path: str
type: ConstrainedStrValue
class queenbee.io.reference.ValueFolderReference(*, type: ConstrainedStrValue = 'ValueFolderReference', annotations: Dict[str, Any] = None, path: str)[source]

Bases: ValueFileReference

A reference to a fixed folder.

type: ConstrainedStrValue
class queenbee.io.reference.ValueListReference(*, type: ConstrainedStrValue = 'ValueListReference', annotations: Dict[str, Any] = None, value: List[Any])[source]

Bases: _BaseReference

A reference to a fixed value.

classmethod check_value(v)[source]
type: ConstrainedStrValue
value: List[Any]
class queenbee.io.reference.ValueReference(*, type: ConstrainedStrValue = 'ValueReference', annotations: Dict[str, Any] = None, value: Any)[source]

Bases: _BaseReference

A reference to a fixed value.

type: ConstrainedStrValue
value: Any
queenbee.io.reference.references_from_string(string: str) List[Union[InputReference, TaskReference, ItemReference]][source]

Generate a reference object from a reference string

Parameters:

(eg (string {str} -- A reference string) – {{inputs.example}})

Raises:

ValueError – Input string cannot be parsed as a reference object

Returns:

List[Union[InputReference, TaskReference, ItemReference]] – A list of reference objects

queenbee.io.reference.template_string(keys: List[str]) str[source]

Generate a template string from a list of key

Parameters:

keys (keys {List[str]} -- A list of) –

Returns:

str – A template string