Field

Inheritance diagram of musify.field

All core Field implementations relating to core MusifyItem and :py:class`MusifyCollection` implementations.

Classes:

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.

TrackFieldMixin(value[,Β names,Β module,Β ...])

Applies extra functionality to the TagField enum for TagField types relating to Track types

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

Represents all currently supported fields for objects of type Track

PlaylistField(value[,Β names,Β module,Β ...])

Represents all currently supported fields for objects of type Playlist

FolderField(value[,Β names,Β module,Β ...])

Represents all currently supported fields for objects of type Folder

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

Represents all currently supported fields for objects of type Album

ArtistField(value[,Β names,Β module,Β ...])

Represents all currently supported fields for objects of type Artist

class musify.field.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.field.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

ARTISTS

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
ARTISTS = 108
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.field.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.field.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.field.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
class musify.field.TrackFieldMixin(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: TagField

Applies extra functionality to the TagField enum for TagField types relating to Track types

Methods:

map(enum)

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

classmethod map(enum)

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

Return type:

list[Self]

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

Bases: TrackFieldMixin

Represents all currently supported fields for objects of type Track

Attributes:

ALL

TITLE

ARTIST

ALBUM

ALBUM_ARTIST

TRACK

TRACK_NUMBER

TRACK_TOTAL

GENRES

DATE

YEAR

MONTH

DAY

BPM

KEY

DISC

DISC_NUMBER

DISC_TOTAL

COMPILATION

COMMENTS

IMAGES

LENGTH

RATING

URI

ALL = 0
TITLE = 65
ARTIST = 32
ALBUM = 30
ALBUM_ARTIST = 31
TRACK = 586
TRACK_NUMBER = 86
TRACK_TOTAL = 87
GENRES = 59
DATE = 900
YEAR = 35
MONTH = 901
DAY = 902
BPM = 85
KEY = 903
DISC = 552
DISC_NUMBER = 52
DISC_TOTAL = 54
COMPILATION = 904
COMMENTS = 44
IMAGES = 905
LENGTH = 16
RATING = 75
URI = 941
class musify.field.PlaylistField(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Field

Represents all currently supported fields for objects of type Playlist

Attributes:

ALL

TRACK_TOTAL

IMAGES

LENGTH

DATE_CREATED

DATE_MODIFIED

DESCRIPTION

ALL = 0
TRACK_TOTAL = 87
IMAGES = 905
LENGTH = 16
DATE_CREATED = 921
DATE_MODIFIED = 11
DESCRIPTION = 931
class musify.field.FolderField(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Field

Represents all currently supported fields for objects of type Folder

Attributes:

ALL

TRACK_TOTAL

GENRES

IMAGES

COMPILATION

LENGTH

FOLDER

ALL = 0
TRACK_TOTAL = 87
GENRES = 59
IMAGES = 905
COMPILATION = 904
LENGTH = 16
FOLDER = 179
class musify.field.AlbumField(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Field

Represents all currently supported fields for objects of type Album

Attributes:

ALL

ARTIST

ALBUM

ALBUM_ARTIST

TRACK_TOTAL

GENRES

DATE

YEAR

MONTH

DAY

DISC_TOTAL

COMPILATION

IMAGES

LENGTH

RATING

ALL = 0
ARTIST = 32
ALBUM = 30
ALBUM_ARTIST = 31
TRACK_TOTAL = 87
GENRES = 59
DATE = 900
YEAR = 35
MONTH = 901
DAY = 902
DISC_TOTAL = 54
COMPILATION = 904
IMAGES = 905
LENGTH = 16
RATING = 75
class musify.field.ArtistField(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Field

Represents all currently supported fields for objects of type Artist

Attributes:

ALL

ARTIST

TRACK_TOTAL

GENRES

IMAGES

LENGTH

RATING

ALL = 0
ARTIST = 32
TRACK_TOTAL = 87
GENRES = 59
IMAGES = 905
LENGTH = 16
RATING = 75