parse_apex_duration

Documentation for eth_defi.apex.config.parse_apex_duration function.

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.5h or 2d.

Returns

Parsed positive duration.

Raises

ValueError – The value is malformed, unsupported or non-positive.

Return type

datetime.timedelta