poiesis.core.services.filer package¶
Subpackages¶
- poiesis.core.services.filer.strategy package
- Submodules
- poiesis.core.services.filer.strategy.content_filer module
- poiesis.core.services.filer.strategy.filer_strategy module
- poiesis.core.services.filer.strategy.http_filer module
- poiesis.core.services.filer.strategy.local_filer module
- poiesis.core.services.filer.strategy.s3_filer module
- Module contents
Submodules¶
poiesis.core.services.filer.filer module¶
Interface for TIF and TOF.
- class poiesis.core.services.filer.filer.Filer[source]¶
Bases:
ABCInterface 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.
- 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:
objectFactory 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:
- Returns:
An instance of the appropriate filer strategy.
- Return type:
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:
BaseModelTyped 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:
FilerTask 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:
FilerTask 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.