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.

FlexibleConfig

A flexible config that allows any Path.

Classes

Combiner

A function that yields tuples of items.

Chainer

A function that chains iterables together.

Module Contents

type pydantic_sweep.types.StrictPath = tuple[str, ...][source]

A tuple-path of keys for a pydantic model.

type pydantic_sweep.types.Path = str | Iterable[str] | 'StrictPath'[source]

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

type pydantic_sweep.types.FieldValue = 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.

type pydantic_sweep.types.Config = dict[str, 'FieldValue' | 'Config'][source]

A nested config dictionary for configurations.

type pydantic_sweep.types.FlexibleConfig = dict['Path', 'FieldValue' | 'FlexibleConfig'][source]

A flexible config that allows any Path.

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]