sdkagent

click API reference

95 public APIs from click (pallets/click) — 19 classes, 19 functions, 57 methods. Signatures extracted by static analysis of the actual source.

Repository: pallets/click

KindCount
Classes19
Functions19
Methods57

API list

funcsrc.click._compat.get_best_encoding(stream:t.IO[t.Any]) -> str
Returns the default stream encoding if not found.
funcsrc.click._compat.is_ascii_encoding(encoding:str) -> bool
Checks if a given encoding is ascii.
funcsrc.click._termui_impl.get_pager_file(color:bool | None=None) -> t.Generator[t.TextIO, None, None]
Context manager.
classsrc.click._utils.Sentinel
Enum used to define sentinel values.
classsrc.click.core.Argument
Arguments are positional parameters to a command.
methodsrc.click.core.Command.format_arguments(ctx:Context, formatter:HelpFormatter) -> None
Writes the arguments that have a help record into the formatter.
methodsrc.click.core.Command.format_epilog(ctx:Context, formatter:HelpFormatter) -> None
Writes the epilog into the formatter if it exists.
methodsrc.click.core.Command.format_help(ctx:Context, formatter:HelpFormatter) -> None
Writes the help into the formatter if it exists.
methodsrc.click.core.Command.format_help_text(ctx:Context, formatter:HelpFormatter) -> None
Writes the help text to the formatter if it exists.
methodsrc.click.core.Command.format_options(ctx:Context, formatter:HelpFormatter) -> None
Writes all the options into the formatter if they exist.
methodsrc.click.core.Command.format_usage(ctx:Context, formatter:HelpFormatter) -> None
Writes the usage line into the formatter.
methodsrc.click.core.Command.get_help(ctx:Context) -> str
Formats the help into a string and returns it.
methodsrc.click.core.Command.get_help_option(ctx:Context) -> Option | None
Returns the help option object.
methodsrc.click.core.Command.get_help_option_names(ctx:Context) -> list[str]
Returns the names for the help option.
methodsrc.click.core.Command.get_usage(ctx:Context) -> str
Formats the usage line into a string and returns it.
methodsrc.click.core.Command.make_parser(ctx:Context) -> _OptionParser
Creates the underlying option parser for this command.
methodsrc.click.core.Command.shell_complete(ctx:Context, incomplete:str) -> list[CompletionItem]
Return a list of completions for the incomplete value.
classsrc.click.core.CommandCollection
A :class:`Group` that looks up subcommands on other groups.
methodsrc.click.core.CommandCollection.add_source(group:Group) -> None
Add a group as a source of commands.
methodsrc.click.core.Context.abort() -> t.NoReturn
Aborts the script.
methodsrc.click.core.Context.call_on_close(f:t.Callable[..., t.Any]) -> t.Callable[..., t.Any]
Register a function to be called when the context tears down.
methodsrc.click.core.Context.command_path() -> str
The computed command path.
methodsrc.click.core.Context.exit(code:int=0) -> t.NoReturn
Exits the application with a given exit code.
methodsrc.click.core.Context.fail(message:str) -> t.NoReturn
Aborts the execution of the program with a specific error message.
methodsrc.click.core.Context.find_object(object_type:type[V]) -> V | None
Finds the closest object of a given type.
methodsrc.click.core.Context.find_root() -> Context
Finds the outermost context.
methodsrc.click.core.Context.get_parameter_source(name:str) -> ParameterSource | None
Get the source of a parameter.
methodsrc.click.core.Context.set_parameter_source(name:str, source:ParameterSource) -> None
Set the source of a parameter.
methodsrc.click.core.Context.with_resource(context_manager:AbstractContextManager[V]) -> V
Register a resource as if it were used in a ``with`` statement.
classsrc.click.core.Group
A group is a command that nests other commands (or more groups).
methodsrc.click.core.Group.add_command(cmd:Command, name:str | None=None) -> None
Registers another :class:`Command` with this group.
methodsrc.click.core.Group.list_commands(ctx:Context) -> list[str]
Returns a list of subcommand names in the order they should appear.
methodsrc.click.core.Group.result_callback(replace:bool=False) -> t.Callable[[F], F]
Adds a result callback to the command.
methodsrc.click.core.Group.shell_complete(ctx:Context, incomplete:str) -> list[CompletionItem]
Return a list of completions for the incomplete value.
methodsrc.click.core.Option.get_default(ctx:Context, call:bool=True) -> t.Any | t.Callable[[], t.Any] | None
Return the default value for this option.
methodsrc.click.core.Option.is_bool_flag() -> bool
``True`` when this option is a flag with a boolean type.
methodsrc.click.core.Option.to_info_dict() -> dict[str, t.Any]
..
methodsrc.click.core.Parameter.consume_value(ctx:Context, opts:cabc.Mapping[str, t.Any]) -> tuple[t.Any, ParameterSource]
Returns the parameter value produced by the parser.
methodsrc.click.core.Parameter.human_readable_name() -> str
Returns the human readable name of this parameter.
methodsrc.click.core.Parameter.process_value(ctx:Context, value:t.Any) -> t.Any
Process the value of this parameter: 1.
methodsrc.click.core.Parameter.shell_complete(ctx:Context, incomplete:str) -> list[CompletionItem]
Return a list of completions for the incomplete value.
methodsrc.click.core.Parameter.value_from_envvar(ctx:Context) -> str | cabc.Sequence[str] | None
Process the raw environment variable string for this parameter.
funcsrc.click.decorators.argument(*cls:type[Argument] | None=None, *param_decls:str, **attrs:t.Any) -> t.Callable[[FC], FC]
Attaches an argument to the command.
funcsrc.click.decorators.option(*cls:type[Option] | None=None, *param_decls:str, **attrs:t.Any) -> t.Callable[[FC], FC]
Attaches an option to the command.
funcsrc.click.decorators.show_help(ctx:Context, param:Parameter, value:bool) -> None
Callback that print the help page on ``<stdout>`` and exits.
classsrc.click.exceptions.Abort
An internal signalling exception that signals Click to abort.
classsrc.click.exceptions.ClickException
An exception that Click can handle and show to the user.
classsrc.click.exceptions.FileError
Raised if a file cannot be opened.
classsrc.click.exceptions.UsageError
An internal exception that signals a usage error.
classsrc.click.formatting.HelpFormatter
This class helps with formatting text-based help pages.
methodsrc.click.formatting.HelpFormatter.dedent() -> None
Decreases the indentation.
methodsrc.click.formatting.HelpFormatter.getvalue() -> str
Returns the buffer contents.
methodsrc.click.formatting.HelpFormatter.indent() -> None
Increases the indentation.
methodsrc.click.formatting.HelpFormatter.indentation() -> cabc.Generator[None]
A context manager that increases the indentation.
methodsrc.click.formatting.HelpFormatter.write(string:str) -> None
Writes a unicode string into the internal buffer.
methodsrc.click.formatting.HelpFormatter.write_dl(rows:cabc.Iterable[tuple[str, str]], col_max:int=30, col_spacing:int=2) -> None
Writes a definition list into the buffer.
methodsrc.click.formatting.HelpFormatter.write_heading(heading:str) -> None
Writes a heading into the buffer.
methodsrc.click.formatting.HelpFormatter.write_paragraph() -> None
Writes a paragraph into the buffer.
methodsrc.click.formatting.HelpFormatter.write_text(text:str) -> None
Writes re-indented text into the buffer.
methodsrc.click.formatting.HelpFormatter.write_usage(prog:str, args:str='', prefix:str | None=None) -> None
Writes a usage line into the buffer.
funcsrc.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.
funcsrc.click.globals.pop_context() -> None
Removes the top level from the stack.
funcsrc.click.globals.push_context(ctx:Context) -> None
Pushes a new context to the current stack.
funcsrc.click.globals.resolve_color_default(color:bool | None=None) -> bool | None
Internal helper to get the default value of the color flag.
classsrc.click.shell_completion.BashComplete
Shell completion for Bash.
classsrc.click.shell_completion.CompletionItem
Represents a completion value and metadata about the value.
classsrc.click.shell_completion.FishComplete
Shell completion for Fish.
methodsrc.click.shell_completion.FishComplete.format_completion(item:CompletionItem[str]) -> str
..
classsrc.click.shell_completion.ShellComplete
Base class for providing shell completion support.
methodsrc.click.shell_completion.ShellComplete.complete() -> str
Produce the completion data to send back to the shell.
methodsrc.click.shell_completion.ShellComplete.source_vars() -> _SourceVarsDict
Vars for formatting :attr:`source_template`.
classsrc.click.shell_completion.ZshComplete
Shell completion for Zsh.
funcsrc.click.termui.clear() -> None
Clears the terminal screen.
funcsrc.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).
funcsrc.click.termui.get_pager_file(color:bool | None=None) -> t.ContextManager[t.TextIO]
Context manager.
funcsrc.click.termui.getchar(echo:bool=False) -> str
Fetches a single character from the terminal and returns it.
funcsrc.click.termui.unstyle(text:str) -> str
Removes ANSI styling information from a string.
classsrc.click.testing.Result
Holds the captured result of an invoked CLI script.
methodsrc.click.testing.Result.stderr() -> str
The standard error as unicode string.
methodsrc.click.testing.Result.stdout() -> str
The standard output as unicode string.
classsrc.click.testing.StreamMixer
Mixes `<stdout>` and `<stderr>` streams.
methodsrc.click.types.Choice.get_invalid_choice_message(value:t.Any, ctx:Context | None) -> str
Get the error message when the given choice is invalid.
methodsrc.click.types.Choice.get_missing_message(param:Parameter, ctx:Context | None) -> str
Message shown when no choice is passed.
methodsrc.click.types.Choice.normalize_choice(choice:object, ctx:Context | None) -> str
Normalize a choice value, used to map a passed string to a choice.
methodsrc.click.types.Choice.shell_complete(ctx:Context, param:Parameter, incomplete:str) -> list[CompletionItem]
Complete choices that start with the incomplete value.
classsrc.click.types.DateTime
The DateTime type converts date strings into `datetime` objects.
classsrc.click.types.File
Declares a parameter to be a file for reading or writing.
classsrc.click.types.ParamType
Represents the type of a parameter.
methodsrc.click.types.ParamType.convert(value:_InputT_contra, param:Parameter | None, ctx:Context | None) -> _ValueT_co
Convert the value to the correct type.
methodsrc.click.types.ParamType.fail(message:str, param:Parameter | None=None, ctx:Context | None=None) -> t.NoReturn
Helper method to fail with an invalid value message.
methodsrc.click.types.ParamType.get_metavar(param:Parameter, ctx:Context) -> str | None
Returns the metavar default for this param if it provides one.
funcsrc.click.utils.echo(message:object=None, file:t.IO[t.Any] | None=None, nl:bool=True, err:bool=False, color:bool | None=None) -> None
Print a message and newline to stdout or a file.
funcsrc.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.
funcsrc.click.utils.get_app_dir(app_name:str, roaming:bool=True, force_posix:bool=False) -> str
Returns the config folder for the application.
funcsrc.click.utils.make_str(value:t.Any) -> str
Converts a value into a valid string.

About this data

These signatures were extracted from the public source of pallets/click 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