Option Types¶
Common types for command line argument specification.
- django_typer.types.ForceColor¶
The type hint for the
--force-coloroption.The
--force-coloroption is included by default and behaves the same as onBaseCommanduse it to force colorization of the command. You can check the supplied value of--force-colorby checking the force_color attribute of the command instance.alias of
Annotated[bool, <typer.models.OptionInfo object at 0x7d8f3be70a50>]
- django_typer.types.HideLocals¶
A toggle to turn off exception traceback local variable rendering in rich tracebacks.
alias of
Annotated[bool, <typer.models.OptionInfo object at 0x7d8f3be707d0>]
- django_typer.types.NoColor¶
The type hint for the
--no-coloroption.The
--no-coloroption is included by default and behaves the same as onBaseCommanduse it to force disable colorization of the command. You can check the supplied value of--no-colorby checking the no_color attribute of the command instance.alias of
Annotated[bool, <typer.models.OptionInfo object at 0x7d8f3be70910>]
- django_typer.types.PythonPath¶
The type hint for the
--pythonpathoption.The
--pythonpathoption is included by default and behaves the same as onBaseCommanduse it to specify a directory to add to the Python sys path.alias of
Annotated[Path|None, <typer.models.OptionInfo object at 0x7d8f3be70410>]
- django_typer.types.Settings¶
The type hint for the
--settingsoption.The
--settingsoption is included by default and behaves the same as onBaseCommanduse it to specify or override the settings module to use.alias of
Annotated[str, <typer.models.OptionInfo object at 0x7d8f3be702d0>]
- django_typer.types.ShowLocals¶
A toggle to turn on exception traceback local variable rendering in rich tracebacks.
alias of
Annotated[bool, <typer.models.OptionInfo object at 0x7d8f3be70690>]
- django_typer.types.SkipChecks¶
The type hint for the
--skip-checksoption.The
--skip-checksoption is included by default and behaves the same as onBaseCommanduse it to skip system checks.alias of
Annotated[bool, <typer.models.OptionInfo object at 0x7d8f3be70b90>]
- django_typer.types.Traceback¶
The type hint for the
--tracebackoption.The
--tracebackoption is included by default and behaves the same as onBaseCommanduse it to allowCommandErrorexceptions to propagate out of the command and produce a stack trace.alias of
Annotated[bool, <typer.models.OptionInfo object at 0x7d8f3be70550>]
- django_typer.types.Verbosity¶
The type hint for the
--verbosityoption.TyperCommanddoes not include the verbosity option by default, but it can be added to the command like so if needed.from django_typer.types import Verbosity def handle(self, verbosity: Verbosity = 1): ...
alias of
Annotated[int, <typer.models.OptionInfo object at 0x7d8f3be70050>]
- django_typer.types.Version¶
The type hint for the
--versionoption.The
--versionoption is included by default and behaves the same as onBaseCommand.alias of
Annotated[bool, <typer.models.OptionInfo object at 0x7d8f3bedfd90>]
- django_typer.types.print_version(context, _, value)[source]¶
A callback to run the
get_version()routine of the command when –version is specified.