sdkagent

typer API reference

127 public APIs from typer (fastapi/typer) — 20 classes, 65 functions, 42 methods. Signatures extracted by static analysis of the actual source.

Repository: fastapi/typer

KindCount
Classes20
Functions65
Methods42

API list

funcdocs_src.commands.callback.tutorial001_py310.main(verbose:bool=False)
Manage users in the awesome CLI app.
funcdocs_src.commands.callback.tutorial004_py310.callback()
Manage users CLI app.
funcdocs_src.commands.context.tutorial001_py310.main(ctx:typer.Context)
Manage users in the awesome CLI app.
funcdocs_src.commands.context.tutorial002_py310.main()
Manage users in the awesome CLI app.
funcdocs_src.commands.context.tutorial003_py310.main(ctx:typer.Context)
Manage users in the awesome CLI app.
funcdocs_src.commands.help.tutorial001_an_py310.create(username:str)
Create a new user with username.
funcdocs_src.commands.help.tutorial001_an_py310.init()
Initialize the users database.
funcdocs_src.commands.help.tutorial001_py310.create(username:str)
Create a new user with username.
funcdocs_src.commands.help.tutorial001_py310.init()
Initialize the users database.
funcdocs_src.commands.help.tutorial002_py310.create(username:str)
Some internal utility function to create.
funcdocs_src.commands.help.tutorial002_py310.delete(username:str)
Some internal utility function to delete.
funcdocs_src.commands.help.tutorial003_py310.create(username:str)
Create a user.
funcdocs_src.commands.help.tutorial003_py310.delete(username:str)
Delete a user.
funcdocs_src.commands.help.tutorial005_an_py310.create(username:Annotated[str, typer.Argument(help='The username to be **created**')])
**Create** a new *shiny* user.
funcdocs_src.commands.help.tutorial005_py310.create(username:str=typer.Argument(..., help='The username to be **created**'))
**Create** a new *shiny* user.
funcdocs_src.commands.help.tutorial006_py310.config(configuration:str)
[blue]Configure[/blue] the system.
funcdocs_src.commands.help.tutorial006_py310.create(username:str)
[green]Create[/green] a new user.
funcdocs_src.commands.help.tutorial006_py310.delete(username:str)
[red]Delete[/red] a user.
funcdocs_src.commands.help.tutorial006_py310.report()
[yellow]Report[/yellow] an issue.
funcdocs_src.commands.help.tutorial007_an_py310.config(configuration:str)
[blue]Configure[/blue] the system.
funcdocs_src.commands.help.tutorial007_py310.config(configuration:str)
[blue]Configure[/blue] the system.
funcdocs_src.commands.help.tutorial008_py310.create(username:str)
[green]Create[/green] a new user.
funcdocs_src.subcommands.name_help.tutorial002_py310.users()
Manage users in the app.
funcdocs_src.subcommands.name_help.tutorial003_py310.users()
Manage users in the app.
funcdocs_src.subcommands.name_help.tutorial004_py310.old_callback()
Old callback help.
funcdocs_src.subcommands.name_help.tutorial004_py310.users()
Manage users in the app.
funcdocs_src.subcommands.name_help.tutorial005_py310.new_users()
I have the highland!
funcdocs_src.subcommands.name_help.tutorial005_py310.old_callback()
Old callback help.
funcdocs_src.subcommands.name_help.tutorial005_py310.users()
Manage users in the app.
funcdocs_src.subcommands.name_help.tutorial006_py310.new_users()
I have the highland!
funcdocs_src.subcommands.name_help.tutorial006_py310.old_callback()
Old callback help.
funcdocs_src.subcommands.name_help.tutorial006_py310.users()
Manage users in the app.
funcdocs_src.subcommands.name_help.tutorial007_py310.new_users()
I have the highland!
funcdocs_src.subcommands.name_help.tutorial007_py310.old_callback()
Old callback help.
funcdocs_src.subcommands.name_help.tutorial007_py310.users()
Manage users in the app.
funcdocs_src.subcommands.name_help.tutorial008_py310.new_users()
I have the highland!
funcdocs_src.subcommands.name_help.tutorial008_py310.old_callback()
Old callback help.
funcdocs_src.subcommands.name_help.tutorial008_py310.users()
Manage users in the app.
functyper._click._compat.get_best_encoding(stream:IO[Any]) -> str
Returns the default stream encoding if not found.
functyper._click._compat.is_ascii_encoding(encoding:str) -> bool
Checks if a given encoding is ascii.
methodtyper._click._termui_impl.ProgressBar.update(n_steps:int) -> None
Update the progress bar by advancing a specified number of steps.
methodtyper._click.core.Command.format_epilog(ctx:Context, formatter:HelpFormatter) -> None
Writes the epilog into the formatter if it exists.
methodtyper._click.core.Command.format_help(ctx:Context, formatter:HelpFormatter) -> None
Writes the help into the formatter if it exists.
methodtyper._click.core.Command.format_help_text(ctx:Context, formatter:HelpFormatter) -> None
Writes the help text to the formatter if it exists.
methodtyper._click.core.Command.format_usage(ctx:Context, formatter:HelpFormatter) -> None
Writes the usage line into the formatter.
methodtyper._click.core.Command.get_help(ctx:Context) -> str
Formats the help into a string and returns it.
methodtyper._click.core.Command.get_help_option(ctx:Context) -> Union['TyperOption', None]
Returns the help option object.
methodtyper._click.core.Command.get_help_option_names(ctx:Context) -> list[str]
Returns the names for the help option.
methodtyper._click.core.Command.get_usage(ctx:Context) -> str
Formats the usage line into a string and returns it.
methodtyper._click.core.Command.make_parser(ctx:Context) -> _OptionParser
Creates the underlying option parser for this command.
methodtyper._click.core.Command.shell_complete(ctx:Context, incomplete:str) -> list['CompletionItem']
Return a list of completions for the incomplete value.
methodtyper._click.core.Context.abort() -> NoReturn
Aborts the script.
methodtyper._click.core.Context.call_on_close(f:Callable[..., Any]) -> Callable[..., Any]
Register a function to be called when the context tears down.
methodtyper._click.core.Context.command_path() -> str
The computed command path.
methodtyper._click.core.Context.exit(code:int=0) -> NoReturn
Exits the application with a given exit code.
methodtyper._click.core.Context.fail(message:str) -> NoReturn
Aborts the execution of the program with a specific error message.
methodtyper._click.core.Context.find_object(object_type:type[V]) -> V | None
Finds the closest object of a given type.
methodtyper._click.core.Context.find_root() -> 'Context'
Finds the outermost context.
methodtyper._click.core.Context.get_parameter_source(name:str) -> ParameterSource | None
Get the source of a parameter.
methodtyper._click.core.Context.invoke(callback:Callable[..., V], *args:Any, **kwargs:Any) -> V
Invokes a command callback in exactly the way it expects.
methodtyper._click.core.Context.make_formatter() -> HelpFormatter
Creates the HelpFormatter for the help and usage output.
methodtyper._click.core.Context.set_parameter_source(name:str, source:ParameterSource) -> None
Set the source of a parameter.
methodtyper._click.core.Context.with_resource(context_manager:AbstractContextManager[V]) -> V
Register a resource as if it were used in a ``with`` statement.
methodtyper._click.core.Parameter.human_readable_name() -> str
Returns the human readable name of this parameter.
methodtyper._click.core.Parameter.process_value(ctx:Context, value:Any) -> Any
Process the value of this parameter
methodtyper._click.core.Parameter.shell_complete(ctx:Context, incomplete:str) -> list['CompletionItem']
Return a list of completions for the incomplete value.
functyper._click.decorators.help_option(param_decls:list[str]) -> Callable[[Command], Command]
Help option which prints the help page and exits the program.
functyper._click.decorators.option(param_decls:list[str], cls:type['TyperOption'] | None=None, **attrs:Any) -> Callable[[Command], Command]
Attaches an option to the command.
functyper._click.decorators.show_help(ctx:Context, param:Parameter, value:bool) -> None
Callback that print the help page on ``<stdout>`` and exits.
classtyper._click.exceptions.Abort
An internal signalling exception that signals Click to abort.
classtyper._click.exceptions.ClickException
An exception that Click can handle and show to the user.
classtyper._click.exceptions.FileError
Raised if a file cannot be opened.
classtyper._click.exceptions.UsageError
An internal exception that signals a usage error.
classtyper._click.formatting.HelpFormatter
This class helps with formatting text-based help pages.
methodtyper._click.formatting.HelpFormatter.dedent() -> None
Decreases the indentation.
methodtyper._click.formatting.HelpFormatter.getvalue() -> str
Returns the buffer contents.
methodtyper._click.formatting.HelpFormatter.indent() -> None
Increases the indentation.
methodtyper._click.formatting.HelpFormatter.indentation() -> Iterator[None]
A context manager that increases the indentation.
methodtyper._click.formatting.HelpFormatter.write(string:str) -> None
Writes a unicode string into the internal buffer.
methodtyper._click.formatting.HelpFormatter.write_dl(rows:Sequence[tuple[str, str]], col_max:int=30, col_spacing:int=2) -> None
Writes a definition list into the buffer.
methodtyper._click.formatting.HelpFormatter.write_heading(heading:str) -> None
Writes a heading into the buffer.
methodtyper._click.formatting.HelpFormatter.write_paragraph() -> None
Writes a paragraph into the buffer.
methodtyper._click.formatting.HelpFormatter.write_text(text:str) -> None
Writes re-indented text into the buffer.
methodtyper._click.formatting.HelpFormatter.write_usage(prog:str, args:str='', prefix:str | None=None) -> None
Writes a usage line into the buffer.
functyper._click.formatting.wrap_text(text:str, width:int=78, initial_indent:str='', subsequent_indent:str='', preserve_paragraphs:bool=False) -> str
A helper function that intelligently wraps text.
functyper._click.globals.pop_context() -> None
Removes the top level from the stack.
functyper._click.globals.push_context(ctx:'Context') -> None
Pushes a new context to the current stack.
functyper._click.globals.resolve_color_default(color:bool | None=None) -> bool | None
Internal helper to get the default value of the color flag.
classtyper._click.shell_completion.CompletionItem
Represents a completion value and metadata about the value.
classtyper._click.shell_completion.ShellComplete
Base class for providing shell completion support.
methodtyper._click.shell_completion.ShellComplete.complete() -> str
Produce the completion data to send back to the shell.
methodtyper._click.shell_completion.ShellComplete.source_vars() -> dict[str, Any]
Vars for formatting `source_template`.
functyper._click.shell_completion.add_completion_class(cls:ShellCompleteType, name:str) -> ShellCompleteType
Register a `ShellComplete` subclass under the given name.
functyper._click.termui.confirm(text:str, default:bool | None=False, abort:bool=False, prompt_suffix:str=': ', show_default:bool=True, err:bool=False) -> bool
Prompts for confirmation (yes/no question).
functyper._click.termui.getchar(echo:bool=False) -> str
Fetches a single character from the terminal and returns it.
classtyper._click.types.DateTime
The DateTime type converts date strings into `datetime` objects.
classtyper._click.types.File
Declares a parameter to be a file for reading or writing.
classtyper._click.types.FloatRange
Restrict a `FLOAT` value to a range of accepted values.
classtyper._click.types.IntRange
Restrict an `INT` value to a range of accepted values.
classtyper._click.types.ParamType
Represents the type of a parameter.
methodtyper._click.types.ParamType.fail(message:str, param:Union['Parameter', None]=None, ctx:Union['Context', None]=None) -> NoReturn
Helper method to fail with an invalid value message.
methodtyper._click.types.ParamType.get_metavar(param:'Parameter', ctx:'Context') -> str | None
Returns the metavar default for this param if it provides one.
classtyper._click.types.Tuple
The default behavior of Click is to apply a type on a value directly.
functyper._click.types.convert_type(ty:Any | None, default:Any | None=None) -> ParamType
Find the most appropriate `ParamType` for the given Python type.
functyper._click.utils.echo(message:Any | None=None, file:IO[Any] | None=None, nl:bool=True, err:bool=False, color:bool | None=None) -> None
Print a message and newline to stdout or a file.
functyper._click.utils.format_filename(filename:str | bytes | os.PathLike[str] | os.PathLike[bytes], shorten:bool=False) -> str
Format a filename as a string for display.
functyper._click.utils.get_app_dir(app_name:str, roaming:bool=True, force_posix:bool=False) -> str
Returns the config folder for the application.
functyper._click.utils.get_binary_stream(name:Literal['stdin', 'stdout', 'stderr']) -> BinaryIO
Returns a system stream for byte processing.
functyper._click.utils.get_text_stream(name:Literal['stdin', 'stdout', 'stderr'], encoding:str | None=None, errors:str | None='strict') -> TextIO
Returns a system stream for text processing.
functyper._click.utils.make_default_short_help(help:str, max_length:int=45) -> str
Returns a condensed version of help string.
functyper._click.utils.safecall(func:Callable[P, R]) -> Callable[P, R | None]
Wraps a function so that it swallows exceptions.
classtyper.main.Typer
`Typer` main class, the main entrypoint to use Typer.
functyper.models.Default(value:DefaultType) -> DefaultType
You shouldn't use this function directly.
classtyper.models.DefaultPlaceholder
You shouldn't use this class directly.
classtyper.models.FileBinaryRead
You can use this class to read binary data, receiving `bytes`.
classtyper.models.FileTextWrite
You can use this class for writing text.
classtyper.rich_utils.OptionHighlighter
Highlights our special options.
functyper.rich_utils.escape_before_html_export(input_text:str) -> str
Ensure that the input string can be used for HTML export.
functyper.rich_utils.rich_abort_error() -> None
Print richly formatted abort error.
functyper.rich_utils.rich_format_error(self:_click.ClickException) -> None
Print richly formatted click errors.
functyper.rich_utils.rich_format_help(*obj:_click.Command | TyperGroup, *ctx:_click.Context, *markup_mode:MarkupModeStrict) -> None
Print nicely formatted help text using rich.
functyper.rich_utils.rich_render_text(text:str) -> str
Remove rich tags and render a pure text representation
functyper.rich_utils.rich_to_html(input_text:str) -> str
Print the HTML version of a rich-formatted input string.
classtyper.testing.Result
Holds the captured result of an invoked CLI script.
methodtyper.testing.Result.stderr() -> str
The standard error as unicode string.
methodtyper.testing.Result.stdout() -> str
The standard output as unicode string.
classtyper.testing.StreamMixer
Mixes `<stdout>` and `<stderr>` streams.

About this data

These signatures were extracted from the public source of fastapi/typer using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries