Schema¶
Parser Schema¶
- class ExecutableFlag[source]¶
Zero-argument executable CLI flag that short-circuits normal command execution.
- class Argument[source]¶
Schema entry describing a single CLI argument.
- kind¶
Whether the argument is positional or optional.
- Type:
- value_shape¶
Expected value shape for parsing.
- Type:
- default¶
Default value or argparse sentinel.
- Type:
Any
- boolean_behavior¶
Boolean flag behavior details.
- Type:
BooleanBehavior | None
- choices¶
Allowed values, if any.
- Type:
Sequence[Any] | None
- model_default¶
Default model instance or sentinel.
- Type:
Any
- value_plan¶
Internal conversion plan for nested values.
- Type:
ArgumentValue | None
- class Command[source]¶
Schema entry describing a CLI command and its parameters.
- obj¶
Inspected callable backing the command.
- Type:
Class | Function | Method | None
- help_layout¶
Help layout used for formatting.
- Type:
HelpLayout | None
- pipe_targets¶
Pipe target configuration for stdin.
- Type:
PipeTargets | None
- executable_flags¶
Zero-argument executable flags.
- Type:
- command_type¶
Command category.
- Type:
CommandType
- class ParserSchema[source]¶
Schema container for a complete CLI parser.
- pipe_targets¶
Default pipe target configuration.
- Type:
PipeTargets | None
- theme¶
Help layout for formatting.
- Type:
HelpLayout
- executable_flags¶
Parser-root executable flags.
- Type:
Pipe Input¶
- class PipeTargets[source]¶
Configuration for routing stdin content to parameters.
- targets¶
Ordered parameter names that receive piped chunks. The order defines how chunks map to parameters.
- delimiter¶
Chunk delimiter. If
None, chunking uses line breaks. If more than one target is set and the delimiter is not explicitly provided, a newline is assumed by default.- Type:
str | None
- priority¶
Conflict resolution policy. -
"cli"keeps explicit CLI arguments and only fills missing ones from the pipe. -"pipe"overwrites CLI values with piped data.- Type:
PipePriority
- allow_partial¶
If True, fewer chunks than targets are allowed. Missing chunks become
Noneand are ignored unless the parameter is required.- Type:
- TargetsInput = interfacy.pipe.PipeTargets | str | collections.abc.Sequence[str] | dict[str, typing.Any]¶
Represent a PEP 604 union type
E.g. for int | str
- build_pipe_targets_config(
- targets,
- *,
- delimiter=DELIMITER_UNSET,
- allow_partial=None,
- priority=None,
Build a normalized PipeTargetsConfig from user input.
- This function accepts multiple declaration styles:
Existing
PipeTargetsConfigto optionally override fields.A string or sequence of parameter names.
- A dict with keys:
parametersorbindings: the target names.delimiter: optional chunk delimiter.allow_partial: optional boolean.priority: ‘cli’ or ‘pipe’
If more than one target is provided and no delimiter is explicitly set, a newline is used by default.