Types Module
Provides custom type definitions and TypeVars used throughout the library.
Includes type aliases for structured color formats, path representations,
and generic nested data structures.
Seq
type Seq[T] = list[T] | tuple[T, ...]Union of all built-in sequence types (list, tuple).
is_seq()
def is_seq(obj: object, item_type: type[Any] | tuple[type[Any], ...] | None = None, /) -> boolReturns true if obj is an instance that matches the Seq type,
optionally checking if all contained elements are instances of item_type.
obj– The object to check.item_type– An optional type or tuple of types to check each contained element against.
SeqOrSet
type SeqOrSet[T] = list[T] | tuple[T, ...] | set[T] | frozenset[T]Union of all built-in sequence and set types (list, tuple, set, frozenset).
is_seq_or_set()
def is_seq_or_set(obj: object, item_type: type[Any] | tuple[type[Any], ...] | None = None, /) -> boolReturns true if obj is an instance that matches the SeqOrSet type,
optionally checking if all contained elements are instances of item_type.
obj– The object to check.item_type– An optional type or tuple of types to check each contained element against.
DataObj
type DataObj = list[Any] | tuple[Any, ...] | set[Any] | frozenset[Any] | dict[Any, Any]Union of supported data structures used in the data module.
is_data_obj()
def is_data_obj(obj: object, /) -> TypeIs[DataObj]Returns true if obj is an instance that matches the DataObj type.
is_dict()
def is_dict(obj: object, /) -> TypeIs[dict[Any, Any]]Returns true if obj is an instance that matches the dict type.
PathsList
type PathsList = list[Path] | list[str] | list[Path | str] | tuple[Path, ...] | tuple[str, ...] | tuple[Path | str, ...]Union of all supported collection types for paths.
is_paths_list()
def is_paths_list(obj: object, /) -> TypeIs[PathsList]Returns true if obj is an instance that matches the PathsList type.
Rgba
type Rgba = tuple[int, int, int] | tuple[int, int, int, float] | list[int] | list[int | float] | RgbaDict | _RgbaObjStructured RGBA color representations:
3- or 4-item tuple or list (RGB[A]), RgbaDict, or an RGBA protocol-compatible object.
Hsla
type Hsla = tuple[int, int, int] | tuple[int, int, int, float] | list[int] | list[int | float] | HslaDict | _HslaObjStructured HSLA color representations:
3- or 4-item tuple or list (HSL[A]), HslaDict, or an HSLA protocol-compatible object.
Hexa
type Hexa = str | int | _HexaObjHexadecimal color representations:
Hex str (with or without prefix), 24-bit hex int, or a hex protocol-compatible object.
MissingLibsMsgs
class MissingLibsMsgsConfiguration schema for custom messages in system.check_libs() when checking library dependencies.
.found_missing
found_missing: strMessage to display when one or more libraries are missing.
.should_install
should_install: strConfirmation message to ask the user if they want to install the missing libraries.
ProgressUpdater
class ProgressUpdaterProtocol for a progress updater function used in terminal progress bars.