types

Type aliases and constants used in the package config.

class advanced_alchemy.config.types.Mapping[source]

Bases: Collection

A Mapping is a generic container for associating key/value pairs.

This class provides concrete generic implementations of all methods except for __getitem__, __iter__, and __len__.

get(k[, d]) D[k] if k in D, else d.  d defaults to None.[source]
items() a set-like object providing a view on D's items[source]
keys() a set-like object providing a view on D's keys[source]
values() an object providing a view on D's values[source]
class advanced_alchemy.config.types.Sequence[source]

Bases: Reversible, Collection

All the operations on a read-only sequence.

Concrete subclasses must override __new__ or __init__, __getitem__, and __len__.

count(value) integer -- return number of occurrences of value[source]
index(value[, start[, stop]]) integer -- return first index of value.[source]

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

class advanced_alchemy.config.types.Any[source]

Bases: object

Special type indicating an unconstrained type.

  • Any is compatible with every type.

  • Any assumed to have all methods.

  • All values assumed to be instances of Any.

Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should not be used with instance checks.

static __new__(cls, *args, **kwargs)[source]
advanced_alchemy.config.types.TypeEncodersMap

Type alias for a mapping of type encoders.

Maps types to their encoder functions.

alias of Mapping[Any, Callable[[Any], Any]]

advanced_alchemy.config.types.TypeDecodersSequence

Type alias for a sequence of type decoders.

Each tuple contains a type check predicate and its corresponding decoder function.

alias of Sequence[tuple[Callable[[Any], bool], Callable[[Any, Any], Any]]]

advanced_alchemy.config.types.CommitStrategy

Commit strategy for SQLAlchemy sessions.

Values:

always: Always commit the session after operations match_status: Only commit if the HTTP status code indicates success

alias of Literal[‘always’, ‘match_status’]