diplomat.processing.type_casters
Provides an interface and several types for performing automatic typecasting. Also provides an alternative API for adding type hints to python functions with more capabilities than python’s builtin type hints via the typecaster protocol and the typecaster_function decorator.
Module Attributes
A type caster representing typing.Any. |
|
Represents None as a type caster. |
|
Represents os.PathLike as a type caster. |
Functions
|
Get the underlying name of a typecaster or type for printing... |
Get the type casting annotations of a type caster function. |
|
Get the name of the wildcard keyword argument for this type caster function if it exists. |
|
Get the arguments that must be passed to this typecasting function (one's that lack a default argument). |
|
|
Convert a type caster to a python type hint. |
|
Convert a type caster to a command line meta-variable string. |
|
Turns a function annotated with typecaster objects into a regular function with normal type annotations. |
Classes
|
A convertible typecaster, or one that can be converted to normal python type hints. |
|
Represents typing.Dict as a type caster |
|
A type which represents a sequence, or list. |
|
Represents the typing.Literal type as a type caster. |
|
Represents typing.Optional as a type caster. |
|
Represents a float with a restricted range of values it can take on. |
|
Represents an integer with a restricted range of values it can take on. |
|
Represents a decimal rounded to a fixed precision. |
|
A type caster that can be used to run strict argument name and type checking on type casting functions. |
|
Represents a fixed length tuple of types. |
|
Protocol for a type casting method. |
|
Protocol for representing a type caster function. |
|
Represents the typing.Union type as a type caster. |