api
Class info¶
🛈 DocStrings¶
fill(): one call to get a value from the user, whatever the terminal can do.
fill
async
¶
fill(
target: type[T] | FormTarget[T],
*,
title: str | None = None,
initial: Mapping[str, Any] | None = None,
ui: UI = "auto",
) -> T
fill(
target: type[Any] | FormTarget[Any] | Mapping[str, Any],
*,
title: str | None = None,
initial: Mapping[str, Any] | None = None,
ui: UI = "auto",
) -> Any
Ask the user to fill a form and return the validated result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
type[Any] | FormTarget[Any] | Mapping[str, Any]
|
A JSON Schema (gives a dict), or a Python type such as a pydantic model or dataclass (gives an instance). |
required |
title
|
str | None
|
Heading of the form (default: the schema's title). |
None
|
initial
|
Mapping[str, Any] | None
|
Starting values (default: the schema's defaults). |
None
|
ui
|
UI
|
|
'auto'
|
Raises:
| Type | Description |
|---|---|
FormCancelledError
|
The user cancelled. |