cloup
¶
Top-level package for cloup.
Subpackages¶
Submodules¶
Classes¶
|
A collection of styles for several elements of the help page. |
|
Wraps |
|
Colors accepted by |
|
A custom help formatter. |
|
A custom context for Cloup. |
|
A click.Option with an extra field |
|
Contains the information of an option group and identifies it. |
|
Implements support to option groups. |
|
A group of (sub)commands to show in the same help section of a |
|
Adds to a click.MultiCommand the possibility to organize its subcommands in multiple help sections. |
|
Base class for cloup commands. |
|
A |
|
A |
|
Provides support to constraints. |
Functions¶
|
|
|
Returns a decorator that annotates a function with an option group. |
|
Decorator that creates a new command using the wrapped function as callback. |
|
Decorator for creating a new |
|
Registers a constraint. |
Attributes¶
Contents¶
-
cloup.
__email__
= gianluca.gippetto@gmail.com¶
-
cloup.
__version__
¶
-
cloup.
__version_tuple__
¶
-
class
cloup.
HelpTheme
[source]¶ Bases:
NamedTuple
A collection of styles for several elements of the help page.
A “style” is just a function or a callable that takes a string and returns a styled version of it. This means you can use your favorite styling/color library (like rich, colorful etc). Nonetheless, given that Click has some basic styling functionality built-in, Cloup provides the
Style
class, which is a wrapper of theclick.style
function.- Parameters
invoked_command (Callable[[str], str]) – Style of the invoked command name (in Usage).
command_help (Callable[[str], str]) – Style of the invoked command description (below Usage).
heading (Callable[[str], str]) – Style of help section headings.
constraint (Callable[[str], str]) – Style of an option group constraint description.
section_help (Callable[[str], str]) – Style of the help text of a section (the optional paragraph below the heading).
col1 (Callable[[str], str]) – Style of the first column of a definition list (options and command names).
col2 (Callable[[str], str]) – Style of the second column of a definition list (help text).
-
invoked_command
:IStyle¶ Style of the invoked command name (in Usage).
-
command_help
:IStyle¶ Style of the invoked command description (below Usage).
-
heading
:IStyle¶ Style of help section headings.
-
constraint
:IStyle¶ Style of an option group constraint description.
-
section_help
:IStyle¶ Style of the help text of a section (the optional paragraph below the heading).
-
col1
:IStyle¶ Style of the first column of a definition list (options and command names).
-
col2
:IStyle¶ Style of the second column of a definition list (help text).
-
epilog
:IStyle¶ Style of the epilog.
-
with_
(self, invoked_command=None, command_help=None, heading=None, constraint=None, section_help=None, col1=None, col2=None, epilog=None)[source]¶ - Parameters
invoked_command (Optional[IStyle]) –
command_help (Optional[IStyle]) –
heading (Optional[IStyle]) –
constraint (Optional[IStyle]) –
section_help (Optional[IStyle]) –
col1 (Optional[IStyle]) –
col2 (Optional[IStyle]) –
epilog (Optional[IStyle]) –
- Return type
-
class
cloup.
Style
[source]¶ Wraps
click.style()
for a better integration withHelpTheme
.Available colors are defined as static constants in
Color
.Arguments are set to
None
by default. PassingFalse
to boolean args orColor.reset
as color causes a reset code to be inserted.With respect to
click.style()
, this class:has an argument less,
reset
, which is alwaysTrue
add the
text_transform
.
Warning
The arguments
overline
,italic
andstrikethrough
are only supported in Click 8 and will be ignored if you are using Click 7.- Parameters
fg (Optional[str]) – foreground color
bg (Optional[str]) – background color
bold (Optional[bool]) –
dim (Optional[bool]) –
underline (Optional[bool]) –
overline (Optional[bool]) –
italic (Optional[bool]) –
blink (Optional[bool]) –
reverse (Optional[bool]) –
strikethrough (Optional[bool]) –
text_transform (Optional[Callable[[str], str]]) – a generic string transformation; useful to apply functions like
str.upper
- Return type
New in version 0.8.0.
-
fg
:Optional[str]¶
-
bg
:Optional[str]¶
-
bold
:Optional[bool]¶
-
dim
:Optional[bool]¶
-
underline
:Optional[bool]¶
-
overline
:Optional[bool]¶
-
italic
:Optional[bool]¶
-
blink
:Optional[bool]¶
-
reverse
:Optional[bool]¶
-
strikethrough
:Optional[bool]¶
-
text_transform
:Optional[IStyle]¶
-
class
cloup.
Color
[source]¶ Bases:
cloup._util.FrozenSpace
Colors accepted by
Style
andclick.style()
.-
black
= black¶
-
red
= red¶
-
green
= green¶
-
yellow
= yellow¶
-
blue
= blue¶
-
magenta
= magenta¶
-
cyan
= cyan¶
-
white
= white¶
-
reset
= reset¶
-
bright_black
= bright_black¶
-
bright_red
= bright_red¶
-
bright_green
= bright_green¶
-
bright_yellow
= bright_yellow¶
-
bright_blue
= bright_blue¶
-
bright_magenta
= bright_magenta¶
-
bright_cyan
= bright_cyan¶
-
bright_white
= bright_white¶
-
-
class
cloup.
HelpFormatter
(indent_increment=2, width=None, max_width=None, col1_max_width=30, col2_min_width=35, col_spacing=2, row_sep='', theme=HelpTheme())[source]¶ Bases:
click.HelpFormatter
A custom help formatter. Features include:
more attributes for controlling the output of the formatter
a
col1_width
parameter inwrite_dl()
that allows Cloup to align multiple definition lists without resorting to hacksa “linear layout” for definition lists that kicks in when the available terminal width is not enough for the standard 2-column layout (see argument
col2_min_width
)the first column width, when not explicitly given in
write_dl
is computed excluding the rows that exceedcol1_max_width
(calledcol_max
inwrite_dl
for compatibility with Click).
New in version 0.8.0.
- Parameters
indent_increment (int) – width of each indentation increment.
width (Optional[int]) – content line width; by default it’s initialized to
min(terminal_width - 1, max_width)
wheremax_width
is another argument.max_width (Optional[int]) – maximum content line width (equivalent to
Context.max_content_width
). Used to computewidth
when it is not provided, ignored otherwise.col1_max_width (int) – the maximum width of the first column of a definition list; as in Click, if the text of a row exceeds this threshold, the 2nd column is printed on a new line.
col2_min_width (int) – the minimum width for the second column of a definition list; if the available space is less than this value, the formatter switches from the standard 2-column layout to the “linear layout” (that this decision is taken for each definition list). If you want to always use the linear layout, you can set this argument to a very high number (or
math.inf
). If you never want it (not recommended), you can set this argument to zero.col_spacing (int) – the number of spaces between the column boundaries of a definition list.
row_sep (str) – a string printed after each row of a definition list (including the last).
theme (cloup.styling.HelpTheme) – an
HelpTheme
instance specifying how to style the various elements of the help page.
-
static
settings
(*, width=None, max_width=None, indent_increment=None, col1_max_width=None, col2_min_width=None, col_spacing=None, row_sep=None, theme=None)[source]¶ A utility method for creating a
formatter_settings
dictionary to pass as context settings or command attribute. This method exists for one only reason: it enables auto-complete for formatter options, thus improving the developer experience.Parameters are pretty self-explanatory. Refer to
HelpFormatter
in case of doubts.
-
write_command_help_text
(self, cmd)[source]¶ - Parameters
cmd (click.Command) –
- Return type
-
write_many_sections
(self, sections, aligned=True)[source]¶ - Parameters
sections (Sequence[HelpSection]) –
aligned (bool) –
- Return type
-
write_aligned_sections
(self, sections)[source]¶ Writes multiple aligned definition lists.
- Parameters
sections (Sequence[HelpSection]) –
- Return type
-
write_section
(self, s, col1_width=None)[source]¶ - Parameters
s (HelpSection) –
col1_width (Optional[int]) –
- Return type
-
write_text
(self, text, style=identity)[source]¶ Writes re-indented text into the buffer. This rewraps and preserves paragraphs.
-
write_dl
(self, rows, col_max=None, col_spacing=None, col1_width=None)[source]¶ Writes a definition list into the buffer. This is how options and commands are usually formatted.
If there’s enough space, definition lists are rendered as a 2-column pseudo-table: if the first column text of a row doesn’t fit in the provided/computed
col1_width
, the 2nd column is printed on the following line.If the available space for the 2nd column is below
self.col2_min_width
, the 2nd “column” is always printed below the 1st, indented with a minimum of 3 spaces (or oneindent_increment
if that’s greater than 3).- Parameters
rows (Sequence[Definition]) – a list of two item tuples for the terms and values.
col_max (Optional[int]) – the maximum width for the 1st column of a definition list; this argument is here to not break compatibility with Click; if provided, it overrides the attribute
self.col1_max_width
.col_spacing (Optional[int]) – number of spaces between the first and second column; this argument is here to not break compatibility with Click; if provided, it overrides
self.col_spacing
.col1_width (Optional[int]) – the width to use for the first column; if not provided, it’s computed as the length of the longest string under
self.col1_max_width
; useful when you need to align multiple definition lists.
- Return type
-
write_tabular_dl
(self, rows, col1_width, col_spacing, col2_width)[source]¶ Formats a definition list as a 2-column “pseudo-table”. If the first column of a row exceeds
col1_width
, the 2nd column is written on the subsequent line. This is the standard way of formatting definition lists and it’s the default if there’s enough space.
-
class
cloup.
Context
(*ctx_args, align_option_groups=None, align_sections=None, show_constraints=None, formatter_settings={}, **ctx_kwargs)[source]¶ Bases:
click.Context
A custom context for Cloup.
Look up
click.Context
for the list of all arguments.New in version 0.8.0.
- Parameters
ctx_args – arguments forwarded to
click.Context
.ctx_kwargs – keyword arguments forwarded to
click.Context
.align_option_groups (Optional[bool]) – if True, align the definition lists of all option groups of a command. You can override this by setting the corresponding argument of
Command
(but you probably shouldn’t: be consistent).align_sections (Optional[bool]) – if True, align the definition lists of all subcommands of a group. You can override this by setting the corresponding argument of
Group
(but you probably shouldn’t: be consistent).show_constraints (Optional[bool]) – whether to include a “Constraint” section in the command help (if at least one constraint is defined).
formatter_settings (Dict[str, Any]) – keyword arguments forwarded to
HelpFormatter
inmake_formatter
. This args are merged with those of the (eventual) parent context and then merged again (being overridden) by those of the command. Tip: use the static methodHelpFormatter.opts()
to create this dictionary, so that you can be guided by your IDE.
-
formatter_class
:Type[cloup.formatting.HelpFormatter]¶
-
make_formatter
(self)[source]¶ Creates the
HelpFormatter
for the help and usage output.To quickly customize the formatter class used without overriding this method, set the
formatter_class
attribute.Changed in version 8.0: Added the
formatter_class
attribute.- Return type
-
static
settings
(*, auto_envvar_prefix=None, default_map=None, terminal_width=None, max_content_width=None, resilient_parsing=None, allow_extra_args=None, allow_interspersed_args=None, ignore_unknown_options=None, help_option_names=None, token_normalize_func=None, color=None, show_default=None, align_option_groups=None, align_sections=None, show_constraints=None, formatter_settings=None)[source]¶ Utility method for creating a
context_settings
dictionary.- Parameters
auto_envvar_prefix (Optional[bool]) – the prefix to use for automatic environment variables. If this is None then reading from environment variables is disabled. This does not affect manually set environment variables which are always read.
default_map (Optional[Dict[str, Any]]) – a dictionary (like object) with default values for parameters.
terminal_width (Optional[int]) – the width of the terminal. The default is inherit from parent context. If no context defines the terminal width then auto detection will be applied.
max_content_width (Optional[int]) – the maximum width for content rendered by Click (this currently only affects help pages). This defaults to 80 characters if not overridden. In other words: even if the terminal is larger than that, Click will not format things wider than 80 characters by default. In addition to that, formatters might add some safety mapping on the right.
resilient_parsing (Optional[bool]) – if this flag is enabled then Click will parse without any interactivity or callback invocation. Default values will also be ignored. This is useful for implementing things such as completion support.
allow_extra_args (Optional[bool]) – if this is set to True then extra arguments at the end will not raise an error and will be kept on the context. The default is to inherit from the command.
allow_interspersed_args (Optional[bool]) – if this is set to False then options and arguments cannot be mixed. The default is to inherit from the command.
ignore_unknown_options (Optional[bool]) – instructs click to ignore options it does not know and keeps them for later processing.
help_option_names (Optional[List[str]]) – optionally a list of strings that define how the default help parameter is named. The default is
['--help']
.token_normalize_func (Optional[Callable[[str], str]]) – an optional function that is used to normalize tokens (options, choices, etc.). This for instance can be used to implement case insensitive behavior.
color (Optional[bool]) – controls if the terminal supports ANSI colors or not. The default is autodetection. This is only needed if ANSI codes are used in texts that Click prints which is by default not the case. This for instance would affect help output.
show_default (Optional[bool]) – Show defaults for all options. If not set, defaults to the value from a parent context. Overrides an option’s
show_default
argument.align_option_groups (Optional[bool]) – if True, align the definition lists of all option groups of a command. You can override this by setting the corresponding argument of
Command
(but you probably shouldn’t: be consistent).align_sections (Optional[bool]) – if True, align the definition lists of all subcommands of a group. You can override this by setting the corresponding argument of
Group
(but you probably shouldn’t: be consistent).show_constraints (Optional[bool]) – whether to include a “Constraint” section in the command help (if at least one constraint is defined).
formatter_settings (Optional[Dict[str, Any]]) – keyword arguments forwarded to
HelpFormatter
inmake_formatter
. This args are merged with those of the (eventual) parent context and then merged again (being overridden) by those of the command. Tip: use the static methodHelpFormatter.opts()
to create this dictionary, so that you can be guided by your IDE.
- Return type
Dict[str, Any]
-
class
cloup.
GroupedOption
(*args, group=None, **attrs)[source]¶ Bases:
click.Option
A click.Option with an extra field
group
of type OptionGroup- Parameters
group (Optional[cloup._option_groups.OptionGroup]) –
-
class
cloup.
OptionGroup
(name, help=None, constraint=None, hidden=False)[source]¶ - Parameters
name (str) –
help (Optional[str]) –
constraint (Optional[cloup.constraints._core.Constraint]) –
hidden (bool) –
-
property
options
(self)¶ - Return type
Sequence[click.Option]
-
get_help_records
(self, ctx)[source]¶ - Parameters
ctx (click.Context) –
- Return type
-
class
cloup.
OptionGroupMixin
(*args, align_option_groups=None, **kwargs)[source]¶ Implements support to option groups.
Changed in version 0.8.0: This mixin now relies on
cloup.HelpFormatter
to align help sections. If aclick.HelpFormatter
is used with aTypeError
is raised.Changed in version 0.8.0: Removed
format_option_group
. Addedget_default_option_group
andmake_option_group_help_section
.New in version 0.5.0.
Important
In order to check the constraints defined on the option groups, a command must inherits from
cloup.ConstraintMixin
too!- Parameters
align_option_groups (Optional[bool]) –
-
get_ungrouped_options
(self, ctx)[source]¶ - Parameters
ctx (click.Context) –
- Return type
Sequence[click.Option]
-
make_option_group_help_section
(self, group, ctx)[source]¶ Returns a HelpSection for an OptionGroup, i.e. an object containing the title, the optional description and the options’ definitions for this option group.
New in version 0.8.0.
- Parameters
group (OptionGroup) –
ctx (click.Context) –
- Return type
-
must_align_option_groups
(self, ctx, default=True)[source]¶ New in version 0.8.0.
- Parameters
ctx (Optional[click.Context]) –
- Return type
-
get_default_option_group
(self, ctx)[source]¶ New in version 0.8.0.
- Parameters
ctx (click.Context) –
- Return type
-
format_options
(self, ctx, formatter)[source]¶ - Parameters
ctx (click.Context) –
formatter (click.HelpFormatter) –
- Return type
-
cloup.
option
(*param_decls, group=None, cls=GroupedOption, **attrs)[source]¶ - Parameters
group (Optional[cloup._option_groups.OptionGroup]) –
cls (Type[click.core.Option]) –
- Return type
Callable[[C], C]
-
cloup.
option_group
(name: str, help: str, *options: OptionAdder, constraint: Optional[cloup.constraints.Constraint] = None, hidden: bool = False) → OptionGroupAdder[source]¶ -
cloup.
option_group
(name: str, *options: OptionAdder, help: Optional[str] = None, constraint: Optional[cloup.constraints.Constraint] = None, hidden: bool = False) → OptionGroupAdder Returns a decorator that annotates a function with an option group.
The
help
is an optional description and can be provided either as keyword argument or as 2nd positional argument after thename
of the group:# help as keyword argument @option_group(name, *options, help=None, ...) # help as 2nd positional argument @option_group(name, help, *options, ...)
- Parameters
name – this is shown as heading of the help section describing the option group.
help – an optional description shown below the name; can be provided as keyword argument or 2nd positional argument.
options – an arbitrary number of decorators like click.option, which annotate the input function with one
Option
.constraint – an optional instance of
Constraint
(see constraints for more info); a description of the constraint will be shown between squared brackets aside the option group title (or below it if too long).hidden – if
True
, the option group and all its options are hidden from the help page (all contained options will have theirhidden
attribute set toTrue
).
-
class
cloup.
Section
(title, commands=(), sorted=False)[source]¶ A group of (sub)commands to show in the same help section of a
MultiCommand
. You can use sections with any Command that inherits fromSectionMixin
.Changed in version 0.6.0: Removed the deprecated old name
GroupSection
.Changed in version 0.5.0: Introduced the new name
Section
and deprecated the oldGroupSection
.- Parameters
-
add_command
(self, cmd, name=None)[source]¶ - Parameters
cmd (click.Command) –
name (Optional[str]) –
-
list_commands
(self)[source]¶ - Return type
List[Tuple[str, click.Command]]
-
class
cloup.
SectionMixin
(*args, commands=None, sections=(), align_sections=None, **kwargs)[source]¶ Adds to a click.MultiCommand the possibility to organize its subcommands in multiple help sections.
Sections can be specified in the following ways:
passing a list of
Section
objects to the constructor setting the argumentsections
using
add_section()
to add a single sectionusing
add_command()
with the argument section set
Commands not assigned to any user-defined section are added to the “default section”, whose title is “Commands” or “Other commands” depending on whether it is the only section or not. The default section is the last shown section in the help and its commands are listed in lexicographic order.
Changed in version 0.8.0: This mixin now relies on
cloup.HelpFormatter
to align help sections. If aclick.HelpFormatter
is used with aTypeError
is raised.Changed in version 0.8.0: Removed
format_section
. Addedmake_commands_help_section
.New in version 0.5.0.
- Parameters
commands (Optional[Dict[str, click.core.Command]]) –
sections (Iterable[cloup._sections.Section]) –
align_sections (Optional[bool]) –
-
add_section
(self, section)[source]¶ Adds a
Section
to this group. You can add the same section object a single time.- Parameters
section (Section) –
-
section
(self, title, *commands, **attrs)[source]¶ Creates a new
Section
, adds it to this group and returns it.- Parameters
title (str) –
commands (click.Command) –
- Return type
-
add_command
(self, cmd, name=None, section=None)[source]¶ Adds a new command. If
section
is None, the command is added to the default section.- Parameters
cmd (click.Command) –
name (Optional[str]) –
section (Optional[Section]) –
-
list_sections
(self, ctx, include_default_section=True)[source]¶ Returns the list of all sections in the “correct order”. if
include_default_section=True
and the default section is non-empty, it will be included at the end of the list.- Parameters
ctx (click.Context) –
include_default_section (bool) –
- Return type
List[Section]
-
make_commands_help_section
(self, section)[source]¶ - Parameters
section (Section) –
- Return type
Optional[cloup.formatting.HelpSection]
-
must_align_sections
(self, ctx, default=True)[source]¶ - Parameters
ctx (Optional[click.Context]) –
default (bool) –
- Return type
-
format_commands
(self, ctx, formatter)[source]¶ - Parameters
ctx (click.Context) –
formatter (click.HelpFormatter) –
- Return type
-
class
cloup.
BaseCommand
(*args, formatter_settings={}, **kwargs)[source]¶ Bases:
click.Command
Base class for cloup commands.
It back-ports a feature from Click v8.0-a1, i.e. the
context_class
class attribute, which is set tocloup.Context
.It adds a
formatter_settings
instance attribute.
New in version 0.8.0.
- Parameters
formatter_settings (Dict[str, Any]) –
-
context_class
:Type[cloup._context.Context]¶
-
make_context
(self, info_name, args, parent=None, **extra)[source]¶ This function when given an info name and arguments will kick off the parsing and create a new
Context
. It does not invoke the actual command callback though.To quickly customize the context class used without overriding this method, set the
context_class
attribute.- Parameters
info_name – the info name for this invocation. Generally this is the most descriptive name for the script or command. For the toplevel script it’s usually the name of the script, for commands below it it’s the name of the command.
args – the arguments to parse as list of strings.
parent – the parent context if available.
extra – extra keyword arguments forwarded to the context constructor.
- Return type
Changed in version 8.0: Added the
context_class
attribute.
-
class
cloup.
Command
(*click_args, formatter_settings={}, constraints=(), show_constraints=False, align_option_groups=None, **click_kwargs)[source]¶ Bases:
cloup.constraints.ConstraintMixin
,cloup._option_groups.OptionGroupMixin
,BaseCommand
A
click.Command
supporting option groups and constraints.Changed in version 0.8.0: This class now inherits from
cloup.BaseCommand
.- Parameters
formatter_settings (Dict[str, Any]) –
constraints (Sequence[cloup.constraints._support.BoundConstraintSpec]) –
show_constraints (bool) –
align_option_groups (Optional[bool]) –
-
class
cloup.
Group
(name=None, commands=None, sections=(), align_sections=None, formatter_settings={}, **attrs)[source]¶ Bases:
cloup._sections.SectionMixin
,BaseCommand
,click.Group
A
click.Group
that allows to organize its subcommands in multiple help sections and and whose subcommands are, by default, of typecloup.Command
.This class is just a
click.Group
mixed withSectionMixin
that overrides the decoratorscommand()
andgroup()
so that asection
for the created subcommand can be specified.See the docstring of the two superclasses for more details.
Changed in version 0.8.0: This class now inherits from
cloup.BaseCommand
.- Parameters
name (Optional[str]) –
commands (Optional[Dict[str, click.core.Command]]) –
sections (Iterable[cloup._sections.Section]) –
align_sections (Optional[bool]) –
formatter_settings (Dict[str, Any]) –
-
command
(self, name=None, cls=None, section=None, **kwargs)[source]¶ Creates a new command and adds it to this group.
- Parameters
name (Optional[str]) –
cls (Optional[Type[click.Command]]) –
section (Optional[cloup._sections.Section]) –
- Return type
Callable[[Callable], click.Command]
-
group
(self, name=None, cls=None, section=None, **kwargs)[source]¶ A shortcut decorator for declaring and attaching a group to the group. This takes the same arguments as
group()
and immediately registers the created group with this group by callingadd_command()
.To customize the group class used, set the
group_class
attribute.Changed in version 8.0: Added the
group_class
attribute.- Parameters
name (Optional[str]) –
cls (Optional[Type[click.Group]]) –
section (Optional[cloup._sections.Section]) –
-
cloup.
command
(name=None, cls=Command, **attrs)[source]¶ Decorator that creates a new command using the wrapped function as callback.
The only differences with respect to
click.commands
are:this decorator creates a
cloup.Command
by default;this decorator supports
@constraint
.
- Parameters
name (Optional[str]) – name of the command
cls (Type[click.core.Command]) – type of click.Command
attrs – any argument you can pass to
click.command()
- Return type
Callable[[Callable], click.core.Command]
-
cloup.
group
(name=None, cls=Group, **attrs)[source]¶ Decorator for creating a new
Group
.Note
If you use static type checking, note that the
cls
optional argument of this function must be of typecloup.Group
, notclick.Group
.- Parameters
name (Optional[str]) – name of the command
cls (Type[cloup._commands.Group]) – type of
cloup.Group
attrs – any argument you can pass to
click.group()
- Return type
Callable[[Callable], cloup._commands.Group]
-
class
cloup.
ConstraintMixin
(*args, constraints=(), show_constraints=None, **kwargs)[source]¶ Provides support to constraints.
- Parameters
constraints (Sequence[cloup.constraints._support.BoundConstraintSpec]) –
show_constraints (Optional[bool]) –
-
get_params_by_name
(self, names)[source]¶ - Parameters
names (Iterable[str]) –
- Return type
Sequence[click.Parameter]
-
format_help
(self, ctx, formatter)[source]¶ - Parameters
formatter (click.HelpFormatter) –
- Return type
-
cloup.
constraint
(constr, params)[source]¶ Registers a constraint.
- Parameters
constr (cloup.constraints._core.Constraint) –
params (Iterable[str]) –