pydantic_sweep.types

Attributes

StrictPath

A tuple-path of keys for a pydantic model.

Path

Anything that can be converted to a tuple-path (str or iterable of str).

FieldValue

The possible values that should be assigned to a field.

Config

A nested config dictionary for configurations.

Classes

Combiner

A function that yields tuples of items.

Chainer

A function that chains iterables together.

Module Contents

pydantic_sweep.types.StrictPath: TypeAlias = tuple[str, ...][source]

A tuple-path of keys for a pydantic model.

pydantic_sweep.types.Path: TypeAlias = Iterable[str] | str[source]

Anything that can be converted to a tuple-path (str or iterable of str).

pydantic_sweep.types.FieldValue: TypeAlias = Hashable | pydantic.BaseModel[source]

The possible values that should be assigned to a field.

Fields should be hashable (and therefore immutable) values. That makes them safer to use in a configuration, since unlike mutable types they can not be modified inplace.

pydantic_sweep.types.Config: TypeAlias = dict[str, Union[FieldValue, 'Config']][source]

A nested config dictionary for configurations.

class pydantic_sweep.types.Combiner[source]

Bases: Protocol[T]

A function that yields tuples of items.

__call__(*configs: collections.abc.Iterable[T]) collections.abc.Iterable[tuple[T, Ellipsis]][source]
class pydantic_sweep.types.Chainer[source]

Bases: Protocol[T]

A function that chains iterables together.

__call__(*configs: collections.abc.Iterable[T]) collections.abc.Iterable[T][source]