apex.config
Documentation for eth_defi.apex.config Python module.
Environment configuration for the ApeX vault reader.
Functions
|
Parse a strictly positive ApeX scheduling duration. |
Classes
Validated standalone ApeX reader configuration. |
- parse_apex_duration(value)
Parse a strictly positive ApeX scheduling duration.
The parser accepts decimal seconds, minutes, hours and days. Scheduling cadence is deliberately independent of the database timestamp schema.
- Parameters
value (str) – Duration such as
30s,30m,1.5hor2d.- Returns
Parsed positive duration.
- Raises
ValueError – The value is malformed, unsupported or non-positive.
- Return type
- class ApexReaderConfig
Bases:
objectValidated standalone ApeX reader configuration.
- db_path: pathlib.Path
DuckDB database path.
- history_mode: Literal['incremental', 'refresh', 'none']
History scan mode.
- history_refresh_interval: datetime.timedelta
History maintenance cadence.
- scan_interval: datetime.timedelta
Ranking scan cadence owned by the command.
- classmethod from_environment(environ=None)
Build configuration from environment variables.
- Parameters
environ (Optional[collections.abc.Mapping[str, str]]) – Environment mapping. Defaults to
os.environ.- Returns
Fully validated reader configuration.
- Return type
- __init__(log_level, db_path, vault_ids, max_workers, requests_per_second, connect_timeout, read_timeout, request_deadline, ranking_deadline, history_deadline, max_retry_delay, max_response_bytes, history_mode, history_refresh_interval, loop, scan_interval)
- Parameters
log_level (str) –
db_path (pathlib.Path) –
max_workers (int) –
requests_per_second (float) –
connect_timeout (float) –
read_timeout (float) –
request_deadline (float) –
ranking_deadline (float) –
history_deadline (float) –
max_retry_delay (float) –
max_response_bytes (int) –
history_mode (Literal['incremental', 'refresh', 'none']) –
history_refresh_interval (datetime.timedelta) –
loop (bool) –
scan_interval (datetime.timedelta) –
- Return type
None