v1 · Configuration
Legacy v1 parameter declarations, flags, prefixes, and CLI decorators.
These compatibility APIs ship with the selected source version. See the compatibility overview for other v1/v2 APIs, or migration when upgrading.
API index
| Name | Kind | Defined in |
|---|---|---|
is_hidden | function | params_proto.v1.params_proto |
ParamsProto | class | params_proto.v1.params_proto |
Proto | function | params_proto.v1.params_proto |
BoolFlag | function | params_proto.v1.params_proto |
prefix_proto | function | params_proto.v1.params_proto |
cli_parse | function | params_proto.v1.params_proto |
proto_signature | function | params_proto.v1.params_proto |
proto_partial | function | params_proto.v1.params_proto |
PREFIXES | attribute | params_proto.v1.params_proto |
params_proto.v1
Public imports
These symbols are available from this module. Their definitions are documented in the linked modules.
is_hidden—params_proto.v1.params_proto.is_hiddenParamsProto—params_proto.v1.params_proto.ParamsProtoProto—params_proto.v1.params_proto.ProtoBoolFlag—params_proto.v1.params_proto.BoolFlagprefix_proto—params_proto.v1.params_proto.prefix_protocli_parse—params_proto.v1.params_proto.cli_parseproto_signature—params_proto.v1.params_proto.proto_signatureproto_partial—params_proto.v1.params_proto.proto_partialPREFIXES—params_proto.v1.params_proto.PREFIXES
params_proto.v1.params_proto
is_hidden
is_hidden(k: str) → boolreturn True is method is hidden
Parameters
| Parameter | Type / default | Description |
|---|---|---|
k | strrequired | — |
Returns
bool
ParamsProto
ParamsProto(proto, **d)Parameter ptype Class, has toDict method and proto attribute for the original namespace object.
Parameters
| Parameter | Type / default | Description |
|---|---|---|
proto | —required | — |
**d | —variadic | — |
ParamsProto.__init__
ParamsProto.__init__(proto, **d)Parameters
| Parameter | Type / default | Description |
|---|---|---|
proto | —required | — |
**d | —variadic | — |
Proto
Proto(default: T, help = None, dtype = None, aliases = None, **kwargs) → TParameters
| Parameter | Type / default | Description |
|---|---|---|
default | Trequired | — |
help | —= None | — |
dtype | —= None | — |
aliases | —= None | — |
**kwargs | —variadic | — |
Returns
T
BoolFlag
BoolFlag(default: bool, help = None, aliases = None, **kwargs) → Tthis one generates a boolean flag that requires no arguments.
The value of the flag is the opposite of the default. if default is True, then --bool-flag (such as --no-flag) would return False. if default is False, then (such as --render) would return True.
Parameters
| Parameter | Type / default | Description |
|---|---|---|
default | boolrequired | — |
help | —= None | — |
aliases | —= None | — |
**kwargs | —variadic | — |
Returns
T
prefix_proto
prefix_proto(prefix_or_fn: Union[str, None, Callable] = None, parse = False, **ext)Parameters
| Parameter | Type / default | Description |
|---|---|---|
prefix_or_fn | Union[str, None, Callable]= None | — |
parse | —= False | — |
**ext | —variadic | — |
cli_parse
cli_parse(proto: T) → Tparser command line options, and repackage into a typed object.
Parameters
| Parameter | Type / default | Description |
|---|---|---|
proto | Trequired | T |
Returns
T
proto_signature
proto_signature(parameter_prototype, need_self = False)Parameters
| Parameter | Type / default | Description |
|---|---|---|
parameter_prototype | —required | — |
need_self | —= False | — |
proto_partial
proto_partial(proto, method = False)Overrides the function with values from the Proto Object.
Parameters
| Parameter | Type / default | Description |
|---|---|---|
proto | —required | — |
method | —= False | — |
PREFIXES
PREFIXES = []