Skip to main content

ISO8601DateTimeOrFloat

ISO 8601 Date Time or float argument.

Attributes

AttributeTypeDescription
namestring = iso-86091 or floatThe display name of the parameter type used for help text and error messages.

Methods


convert()

@classmethod
def convert(
value: any,
param: click.Parameter,
ctx: click.Context
) - > float | datetime

Converts the input value into either a float or an ISO 8601 datetime object. This method first attempts to parse the value as a floating-point number and falls back to ISO 8601 date parsing if the numeric conversion fails.

Parameters

NameTypeDescription
valueanyThe raw input value to be converted into a numeric or date format.
paramclick.ParameterThe parameter object that this value is being associated with.
ctxclick.ContextThe current Click execution context for the command.

Returns

TypeDescription
`floatdatetime`