Typesļƒ

Inheritance diagram of musify.types

All core type hints to use throughout the entire package.

Classes:

MusifyEnum(value[,Ā names,Ā module,Ā qualname,Ā ...])

Generic class for IntEnum implementations for the entire package.

class musify.types.MusifyEnum(value, names=<not given>, *values, 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]