base_runner
base_runner
Base runner class for scenario operations.
Classes
ScenarioRunnerProtocol
Bases: Protocol[T]
Protocol for scenario runner implementations.
Allows flexible method signatures while maintaining type safety. Each runner can define its own specific parameters beyond the client.
Functions
run
staticmethod
Execute the scenario operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
BaseClient
|
The HTTP client for API requests |
required |
*args
|
Any
|
Operation-specific positional arguments |
()
|
**kwargs
|
Any
|
Operation-specific keyword arguments |
{}
|
Returns:
| Type | Description |
|---|---|
ServiceResult[T]
|
ServiceResult with operation-specific data type |
Source code in src/pyetm/services/scenario_runners/base_runner.py
ScenarioIdentifier
Bases: Protocol
Protocol for objects with a scenario or saved_scenario ID.
BaseRunner
Bases: ABC, Generic[T]
Base class for all API runners that handles common HTTP request patterns and error handling for both read and write operations.