Enum

Inheritance diagram of musify.core.enum

The fundamental core enum classes for the entire package.

Classes:

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

Generic class for IntEnum implementations for the entire package.

Field(value[,Β names,Β module,Β qualname,Β ...])

Base class for field names of an item.

Fields(value[,Β names,Β module,Β qualname,Β ...])

All possible Field enums in this program.

TagMap([title,Β artist,Β album,Β album_artist,Β ...])

Map of human-friendly tag name to ID3 tag ids for a file type

TagField(value[,Β names,Β module,Β qualname,Β ...])

Applies extra functionality to Field for objects which contain modifiable tags

TagFields(value[,Β names,Β module,Β qualname,Β ...])

All possible TagField enums in this program.

class musify.core.enum.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]

class musify.core.enum.Field(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: MusifyEnum

Base class for field names of an item.

Methods:

from_name(*names)

Returns all enums that match the given enum names

from_value(*values)

Returns all enums that match the given enum values

classmethod from_name(*names)

Returns all enums that match the given enum names

Raises:

EnumNotFoundError – If a corresponding enum cannot be found.

Return type:

list[Self]

classmethod from_value(*values)

Returns all enums that match the given enum values

Raises:

EnumNotFoundError – If a corresponding enum cannot be found.

Return type:

list[Self]

class musify.core.enum.Fields(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Field

All possible Field enums in this program.

This is used to ensure all Field enum implementations have the same values for their enum names.

Attributes:

ALL

NAME

TITLE

ARTIST

ALBUM

ALBUM_ARTIST

TRACK_NUMBER

TRACK_TOTAL

GENRES

DATE

YEAR

MONTH

DAY

BPM

KEY

DISC_NUMBER

DISC_TOTAL

COMPILATION

COMMENTS

IMAGES

LENGTH

RATING

COMPOSER

CONDUCTOR

PUBLISHER

PATH

FOLDER

FILENAME

EXT

SIZE

TYPE

CHANNELS

BIT_RATE

BIT_DEPTH

SAMPLE_RATE

DATE_CREATED

DATE_MODIFIED

DATE_ADDED

LAST_PLAYED

PLAY_COUNT

DESCRIPTION

URI

USER_ID

USER_NAME

OWNER_ID

OWNER_NAME

FOLLOWERS

ALL = 0
NAME = 1000
TITLE = 65
ARTIST = 32
ALBUM = 30
ALBUM_ARTIST = 31
TRACK_NUMBER = 86
TRACK_TOTAL = 87
GENRES = 59
DATE = 900
YEAR = 35
MONTH = 901
DAY = 902
BPM = 85
KEY = 903
DISC_NUMBER = 52
DISC_TOTAL = 54
COMPILATION = 904
COMMENTS = 44
IMAGES = 905
LENGTH = 16
RATING = 75
COMPOSER = 43
CONDUCTOR = 45
PUBLISHER = 73
PATH = 106
FOLDER = 179
FILENAME = 3
EXT = 100
SIZE = 7
TYPE = 4
CHANNELS = 8
BIT_RATE = 10
BIT_DEPTH = 183
SAMPLE_RATE = 9
DATE_CREATED = 921
DATE_MODIFIED = 11
DATE_ADDED = 12
LAST_PLAYED = 13
PLAY_COUNT = 14
DESCRIPTION = 931
URI = 941
USER_ID = 942
USER_NAME = 943
OWNER_ID = 944
OWNER_NAME = 945
FOLLOWERS = 946
class musify.core.enum.TagMap(title=(), artist=(), album=(), album_artist=(), track_number=(), track_total=(), genres=(), date=(), year=(), month=(), day=(), bpm=(), key=(), disc_number=(), disc_total=(), compilation=(), comments=(), images=())

Bases: object

Map of human-friendly tag name to ID3 tag ids for a file type

Attributes:

title

artist

album

album_artist

track_number

track_total

genres

date

year

month

day

bpm

key

disc_number

disc_total

compilation

comments

images

title: Sequence[str] = ()
artist: Sequence[str] = ()
album: Sequence[str] = ()
album_artist: Sequence[str] = ()
track_number: Sequence[str] = ()
track_total: Sequence[str] = ()
genres: Sequence[str] = ()
date: Sequence[str] = ()
year: Sequence[str] = ()
month: Sequence[str] = ()
day: Sequence[str] = ()
bpm: Sequence[str] = ()
key: Sequence[str] = ()
disc_number: Sequence[str] = ()
disc_total: Sequence[str] = ()
compilation: Sequence[str] = ()
comments: Sequence[str] = ()
images: Sequence[str] = ()
class musify.core.enum.TagField(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Field

Applies extra functionality to Field for objects which contain modifiable tags

Methods:

all([only_tags])

Get all enums for this enum.

to_tag()

Returns all human-friendly tag names for the current enum value.

to_tags(tags)

Returns all human-friendly tag names for the given enum value.

classmethod all(only_tags=False)

Get all enums for this enum. When only_tags is True, returns only those enums that represent a tag for this TagField type.

Return type:

list[Self]

to_tag()

Returns all human-friendly tag names for the current enum value.

Applies mapper to enums before returning as per map(). This will only return tag names if they are found in TagMap.

Return type:

set[str]

classmethod to_tags(tags)

Returns all human-friendly tag names for the given enum value.

Applies mapper to enums before returning as per map(). This will only return tag names if they are found in TagMap.

Return type:

set[str]

class musify.core.enum.TagFields(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: TagField

All possible TagField enums in this program.

This is used to ensure all TagField enum implementations have the same values for their enum names.

Attributes:

ALL

NAME

TITLE

ARTIST

ALBUM

ALBUM_ARTIST

TRACK_NUMBER

TRACK_TOTAL

GENRES

DATE

YEAR

MONTH

DAY

BPM

KEY

DISC_NUMBER

DISC_TOTAL

COMPILATION

COMMENTS

IMAGES

LENGTH

RATING

COMPOSER

CONDUCTOR

PUBLISHER

PATH

FOLDER

FILENAME

EXT

SIZE

TYPE

CHANNELS

BIT_RATE

BIT_DEPTH

SAMPLE_RATE

DATE_CREATED

DATE_MODIFIED

DATE_ADDED

LAST_PLAYED

PLAY_COUNT

DESCRIPTION

URI

USER_ID

USER_NAME

OWNER_ID

OWNER_NAME

FOLLOWERS

ALL = 0
NAME = 1000
TITLE = 65
ARTIST = 32
ALBUM = 30
ALBUM_ARTIST = 31
TRACK_NUMBER = 86
TRACK_TOTAL = 87
GENRES = 59
DATE = 900
YEAR = 35
MONTH = 901
DAY = 902
BPM = 85
KEY = 903
DISC_NUMBER = 52
DISC_TOTAL = 54
COMPILATION = 904
COMMENTS = 44
IMAGES = 905
LENGTH = 16
RATING = 75
COMPOSER = 43
CONDUCTOR = 45
PUBLISHER = 73
PATH = 106
FOLDER = 179
FILENAME = 3
EXT = 100
SIZE = 7
TYPE = 4
CHANNELS = 8
BIT_RATE = 10
BIT_DEPTH = 183
SAMPLE_RATE = 9
DATE_CREATED = 921
DATE_MODIFIED = 11
DATE_ADDED = 12
LAST_PLAYED = 13
PLAY_COUNT = 14
DESCRIPTION = 931
URI = 941
USER_ID = 942
USER_NAME = 943
OWNER_ID = 944
OWNER_NAME = 945
FOLLOWERS = 946