Open1

TyperのCustom Class

a2a2

Time Delta

def parse_timedelta_class(value: str):
    return pd.to_timedelta(value).total_seconds()
How to use
unit_time: Annotated[float, typer.Option('-u', '--unit-time', parser=parse_timedelta_class, metavar='TIME_DELTA', help='Unit time')] = '1s'