poiesis.core.services.filer package

Subpackages

Submodules

poiesis.core.services.filer.filer module

Interface for TIF and TOF.

class poiesis.core.services.filer.filer.Filer[source]

Bases: ABC

Interface for TIF and TOF.

message_broker

Message broker

name

Name of the filer

async execute()[source]

Execute the filer.

This will file the file and send a message to TORC via the message broker.

abstractmethod async file()[source]

Filing logic, upload or download.

If TIF encounters any error, it will send a message to TORC and break.

message(message)[source]

Message logic, send a message to TORC.

abstract property name: str

Name of the filer.

poiesis.core.services.filer.filer_strategy_factory module

Filer strategy factory module.

Get the correct strategy based on the URI scheme.

class poiesis.core.services.filer.filer_strategy_factory.FilerStrategyFactory[source]

Bases: object

Factory for creating filer strategies based on URI scheme.

This factory class provides a method to create appropriate filer strategy instances based on the URI scheme provided.

STRATEGY_MAP

A mapping of URI schemes to their corresponding filer strategy classes.

classmethod create_strategy(uri, payload)[source]

Create appropriate strategy based on URI scheme.

Parameters:
  • uri (str) – The URI string to determine the strategy.

  • payload (TesInput or TesOutput) – The payload to instantiate the strategy implementation.

Returns:

An instance of the appropriate filer strategy.

Return type:

FilerStrategy

Example

>>> strategy = FilerStrategyFactory.create_strategy("s3://mybucket/myfile")
>>> isinstance(strategy, S3FilerStrategy)
True

Note

If the URI scheme is not recognized, the LocalFilerStrategy will be used as the default strategy.

class poiesis.core.services.filer.filer_strategy_factory.StrategyInfoDict(**data)[source]

Bases: BaseModel

Typed dictionary for strategy mapping.

input: bool
model_config: ClassVar[ConfigDict] = {}

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

name: str
output: bool
strategy: type[FilerStrategy]

poiesis.core.services.filer.tif module

Entry point for the TIF service.

class poiesis.core.services.filer.tif.Tif(name, inputs)[source]

Bases: Filer

Task input filer.

Parameters:
  • name (str) – Name of the task.

  • inputs (list[TesInput]) – List of task inputs.

name

Name of the task.

inputs

List of task inputs.

message_broker

Message broker.

async file()[source]

Filing logic, download.

Raises:

Exception – If the file cannot be downloaded.

Return type:

None

property name: str

Name of the filer.

poiesis.core.services.filer.tof module

Entry point for the TOF service.

class poiesis.core.services.filer.tof.Tof(name, outputs)[source]

Bases: Filer

Task output filer.

Parameters:
  • name (str) – Name of the task.

  • outputs (list[TesOutput]) – List of task outputs.

name

Name of the task.

outputs

List of task outputs.

message_broker

Message broker

async file()[source]

Filing logic, upload.

Raises:

Exception – If the file cannot be uploaded.

Return type:

None

property name: str

Name of the filer.

Module contents

Filer module.