queenbee.io.reference module

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

class queenbee.io.reference.FileReference(*, type: ~typing.Literal['FileReference'] = 'FileReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, path: str)[source]

Bases: _BaseReference

Reference to a file.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

path: str
type: Literal['FileReference']
class queenbee.io.reference.FolderReference(*, type: ~typing.Literal['FolderReference'] = 'FolderReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, path: str)[source]

Bases: _BaseReference

Reference to a folder.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

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: Literal['FolderReference']
class queenbee.io.reference.InputFileReference(*, type: ~typing.Literal['InputFileReference'] = 'InputFileReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, variable: str)[source]

Bases: _InputReferenceBase

An input file reference

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['InputFileReference']
class queenbee.io.reference.InputFolderReference(*, type: ~typing.Literal['InputFolderReference'] = 'InputFolderReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, variable: str)[source]

Bases: _InputReferenceBase

An input folder reference

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['InputFolderReference']
class queenbee.io.reference.InputPathReference(*, type: ~typing.Literal['InputPathReference'] = 'InputPathReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, variable: str)[source]

Bases: _InputReferenceBase

An input file or folder reference

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['InputPathReference']
class queenbee.io.reference.InputReference(*, type: ~typing.Literal['InputReference'] = 'InputReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, 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.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['InputReference']
class queenbee.io.reference.ItemReference(*, type: ~typing.Literal['ItemReference'] = 'ItemReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, variable: str = None)[source]

Bases: _BaseReference

An Item Reference.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
to_ref_string()[source]

Generate a reference string from an item reference

Returns:

str – A reference string

type: Literal['ItemReference']
variable: str
class queenbee.io.reference.TaskFileReference(*, type: ~typing.Literal['TaskFileReference'] = 'TaskFileReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, name: str, variable: str)[source]

Bases: _TaskReferenceBase

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

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['TaskFileReference']
class queenbee.io.reference.TaskFolderReference(*, type: ~typing.Literal['TaskFolderReference'] = 'TaskFolderReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, name: str, variable: str)[source]

Bases: _TaskReferenceBase

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

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['TaskFolderReference']
class queenbee.io.reference.TaskPathReference(*, type: ~typing.Literal['TaskPathReference'] = 'TaskPathReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, name: str, variable: str)[source]

Bases: _TaskReferenceBase

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

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['TaskPathReference']
class queenbee.io.reference.TaskReference(*, type: ~typing.Literal['TaskReference'] = 'TaskReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, name: str, variable: str)[source]

Bases: _TaskReferenceBase

A Task reference for parameters other than files or folders.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property source
type: Literal['TaskReference']
class queenbee.io.reference.ValueFileReference(*, type: ~typing.Literal['ValueFileReference'] = 'ValueFileReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, path: str)[source]

Bases: _BaseReference

A reference to a fixed file.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

path: str
type: Literal['ValueFileReference']
class queenbee.io.reference.ValueFolderReference(*, type: ~typing.Literal['ValueFolderReference'] = 'ValueFolderReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, path: str)[source]

Bases: ValueFileReference

A reference to a fixed folder.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: Literal['ValueFolderReference']
class queenbee.io.reference.ValueListReference(*, type: ~typing.Literal['ValueListReference'] = 'ValueListReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, value: ~typing.List[~typing.Any])[source]

Bases: _BaseReference

A reference to a fixed value.

classmethod check_value(v: List[Any]) List[Any][source]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: Literal['ValueListReference']
value: List[Any]
class queenbee.io.reference.ValueReference(*, type: ~typing.Literal['ValueReference'] = 'ValueReference', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, value: ~typing.Any)[source]

Bases: _BaseReference

A reference to a fixed value.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: Literal['ValueReference']
value: Any
queenbee.io.reference.references_from_string(string: str) List[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