CLI#
- fitrequest.cli_utils.run_pretty(func: Callable) Callable[source]#
Simplify running fitrequest methods from the CLI, supporting both synchronous and asynchronous functions. The results are pretty-printed using ‘rich’ for enhanced readability.
- fitrequest.cli_utils.add_httpx_args(func: Callable) Callable[source]#
If the signature does not already include these arguments, the function adds some common
httpxparameters. These parameters will then be accessible via the CLI. They are added only ifkwargsis included in the method’s signature.
- fitrequest.cli_utils.transform_literals(func: Callable) Callable[source]#
Unfortunatly
typerdoesn’t support literals, this decorator transform all literals in signature to enums.
- fitrequest.cli_utils.literal_to_enum(name: str, literal: type[Literal]) type[StrEnum][source]#
Create an Enum dynamically.
- fitrequest.cli_utils.fit_cli_command(command: Callable) Callable[source]#
Enhance CLI commands (automatically generated
fitrequestmethods) by adding custom request options, supporting additional format types not handled by Typer, and improving the output formatting for a more readable presentation.