Types

Inheritance diagram of musify.types

All core type hints to use throughout the entire package.

Classes:

MusifyEnum(new_class_name, /, names, *[, ...])

Generic class for IntEnum implementations for the entire package.

class musify.types.MusifyEnum(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

Generic class for IntEnum implementations for the entire package.

Methods:

map(enum)

Optional mapper to apply to the enum found during all(), from_name(), and from_value() calls

all()

Get all enums for this enum.

from_name(*names[, fail_on_many])

Returns all enums that match the given enum names

from_value(*values[, fail_on_many])

Returns all enums that match the given enum values

classmethod map(enum)

Optional mapper to apply to the enum found during all(), from_name(), and from_value() calls

Return type:

list[Self]

classmethod all()

Get all enums for this enum.

Return type:

list[Self]

classmethod from_name(*names, fail_on_many=True)

Returns all enums that match the given enum names

Parameters:

fail_on_many (bool (default: True)) – If more than one enum is found, raise an exception.

Raises:

EnumNotFoundError – If a corresponding enum cannot be found.

Return type:

list[Self]

classmethod from_value(*values, fail_on_many=True)

Returns all enums that match the given enum values

Parameters:

fail_on_many (bool (default: True)) – If more than one enum is found, raise an exception.

Raises:

EnumNotFoundError – If a corresponding enum cannot be found.

Return type:

list[Self]