pydantic_sweep.cli

Classes

CLI

ModelDumpCLI

A CLI Interface that passes a compressed model dump as on the CLI.

FileCLI

A CLI Interface that loads the model from a configuration file.

Module Contents

class pydantic_sweep.cli.CLI[source]
classmethod execute_script(script: os.PathLike | str, model: pydantic.BaseModel, **kwargs: Any) subprocess.CompletedProcess[source]

Call the CLI interface to load the model.

static cli_args(model: pydantic.BaseModel, /) list[str][source]
Abstractmethod:

Convert the model to a list of CLI arguments.

static from_cli(model_cls: type[pydantic_sweep.types.BaseModelT], /) pydantic_sweep.types.BaseModelT[source]
Abstractmethod:

Load the model from a list of CLI arguments.

class pydantic_sweep.cli.ModelDumpCLI[source]

Bases: CLI

A CLI Interface that passes a compressed model dump as on the CLI.

static cli_args(model: pydantic.BaseModel, /) list[str][source]

Dump the model to a list of CLI arguments.

static from_cli(model_cls: type[pydantic_sweep.types.BaseModelT], /) pydantic_sweep.types.BaseModelT[source]

Load the model from a list of CLI arguments.

class pydantic_sweep.cli.FileCLI[source]

Bases: CLI

A CLI Interface that loads the model from a configuration file.

static cli_args(model: pydantic.BaseModel, /, *, path: str | os.PathLike) list[str][source]

Dump the model to a temporary configuration file and return its path.

static from_cli(model_cls: type[pydantic_sweep.types.BaseModelT], /) pydantic_sweep.types.BaseModelT[source]

Load the model from a configuration file specified on the CLI.