Music Module Reference
New in version 0.0.1.
Control the macOS Music application using JXA-like syntax.
Classes:
|
An enumeration. |
|
An AirPlay device. |
|
A wrapper around lists of AirPlay devices that employs fast enumeration techniques. |
|
A class for managing and interacting with Music.app. |
|
An artwork in media apps. |
|
A wrapper around lists of music artworks that employs fast enumeration techniques. |
|
An audio CD playlist in Music.app. |
|
A wrapper around lists of audio CD playlists that employs fast enumeration techniques. |
|
An audio CD track in Music.app. |
|
A wrapper around lists of music audio CD tracks that employs fast enumeration techniques. |
|
A browser window of media apps. |
|
A wrapper around lists of music browser windows that employs fast enumeration techniques. |
|
An equalizer preset in Music.app. |
|
A wrapper around lists of equalizer presets that employs fast enumeration techniques. |
|
An equalizer window in Music.app. |
|
A wrapper around lists of music equalizer windows that employs fast enumeration techniques. |
|
An encoder in Music.app. |
|
A wrapper around lists of encoders that employs fast enumeration techniques. |
|
A file track in media apps. |
|
A wrapper around lists of music file tracks that employs fast enumeration techniques. |
|
A folder playlist in media apps. |
|
A wrapper around lists of music folder playlists that employs fast enumeration techniques. |
|
A generic class with methods common to the various playable media classes in media apps. |
|
A wrapper around lists of music items that employs fast enumeration techniques. |
|
The library playlist in media apps. |
|
A wrapper around lists of library playlists that employs fast enumeration techniques. |
|
A miniplayer window in Music.app. |
|
A wrapper around lists of music miniplayer windows that employs fast enumeration techniques. |
|
A playlist in Music.app. |
|
A wrapper around lists of playlists that employs fast enumeration techniques. |
|
A playlist window in media apps. |
|
A wrapper around lists of music playlist windows that employs fast enumeration techniques. |
|
A radio playlist in Music.app. |
|
A wrapper around lists of radio tuner playlists that employs fast enumeration techniques. |
|
A shared track in media apps. |
|
A wrapper around lists of music shared tracks that employs fast enumeration techniques. |
|
A media source in Music.app. |
|
A wrapper around lists of sources that employs fast enumeration techniques. |
|
A subscription playlist from Apple Music in Music.app. |
|
A wrapper around lists of subscription playlists that employs fast enumeration techniques. |
|
A class for managing and interacting with tracks in Music.app. |
|
A wrapper around lists of music tracks that employs fast enumeration techniques. |
|
A URL track in media apps. |
|
A wrapper around lists of music URL tracks that employs fast enumeration techniques. |
|
A user-created playlist in Music.app. |
|
A wrapper around lists of music user playlists that employs fast enumeration techniques. |
|
A video window in media apps. |
|
A wrapper around lists of music video windows that employs fast enumeration techniques. |
|
A music visual in Music.app. |
|
A wrapper around lists of music visuals that employs fast enumeration techniques. |
|
A window of Music.app. |
|
A wrapper around lists of music windows that employs fast enumeration techniques. |
- class PyXA.apps.Music.MusicObjectClass(value)[source]
Bases:
Enum
An enumeration.
Attributes:
- AIRPLAY_DEVICE = 'cAPD'
- APPLICATION = 'capp'
- ARTWORK = 'cArt'
- AUDIO_CD_PLAYLIST = 'cCDP'
- AUDIO_CD_TRACK = 'cCDT'
- BROWSER_WINDOW = 'cBrW'
- ENCODER = 'cEnc'
- EQ_PRESET = 'cEQP'
- EQ_WINDOW = 'cEQW'
- FILE_TRACK = 'cFlT'
- FOLDER_PlAYLIST = 'cFoP'
- ITEM = 'cobj'
- LIBRARY_PLAYLIST = 'cLiP'
- MINIPLAYER_WINDOW = 'cMPW'
- PLAYLIST = 'cPly'
- PLAYLIST_WINDOW = 'cPlW'
- RADIO_TUNER_PLAYLIST = 'cRTP'
- SHARED_TRACK = 'cShT'
- SOURCE = 'cSrc'
- SUBSCRIPTION_PLAYLIST = 'cSuP'
- TRACK = 'cTrk'
- URL_TRACK = 'cURT'
- USER_PLAYLIST = 'cUsP'
- VIDEO_WINDOW = 'cNPW'
- VISUAL = 'cVis'
- WINDOW = 'cwin'
- class PyXA.apps.Music.XAMusicAirPlayDevice(properties)[source]
Bases:
XAMusicItem
An AirPlay device.
See also
New in version 0.0.7.
Attributes:
Whether the device is currently being played to.
Whether the device is currently available.
The kind of the device.
The MAC address of the device.
Whether the device is password/passcode protected.
Whether the device is currently selected.
The output volume for the device from 0 to 100.
Whether the device supports audio playback.
Whether the device supports video playback.
- property active: bool
Whether the device is currently being played to.
- property available: bool
Whether the device is currently available.
- property kind: DeviceKind
The kind of the device.
- property network_address: str
The MAC address of the device.
- property protected: bool
Whether the device is password/passcode protected.
- property selected: bool
Whether the device is currently selected.
- property sound_volume: int
The output volume for the device from 0 to 100.
- property supports_audio: bool
Whether the device supports audio playback.
- property supports_video: bool
Whether the device supports video playback.
- class PyXA.apps.Music.XAMusicAirPlayDeviceList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicItemList
A wrapper around lists of AirPlay devices that employs fast enumeration techniques.
All properties of AirPlay devices can be called as methods on the wrapped list, returning a list containing each devices’s value for the property.
See also
New in version 0.0.7.
Methods:
active
()by_active
(active)by_available
(available)by_kind
(kind)by_network_address
(network_address)by_protected
(protected)by_selected
(selected)by_sound_volume
(sound_volume)by_supports_audio
(supports_audio)by_supports_video
(supports_video)kind
()selected
()- by_active(active: bool) XAMusicAirPlayDevice | None [source]
- by_available(available: bool) XAMusicAirPlayDevice | None [source]
- by_kind(kind: DeviceKind) XAMusicAirPlayDevice | None [source]
- by_network_address(network_address: str) XAMusicAirPlayDevice | None [source]
- by_protected(protected: bool) XAMusicAirPlayDevice | None [source]
- by_selected(selected: bool) XAMusicAirPlayDevice | None [source]
- by_sound_volume(sound_volume: int) XAMusicAirPlayDevice | None [source]
- by_supports_audio(supports_audio: bool) XAMusicAirPlayDevice | None [source]
- by_supports_video(supports_video: bool) XAMusicAirPlayDevice | None [source]
- kind() list[DeviceKind] [source]
- class PyXA.apps.Music.XAMusicApplication(properties)[source]
Bases:
XASBApplication
,XACanOpenPath
A class for managing and interacting with Music.app.
See also
XAMusicWindow
, class:XAMusicSource,XAMusicPlaylist
,XAMusicTrack
New in version 0.0.1.
Classes:
DeviceKind
(value)Kinds of devices.
MediaKind
(value)Types of media items.
ObjectType
(value)Types of objects that can be created using the
make()
method.PlayerState
(value)States of the music player.
PlaylistKind
(value)Types of special playlists.
PrintSetting
(value)Options to use when printing.
RatingKind
(value)Types of ratings for media items.
RepeatMode
(value)Options for how to repeat playback.
SearchFilter
(value)Filter restrictions on search results.
ShuffleMode
(value)Options for how to shuffle playback.
SourceKind
(value)Types of sources for media items.
iCloudStatus
(value)iCloud statuses of media items.
Methods:
add_to_playlist
(urls, playlist)airplay_devices
([filter])Returns a list of AirPlay devices, as PyXA objects, matching the given filter.
audio_cd_playlists
([filter])Returns a list of audio CD playlists, as PyXA objects, matching the given filter.
audio_cd_tracks
([filter])Returns a list of audio CD tracks, as PyXA objects, matching the given filter.
Restarts the current track or returns to the previous track if playback is currently at the start.
browser_windows
([filter])Returns a list of browser windows, as PyXA objects, matching the given filter.
encoders
([filter])Returns a list of encoders, as PyXA objects, matching the given filter.
eq_presets
([filter])Returns a list of EQ presets, as PyXA objects, matching the given filter.
eq_windows
([filter])Returns a list of EQ windows, as PyXA objects, matching the given filter.
Repeated skip forward in the track until resume() is called.
file_tracks
([filter])Returns a list of file tracks, as PyXA objects, matching the given filter.
library_playlists
([filter])Returns a list of library playlists, as PyXA objects, matching the given filter.
make
(specifier, properties[, data])Creates a new element of the given specifier class without adding it to any list.
miniplayer_windows
([filter])Returns a list of miniplayer windows, as PyXA objects, matching the given filter.
Advances to the next track in the current playlist.
open_location
(video_url)Opens and plays an video stream URL or iTunes Store URL.
pause
()Pauses the current track.
play
([item, play_once])Plays the specified TV item (e.g. track, playlist, etc.).
playlist_windows
([filter])Returns a list of playlist windows, as PyXA objects, matching the given filter.
playlists
([filter])Returns a list of playlists, as PyXA objects, matching the given filter.
Toggles the playing/paused state of the current track.
Returns to the previous track in the current playlist.
radio_tuner_playlists
([filter])Returns a list of radio tuner playlists, as PyXA objects, matching the given filter.
resume
()Returns to normal playback after calls to fast_forward() or rewind().
rewind
()Repeatedly skip backward in the track until resume() is called.
set_volume
(new_volume)Sets the volume of playback.
shared_tracks
([filter])Returns a list of shared tracks, as PyXA objects, matching the given filter.
sources
([filter])Returns a list of sources, as PyXA objects, matching the given filter.
stop
()Stops playback of the current track.
subscription_playlists
([filter])Returns a list of subscription playlists, as PyXA objects, matching the given filter.
tracks
([filter])Returns a list of tracks, as PyXA objects, matching the given filter.
url_tracks
([filter])Returns a list of URL tracks, as PyXA objects, matching the given filter.
user_playlists
([filter])Returns a list of user playlists, as PyXA objects, matching the given filter.
video_windows
([filter])Returns a list of video windows, as PyXA objects, matching the given filter.
visuals
([filter])Returns a list of visuals, as PyXA objects, matching the given filter.
Attributes:
Whether AirPlay is currently enabled.
Whether a track is currently being converted.
The currently selected AirPlay devices.
The currently selected encoder.
The currently selected equalizer preset.
The playlist containing the currently targeted track.
The name of the currently streaming track.
The URL of the currently streaming track.
The currently playing (or paused but not stopped) track.
The currently selected visual plug-in.
Whether the equalizer is enabled.
Whether the track indices are independent of the order of the current playlist or not.
Whether the application is active or not.
Whether the app is fullscreen or not.
Whether sound output is muted or not.
The name of the application.
The time elapsed in the current track.
Whether the player is playing, paused, stopped, fast forwarding, or rewinding.
The selected media items.
Whether songs are played in random order.
The playback shuffle mode.
The playback repeat mode.
The sound output volume.
The version of the application.
Whether visuals are currently displayed.
- class DeviceKind(value)[source]
Bases:
Enum
Kinds of devices.
Attributes:
An AirPlay-enabled device
An airport express device
An Apple TV device
A BlueTooth-enabled device
A computer device
A HomePod device
An unknown device
- AIRPLAY_DEVICE = 1799442511
An AirPlay-enabled device
- AIRPORT_EXPRESS = 1799442520
An airport express device
- APPLE_TV = 1799442516
An Apple TV device
- BLUETOOTH_DEVICE = 1799442498
A BlueTooth-enabled device
- COMPUTER = 1799442499
A computer device
- HOMEPOD = 1799442504
A HomePod device
- UNKNOWN = 1799442517
An unknown device
- class MediaKind(value)[source]
Bases:
Enum
Types of media items.
Attributes:
A music video media item
A song media item
An unknown media item kind
- MUSIC_VIDEO = 1800823894
A music video media item
- SONG = 1800234067
A song media item
- UNKNOWN = 1800760939
An unknown media item kind
- class ObjectType(value)[source]
Bases:
Enum
Types of objects that can be created using the
make()
method.Attributes:
- AIRPLAY_DEVICE = 'airplay_device'
- ARTWORK = 'artwork'
- AUDIO_CD_PLAYLIST = 'audio_cd_playlist'
- AUDIO_CD_TRACK = 'audio_cd_track'
- BROWSER_WINDOW = 'browser_window'
- ENCODER = 'encoder'
- EQ_PRESET = 'eq_preset'
- EQ_WINDOW = 'eq_window'
- FILE_TRACK = 'file_track'
- FOLDER_PLAYLIST = 'folder_playlist'
- LIBRARY_PLAYLIST = 'library_playlist'
- MINIPLAYER_WINDOW = 'miniplayer_window'
- PLAYLIST = 'playlist'
- PLAYLIST_WINDOW = 'playlist_window'
- RADIO_TUNER_PLAYLIST = 'radio_tuner_playlist'
- SHARED_TRACK = 'shared_track'
- SOURCE = 'source'
- SUBSCRIPTION_PLAYLIST = 'subscription_playlist'
- TRACK = 'track'
- URL_TRACK = 'url_track'
- USER_PLAYLIST = 'user_playlist'
- VIDEO_WINDOW = 'video_window'
- VISUAL = 'visual'
- WINDOW = 'window'
- class PlayerState(value)[source]
Bases:
Enum
States of the music player.
Attributes:
The player is fast forwarding
The player is paused
The player is playing
The player is rewinding
The player is stopped
- FAST_FORWARDING = 1800426310
The player is fast forwarding
- PAUSED = 1800426352
The player is paused
- PLAYING = 1800426320
The player is playing
- REWINDING = 1800426322
The player is rewinding
- STOPPED = 1800426323
The player is stopped
- class PlaylistKind(value)[source]
Bases:
Enum
Types of special playlists.
Attributes:
A folder
A smart playlist
The system library playlist
A playlist containing music items
An unknown playlist kind
The purchased music playlist
An unknown playlist kind
A user-created playlist
The user's library
- FOLDER = 1800630342
A folder
- GENIUS = 1800630343
A smart playlist
- LIBRARY = 1800630348
The system library playlist
- MUSIC = 1800630362
A playlist containing music items
- NONE = 1800302446
An unknown playlist kind
- PURCHASED_MUSIC = 1800630349
The purchased music playlist
- UNKNOWN = 0
An unknown playlist kind
- USER = 1666544464
A user-created playlist
- USER_LIBRARY = 1665952080
The user’s library
- class PrintSetting(value)[source]
Bases:
Enum
Options to use when printing.
Attributes:
A listing of a playlist grouped by album
A printout of the playlist for jewel case inserts
Print a detailed report of PostScript errors
Standard PostScript error handling
A basic listing of tracks within a playlist
- ALBUM_LISTING = 1799449698
A listing of a playlist grouped by album
- CD_INSERT = 1799570537
A printout of the playlist for jewel case inserts
- DETAILED_ERROR_HANDLING = 1819763828
Print a detailed report of PostScript errors
- STANDARD_ERROR_HANDLING = 1819767668
Standard PostScript error handling
- TRACK_LISTING = 1800696427
A basic listing of tracks within a playlist
- class RatingKind(value)[source]
Bases:
Enum
Types of ratings for media items.
Attributes:
A computer generated rating
A user-inputted rating
- COMPUTED = 1800565827
A computer generated rating
- USER = 1800565845
A user-inputted rating
- class RepeatMode(value)[source]
Bases:
Enum
Options for how to repeat playback.
Attributes:
All media items in the current playlist will be repeated
Playback does not repeat
The currently playing media item will be repeated
- ALL = 1799449708
All media items in the current playlist will be repeated
- OFF = 1800564815
Playback does not repeat
- ONE = 1800564785
The currently playing media item will be repeated
- class SearchFilter(value)[source]
Bases:
Enum
Filter restrictions on search results.
Attributes:
Search albums
Search all
Search artists
Search composers
Search the currently displayed playlist
Search track names only
- ALBUMS = 1800630860
Search albums
- ALL = 1799449708
Search all
- ARTISTS = 1800630866
Search artists
- COMPOSERS = 1800630851
Search composers
- DISPLAYED = 1800630870
Search the currently displayed playlist
- NAMES = 1800630867
Search track names only
- class ShuffleMode(value)[source]
Bases:
Enum
Options for how to shuffle playback.
Attributes:
Shuffle by album
Shuffle by grouping
Shuffle by song
- ALBUMS = 1800628289
Shuffle by album
- GROUPINGS = 1800628295
Shuffle by grouping
- SONGS = 1800628307
Shuffle by song
- class SourceKind(value)[source]
Bases:
Enum
Types of sources for media items.
Attributes:
A CD source
The iTunes Store source
A library source
An MP3 file source
A radio source
A shared library source
An unknown source
- AUDIO_CD = 1799439172
A CD source
- ITUNES_STORE = 1799967827
The iTunes Store source
- LIBRARY = 1800169826
A library source
- MP3_CD = 1800225604
An MP3 file source
- RADIO_TUNER = 1800697198
A radio source
- SHARED_LIBRARY = 1800628324
A shared library source
- UNKNOWN = 1800760939
An unknown source
- airplay_devices(filter: dict | None = None) XAMusicAirPlayDeviceList [source]
Returns a list of AirPlay devices, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned AirPlay devices will have, or None
- Returns:
The list of devices
- Return type:
- Example:
>>> import PyXA >>> app = PyXA.Application("Music") >>> print(app.airplay_devices()) <<class 'PyXA.apps.Music.XAMusicAirPlayDeviceList'>['ExampleUser\'s MacBook Pro']>
New in version 0.0.7.
- property airplay_enabled: bool
Whether AirPlay is currently enabled.
- audio_cd_playlists(filter: dict | None = None) XAMusicAudioCDPlaylistList [source]
Returns a list of audio CD playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlists will have, or None
- Returns:
The list of audio CD playlists
- Return type:
New in version 0.2.1.
- audio_cd_tracks(filter: dict | None = None) XAMusicAudioCDTrackList [source]
Returns a list of audio CD tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tracks will have, or None
- Returns:
The list of audio CD tracks
- Return type:
New in version 0.2.1.
- back_track() XAMusicApplication [source]
Restarts the current track or returns to the previous track if playback is currently at the start.
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- browser_windows(filter: dict | None = None) XAMusicBrowserWindowList [source]
Returns a list of browser windows, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned browser windows will have, or None
- Returns:
The list of windows
- Return type:
New in version 0.0.1.
- property converting: bool
Whether a track is currently being converted.
- property current_airplay_devices: XAMusicAirPlayDeviceList
The currently selected AirPlay devices.
- property current_encoder: XAMusicEncoder
The currently selected encoder.
- property current_eq_preset: XAMusicEQPreset
The currently selected equalizer preset.
- property current_playlist: XAMusicPlaylist
The playlist containing the currently targeted track.
- property current_stream_title: str
The name of the currently streaming track.
- property current_stream_url: str
The URL of the currently streaming track.
- property current_track: XAMusicTrack
The currently playing (or paused but not stopped) track.
- property current_visual: XAMusicVisual
The currently selected visual plug-in.
- encoders(filter: dict | None = None) XAMusicEncoderList [source]
Returns a list of encoders, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned encoders will have, or None
- Returns:
The list of encoders
- Return type:
New in version 0.0.7.
- property eq_enabled: bool
Whether the equalizer is enabled.
- eq_presets(filter: dict | None = None) XAMusicEQPresetList [source]
Returns a list of EQ presets, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned EQ presets will have, or None
- Returns:
The list of presets
- Return type:
New in version 0.0.7.
- eq_windows(filter: dict | None = None) XAMusicEQWindowList [source]
Returns a list of EQ windows, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned EQ windows will have, or None
- Returns:
The list of windows
- Return type:
New in version 0.0.7.
- fast_forward() XAMusicApplication [source]
Repeated skip forward in the track until resume() is called.
- Returns:
A reference to the TV application object.
- Return type:
New in version 0.0.1.
- file_tracks(filter: dict | None = None) XAMusicFileTrackList [source]
Returns a list of file tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tracks will have, or None
- Returns:
The list of file tracks
- Return type:
New in version 0.2.1.
- property fixed_indexing: bool
Whether the track indices are independent of the order of the current playlist or not.
- property frontmost: bool
Whether the application is active or not.
- property full_screen: bool
Whether the app is fullscreen or not.
- class iCloudStatus(value)[source]
Bases:
Enum
iCloud statuses of media items.
Attributes:
A duplicate media item
A media item unavailable due to an error
A media item ineligible for listening
A matched media item
A non-uploaded media item
A media item unavailable due to expiration
A purchased media item
A removed media item
A media item obtained via a subscription to Apple Music
Unknown cloud status
An unloaded media item
- DUPLICATE = 1799648624
A duplicate media item
- ERROR = 1799713394
A media item unavailable due to an error
- INELIGIBLE = 1800562026
A media item ineligible for listening
- MATCHED = 1800233332
A matched media item
- NOT_UPLOADED = 1800761424
A non-uploaded media item
- NO_LONGER_AVAILABLE = 1800562038
A media item unavailable due to expiration
- PURCHASED = 1800435058
A purchased media item
- REMOVED = 1800562029
A removed media item
- SUBSCRIPTION = 1800631650
A media item obtained via a subscription to Apple Music
- UNKNOWN = 1800760939
Unknown cloud status
- UPLOADED = 1800761452
An unloaded media item
- library_playlists(filter: dict | None = None) XAMusicLibraryPlaylistList [source]
Returns a list of library playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlists will have, or None
- Returns:
The list of library playlists
- Return type:
New in version 0.2.1.
- make(specifier: str | ObjectType, properties: dict, data: Any | None = None)[source]
Creates a new element of the given specifier class without adding it to any list.
Use
XABase.XAList.push()
to push the element onto a list. Valid specifiers are: playlist, user playlist, folder playlist, library playlist, audio CD playlist, radio tuner playlist, subscription playlist, track, URL track, shared track, audio CD track, file track, AirPlay device, artwork, window, browser window, EQ window, miniplayer window, playlist window, video window, visual, source, EQ preset, or encoder.- Parameters:
specifier (Union[str, XAMusicApplication.ObjectType]) – The classname of the object to create
properties (dict) – The properties to give the object
data (Any, optional) – The data to initialize the object with, defaults to None
- Returns:
A PyXA wrapped form of the object
- Return type:
- Example:
Make a new folder playlist and push it onto the list of playlists
>>> import PyXA >>> app = PyXA.Music() >>> new_playlist = app.make("folder_playlist", {"name": "Example Playlist"}) >>> app.playlists().push(new_playlist)
New in version 0.2.2.
- miniplayer_windows(filter: dict | None = None) XAMusicMiniplayerWindowList [source]
Returns a list of miniplayer windows, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned miniplayer windows will have, or None
- Returns:
The list of windows
- Return type:
XAMusicMiniplayWindowList
New in version 0.0.7.
- property mute: bool
Whether sound output is muted or not.
- property name: str
The name of the application.
- next_track() XAMusicApplication [source]
Advances to the next track in the current playlist.
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- open_location(video_url: str) XAMusicApplication [source]
Opens and plays an video stream URL or iTunes Store URL.
- Parameters:
audio_url (str) – The URL of an audio stream (e.g. a web address to an MP3 file) or an item in the iTunes Store.
- Returns:
_description_
- Return type:
New in version 0.0.1.
- pause() XAMusicApplication [source]
Pauses the current track.
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- play(item: XAMusicItem | None = None, play_once: bool = True) XAMusicApplication [source]
Plays the specified TV item (e.g. track, playlist, etc.). If no item is provided, this plays the current track from its current player position.
- Parameters:
item (_XAMusicItem, optional) – The track, playlist, or video to play, defaults to None
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- property player_position: float
The time elapsed in the current track.
- property player_state: PlayerState
Whether the player is playing, paused, stopped, fast forwarding, or rewinding.
- playlist_windows(filter: dict | None = None) XAMusicPlaylistWindowList [source]
Returns a list of playlist windows, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlist windows will have, or None
- Returns:
The list of windows
- Return type:
New in version 0.0.1.
- playlists(filter: dict | None = None) XAMusicPlaylistList [source]
Returns a list of playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlists will have, or None
- Returns:
The list of playlists
- Return type:
New in version 0.0.1.
- playpause() XAMusicApplication [source]
Toggles the playing/paused state of the current track.
- Returns:
A reference to the TV application object.
- Return type:
New in version 0.0.1.
- previous_track() XAMusicApplication [source]
Returns to the previous track in the current playlist.
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- radio_tuner_playlists(filter: dict | None = None) XAMusicRadioTunerPlaylistList [source]
Returns a list of radio tuner playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlists will have, or None
- Returns:
The list of radio tuner playlists
- Return type:
New in version 0.2.1.
- resume() XAMusicApplication [source]
Returns to normal playback after calls to fast_forward() or rewind().
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- rewind() XAMusicApplication [source]
Repeatedly skip backward in the track until resume() is called.
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- property selection: XAMusicItemList
The selected media items.
- set_volume(new_volume: float) XAMusicApplication [source]
Sets the volume of playback.
- Parameters:
new_volume (float) – The desired volume of playback.
- Returns:
A reference to the TV application object.
- Return type:
New in version 0.0.1.
Returns a list of shared tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tracks will have, or None
- Returns:
The list of shared tracks
- Return type:
New in version 0.2.1.
- property shuffle_enabled: bool
Whether songs are played in random order.
- property shuffle_mode: ShuffleMode
The playback shuffle mode.
- property song_repeat: RepeatMode
The playback repeat mode.
- property sound_volume: int
The sound output volume.
- sources(filter: dict | None = None) XAMusicSourceList [source]
Returns a list of sources, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned sources will have, or None
- Returns:
The list of sources
- Return type:
New in version 0.0.1.
- stop() XAMusicApplication [source]
Stops playback of the current track. Subsequent playback will start from the beginning of the track.
- Returns:
A reference to the TV application object.
- Return type:
See also
New in version 0.0.1.
- subscription_playlists(filter: dict | None = None) XAMusicSubscriptionPlaylistList [source]
Returns a list of subscription playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlists will have, or None
- Returns:
The list of subscription playlists
- Return type:
New in version 0.2.1.
- tracks(filter: dict | None = None) XAMusicTrackList [source]
Returns a list of tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tracks will have, or None
- Returns:
The list of tracks
- Return type:
New in version 0.0.1.
- url_tracks(filter: dict | None = None) XAMusicURLTrackList [source]
Returns a list of URL tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tracks will have, or None
- Returns:
The list of URL tracks
- Return type:
New in version 0.2.1.
- user_playlists(filter: dict | None = None) XAMusicUserPlaylistList [source]
Returns a list of user playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlists will have, or None
- Returns:
The list of user playlists
- Return type:
New in version 0.2.1.
- property version: str
The version of the application.
- video_windows(filter: dict | None = None) XAMusicVideoWindowList [source]
Returns a list of video windows, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned video windows will have, or None
- Returns:
The list of windows
- Return type:
New in version 0.0.1.
- visuals(filter: dict | None = None) XAMusicVisualList [source]
Returns a list of visuals, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned visuals will have, or None
- Returns:
The list of visuals
- Return type:
New in version 0.0.7.
- property visuals_enabled: bool
Whether visuals are currently displayed.
- class PyXA.apps.Music.XAMusicArtwork(properties)[source]
Bases:
XAMusicItem
An artwork in media apps.
New in version 0.0.1.
Attributes:
The data for the artwork in the form of a picture.
Whether the artwork was downloaded by media apps.
The data format for the artwork.
The kind/purpose of the artwork.
The string description of the artwork.
The data for the artwork in original format.
- property downloaded: bool
Whether the artwork was downloaded by media apps.
- property format: int
The data format for the artwork.
- property kind: int
The kind/purpose of the artwork.
- property object_description: str
The string description of the artwork.
- property raw_data: bytes
The data for the artwork in original format.
- class PyXA.apps.Music.XAMusicArtworkList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicItemList
A wrapper around lists of music artworks that employs fast enumeration techniques.
All properties of music artworks can be called as methods on the wrapped list, returning a list containing each artworks’s value for the property.
New in version 0.0.7.
Methods:
by_data
(data)by_downloaded
(downloaded)by_format
(format)by_kind
(kind)by_object_description
(object_description)by_raw_data
(raw_data)data
()format
()kind
()raw_data
()- by_data(data: XAImage) XAMusicArtwork | None [source]
- by_downloaded(downloaded: bool) XAMusicArtwork | None [source]
- by_format(format: int) XAMusicArtwork | None [source]
- by_kind(kind: int) XAMusicArtwork | None [source]
- by_object_description(object_description: str) XAMusicArtwork | None [source]
- by_raw_data(raw_data: bytes) XAMusicArtwork | None [source]
- class PyXA.apps.Music.XAMusicAudioCDPlaylist(properties)[source]
Bases:
XAMusicPlaylist
An audio CD playlist in Music.app.
See also
New in version 0.0.7.
Attributes:
The artist of the CD.
Whether the CD is a compilation album.
The composer of the CD.
The total number of discs in the CD's album.
The index of the CD disc in the source album.
The genre of the CD.
The year the album was recorded/released.
Methods:
audio_cd_tracks
([filter])Returns a list of audio CD tracks, as PyXA objects, matching the given filter.
- property artist: str
The artist of the CD.
- audio_cd_tracks(filter: dict | None = None) XAMusicAudioCDTrackList [source]
Returns a list of audio CD tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned audio CD tracks will have, or None
- Returns:
The list of audio CD tracks
- Return type:
New in version 0.0.7.
- property compilation: bool
Whether the CD is a compilation album.
- property composer: str
The composer of the CD.
- property disc_count: int
The total number of discs in the CD’s album.
- property disc_number: int
The index of the CD disc in the source album.
- property genre: str
The genre of the CD.
- property year: int
The year the album was recorded/released.
- class PyXA.apps.Music.XAMusicAudioCDPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicPlaylistList
A wrapper around lists of audio CD playlists that employs fast enumeration techniques.
All properties of audio CD playlists can be called as methods on the wrapped list, returning a list containing each playlist’s value for the property.
See also
New in version 0.0.7.
Methods:
artist
()by_artist
(artist)by_compilation
(compilation)by_composer
(composer)by_disc_count
(disc_count)by_disc_number
(disc_number)by_genre
(genre)by_year
(year)composer
()genre
()year
()- by_artist(artist: str) XAMusicAudioCDPlaylist | None [source]
- by_compilation(compilation: bool) XAMusicAudioCDPlaylist | None [source]
- by_composer(composer: str) XAMusicAudioCDPlaylist | None [source]
- by_disc_count(disc_count: int) XAMusicAudioCDPlaylist | None [source]
- by_disc_number(disc_number: int) XAMusicAudioCDPlaylist | None [source]
- by_genre(genre: str) XAMusicAudioCDPlaylist | None [source]
- by_year(year: int) XAMusicAudioCDPlaylist | None [source]
- class PyXA.apps.Music.XAMusicAudioCDTrack(properties)[source]
Bases:
XAMusicTrack
An audio CD track in Music.app.
See also
New in version 0.0.1.
Attributes:
The location of the file represented by the track.
- class PyXA.apps.Music.XAMusicAudioCDTrackList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicTrackList
A wrapper around lists of music audio CD tracks that employs fast enumeration techniques.
All properties of music audio CD tracks can be called as methods on the wrapped list, returning a list containing each track’s value for the property.
See also
New in version 0.0.7.
Methods:
by_location
(location)location
()- by_location(location: XAURL) XAMusicAudioCDTrack | None [source]
- class PyXA.apps.Music.XAMusicBrowserWindow(properties)[source]
Bases:
XAMusicWindow
A browser window of media apps.
New in version 0.0.1.
Attributes:
The selected tracks.
The playlist currently displayed in the window.
- property selection: XAMusicTrackList
The selected tracks.
- property view: XAMusicPlaylist
The playlist currently displayed in the window.
- class PyXA.apps.Music.XAMusicBrowserWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicWindowList
A wrapper around lists of music browser windows that employs fast enumeration techniques.
All properties of music browser windows can be called as methods on the wrapped list, returning a list containing each windows’s value for the property.
New in version 0.0.7.
Methods:
by_selection
(selection)by_view
(view)view
()- by_selection(selection: XAMusicTrackList) XAMusicPlaylistWindow | None [source]
- by_view(view: XAMusicPlaylist) XAMusicPlaylistWindow | None [source]
- selection() XAMusicTrackList [source]
- view() XAMusicPlaylistList [source]
- class PyXA.apps.Music.XAMusicEQPreset(properties)[source]
Bases:
XAMusicItem
An equalizer preset in Music.app.
See also
New in version 0.0.7.
Attributes:
The 32 Hz band level (-12.0 dB to +12.0 dB).
The 16 kHz band level (-12.0 dB to +12.0 dB).
The 64 Hz band level (-12.0 dB to +12.0 dB).
The 125 HZ band level (-12.0 dB to +12.0 dB).
The 250 Hz band level (-12.0 dB to +12.0 dB).
The 500 Hz band level (-12.0 dB to +12.0 dB).
The 1 kHz band level (-12.0 dB to +12.0 dB).
The 2 kHz band level (-12.0 dB to +12.0 dB).
The 4 kHz band level (-12.0 dB to +12.0 dB).
The 8 kHz band level (-12.0 dB to +12.0 dB).
Whether the preset can be modified.
The equalizer preamp level (-12.0 dB to +12.0 dB).
Whether tracks using the preset are updated when the preset is renamed or deleted.
- property band1: float
The 32 Hz band level (-12.0 dB to +12.0 dB).
- property band10: float
The 16 kHz band level (-12.0 dB to +12.0 dB).
- property band2: float
The 64 Hz band level (-12.0 dB to +12.0 dB).
- property band3: float
The 125 HZ band level (-12.0 dB to +12.0 dB).
- property band4: float
The 250 Hz band level (-12.0 dB to +12.0 dB).
- property band5: float
The 500 Hz band level (-12.0 dB to +12.0 dB).
- property band6: float
The 1 kHz band level (-12.0 dB to +12.0 dB).
- property band7: float
The 2 kHz band level (-12.0 dB to +12.0 dB).
- property band8: float
The 4 kHz band level (-12.0 dB to +12.0 dB).
- property band9: float
The 8 kHz band level (-12.0 dB to +12.0 dB).
- property modifiable: bool
Whether the preset can be modified.
- property preamp: float
The equalizer preamp level (-12.0 dB to +12.0 dB).
- property update_tracks: bool
Whether tracks using the preset are updated when the preset is renamed or deleted.
- class PyXA.apps.Music.XAMusicEQPresetList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicItemList
A wrapper around lists of equalizer presets that employs fast enumeration techniques.
All properties of equalizer presets can be called as methods on the wrapped list, returning a list containing each preset’s value for the property.
See also
New in version 0.0.7.
Methods:
band1
()band10
()band2
()band3
()band4
()band5
()band6
()band7
()band8
()band9
()by_band1
(band1)by_band10
(band10)by_band2
(band2)by_band3
(band3)by_band4
(band4)by_band5
(band5)by_band6
(band6)by_band7
(band7)by_band8
(band8)by_band9
(band9)by_modifiable
(modifiable)by_preamp
(preamp)by_update_tracks
(update_tracks)preamp
()- by_band1(band1: float) XAMusicEQPreset | None [source]
- by_band10(band10: float) XAMusicEQPreset | None [source]
- by_band2(band2: float) XAMusicEQPreset | None [source]
- by_band3(band3: float) XAMusicEQPreset | None [source]
- by_band4(band4: float) XAMusicEQPreset | None [source]
- by_band5(band5: float) XAMusicEQPreset | None [source]
- by_band6(band6: float) XAMusicEQPreset | None [source]
- by_band7(band7: float) XAMusicEQPreset | None [source]
- by_band8(band8: float) XAMusicEQPreset | None [source]
- by_band9(band9: float) XAMusicEQPreset | None [source]
- by_modifiable(modifiable: bool) XAMusicEQPreset | None [source]
- by_preamp(preamp: float) XAMusicEQPreset | None [source]
- by_update_tracks(update_tracks: bool) XAMusicEQPreset | None [source]
- class PyXA.apps.Music.XAMusicEQWindow(properties)[source]
Bases:
XAMusicWindow
An equalizer window in Music.app.
See also
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicEQWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicWindowList
A wrapper around lists of music equalizer windows that employs fast enumeration techniques.
All properties of music equalizer windows can be called as methods on the wrapped list, returning a list containing each windows’s value for the property.
See also
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicEncoder(properties)[source]
Bases:
XAMusicItem
An encoder in Music.app.
See also
New in version 0.0.7.
Attributes:
The data format created by the encoder.
- property format: str
The data format created by the encoder.
- class PyXA.apps.Music.XAMusicEncoderList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicItemList
A wrapper around lists of encoders that employs fast enumeration techniques.
All properties of encoders can be called as methods on the wrapped list, returning a list containing each encoders’s value for the property.
See also
New in version 0.0.7.
Methods:
by_format
(format)format
()- by_format(format: str) XAMusicEncoder | None [source]
- class PyXA.apps.Music.XAMusicFileTrack(properties)[source]
Bases:
XAMusicTrack
A file track in media apps.
New in version 0.0.1.
Attributes:
The location of the file represented by the track.
- class PyXA.apps.Music.XAMusicFileTrackList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicTrackList
A wrapper around lists of music file tracks that employs fast enumeration techniques.
All properties of music file tracks can be called as methods on the wrapped list, returning a list containing each track’s value for the property.
New in version 0.0.7.
Methods:
by_location
(location)location
()- by_location(location: XAURL) XAMusicFileTrack | None [source]
- class PyXA.apps.Music.XAMusicFolderPlaylist(properties)[source]
Bases:
XAMusicUserPlaylist
A folder playlist in media apps.
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicFolderPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicUserPlaylistList
A wrapper around lists of music folder playlists that employs fast enumeration techniques.
All properties of music folder playlists can be called as methods on the wrapped list, returning a list containing each playlist’s value for the property.
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicItem(properties)[source]
Bases:
XAObject
A generic class with methods common to the various playable media classes in media apps.
See also
New in version 0.0.1.
Attributes:
The container of the item.
The ID of the item.
The index of the item in the internal application order.
The name of the item.
The constant unique identifier for the item.
Every property of the item.
Methods:
download
()Downloads the item into the local library.
Gets a clipboard-codable representation of the music item.
reveal
()Reveals the item in the media apps window.
- download() XAMusicItem [source]
Downloads the item into the local library.
- Returns:
A reference to the TV item object.
- Return type:
New in version 0.0.1.
- get_clipboard_representation() str [source]
Gets a clipboard-codable representation of the music item.
When a music item is copied to the clipboard, the name of the music item is added to the clipboard.
- Returns:
The name of the music item
- Return type:
str
New in version 0.0.8.
- property id: int
The ID of the item.
- property index: int
The index of the item in the internal application order.
- property name: str
The name of the item.
- property object_class
- property persistent_id: str
The constant unique identifier for the item.
- property properties: dict
Every property of the item.
- reveal() XAMusicItem [source]
Reveals the item in the media apps window.
- Returns:
A reference to the TV item object.
- Return type:
See also
select()
New in version 0.0.1.
- class PyXA.apps.Music.XAMusicItemList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XAList
A wrapper around lists of music items that employs fast enumeration techniques.
All properties of music items can be called as methods on the wrapped list, returning a list containing each item’s value for the property.
New in version 0.0.7.
Methods:
by_container
(container)by_id
(id)by_index
(index)by_name
(name)by_persistent_id
(persistent_id)by_properties
(properties)Gets a clipboard-codable representation of each music item in the list.
id
()index
()Returns the index of the first occurrence of the element in the list, or -1 if no such element exists in the list.
name
()- by_container(container: XAObject) XAMusicItem | None [source]
- by_id(id: int) XAMusicItem | None [source]
- by_index(index: int) XAMusicItem | None [source]
- by_name(name: str) XAMusicItem | None [source]
- by_persistent_id(persistent_id: str) XAMusicItem | None [source]
- by_properties(properties: dict) XAMusicItem | None [source]
- get_clipboard_representation() list[str] [source]
Gets a clipboard-codable representation of each music item in the list.
When a list of music items is copied to the clipboard, the name of each item is added to the clipboard.
- Returns:
A list of track names
- Return type:
list[str]
New in version 0.0.8.
- class PyXA.apps.Music.XAMusicLibraryPlaylist(properties)[source]
Bases:
XAMusicPlaylist
The library playlist in media apps.
New in version 0.0.1.
Methods:
file_tracks
([filter])Returns a list of file tracks, as PyXA objects, matching the given filter.
shared_tracks
([filter])Returns a list of shared tracks, as PyXA objects, matching the given filter.
url_tracks
([filter])Returns a list of URL tracks, as PyXA objects, matching the given filter.
- file_tracks(filter: dict | None = None) XAMusicFileTrackList [source]
Returns a list of file tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned file tracks will have, or None
- Returns:
The list of file tracks
- Return type:
New in version 0.0.7.
Returns a list of shared tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned shared tracks will have, or None
- Returns:
The list of shared tracks
- Return type:
New in version 0.0.7.
- url_tracks(filter: dict | None = None) XAMusicURLTrackList [source]
Returns a list of URL tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned URL tracks will have, or None
- Returns:
The list of URL tracks
- Return type:
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicLibraryPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicPlaylistList
A wrapper around lists of library playlists that employs fast enumeration techniques.
All properties of library playlists can be called as methods on the wrapped list, returning a list containing each playlist’s value for the property.
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicMiniplayerWindow(properties)[source]
Bases:
XAMusicWindow
A miniplayer window in Music.app.
See also
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicMiniplayerWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicWindowList
A wrapper around lists of music miniplayer windows that employs fast enumeration techniques.
All properties of music minipplayer windows can be called as methods on the wrapped list, returning a list containing each windows’s value for the property.
See also
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicPlaylist(properties)[source]
Bases:
XAMusicItem
A playlist in Music.app.
See also
New in version 0.0.1.
Methods:
add_tracks
(*tracks)Add one or more tracks to this playlist.
artworks
([filter])Returns a list of artworks, as PyXA objects, matching the given filter.
duplicate
([location])Duplicates the playlist to the specified source or folder playlist.
move
(location)Moves the playlist to the specified source or folder playlist.
play
()Starts playback of the playlist, beginning with the first track in the list.
search
(query[, type])tracks
([filter])Returns a list of tracks, as PyXA objects, matching the given filter.
Attributes:
Whether the playlist is disliked.
The total length of all tracks in seconds.
Whether the playlist is loved.
The name of the playlist.
The string description of the playlist.
The folder containing the playlist, if any.
The total size of all tracks in the playlist in bytes.
The special playlist kind.
The length of all tracks in the playlist in MM:SS format.
Whether the playlist is visible in the source list.
- add_tracks(*tracks: XAMusicTrackList | list[XAMusicTrack])[source]
Add one or more tracks to this playlist.
- Parameters:
tracks (Union[XAMusicTrackList, list[XAMusicTrack]]) – The list of tracks to add to this playlist
New in version 0.2.2.
- artworks(filter: dict | None = None) XAMusicArtworkList [source]
Returns a list of artworks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned artworks will have, or None
- Returns:
The list of artworks
- Return type:
New in version 0.0.7.
- property disliked: bool
Whether the playlist is disliked.
- duplicate(location: XAMusicSource | XAMusicFolderPlaylist | None = None)[source]
Duplicates the playlist to the specified source or folder playlist.
- Parameters:
location (Union[XAMusicSource, XAMusicFolderPlaylist, None], optional) – The source or folder playlist to duplicate this playlist to, or None to duplicate into the parent of this playlist, defaults to None
New in version 0.2.2.
- property duration: int
The total length of all tracks in seconds.
- property loved: bool
Whether the playlist is loved.
- move(location: XAMusicSource | XAMusicFolderPlaylist)[source]
Moves the playlist to the specified source or folder playlist.
- Parameters:
location (Union[XAMusicSource, XAMusicPlaylist]) – The source or folder playlist to move this playlist to
New in version 0.2.2.
- property name: str
The name of the playlist.
- property object_description: str
The string description of the playlist.
- property parent: XAMusicPlaylist
The folder containing the playlist, if any.
- play()[source]
Starts playback of the playlist, beginning with the first track in the list.
New in version 0.2.1.
- search(query: str, type: Literal['all', 'artists', 'albums', 'displayed', 'tracks'] = 'displayed')[source]
- property size: int
The total size of all tracks in the playlist in bytes.
- property special_kind: PlaylistKind
The special playlist kind.
- property time: str
The length of all tracks in the playlist in MM:SS format.
- tracks(filter: dict | None = None) XAMusicTrackList [source]
Returns a list of tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned tracks will have, or None
- Returns:
The list of tracks
- Return type:
New in version 0.0.7.
- property visible: bool
Whether the playlist is visible in the source list.
- class PyXA.apps.Music.XAMusicPlaylistList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XAMusicItemList
A wrapper around lists of playlists that employs fast enumeration techniques.
All properties of playlists can be called as methods on the wrapped list, returning a list containing each playlist’s value for the property.
See also
New in version 0.0.7.
Methods:
by_disliked
(disliked)by_duration
(duration)by_loved
(loved)by_name
(name)by_object_description
(object_description)by_parent
(parent)by_size
(size)by_special_kind
(special_kind)by_time
(time)by_visible
(visible)disliked
()duration
()loved
()name
()parent
()push
(*elements)Appends the object referenced by the provided PyXA wrapper to the end of the list.
size
()time
()visible
()- by_disliked(disliked: bool) XAMusicPlaylist | None [source]
- by_duration(duration: int) XAMusicPlaylist | None [source]
- by_loved(loved: bool) XAMusicPlaylist | None [source]
- by_name(name: str) XAMusicPlaylist | None [source]
- by_object_description(object_description: str) XAMusicPlaylist | None [source]
- by_parent(parent: XAMusicPlaylist) XAMusicPlaylist | None [source]
- by_size(size: int) XAMusicPlaylist | None [source]
- by_special_kind(special_kind: PlaylistKind) XAMusicPlaylist | None [source]
- by_time(time: str) XAMusicPlaylist | None [source]
- by_visible(visible: bool) XAMusicPlaylist | None [source]
- parent() XAMusicPlaylistList [source]
- push(*elements: list[XAMusicPlaylist]) XAMusicPlaylist | list[XAMusicPlaylist] | None [source]
Appends the object referenced by the provided PyXA wrapper to the end of the list.
New in version 0.0.3.
- special_kind() list[PlaylistKind] [source]
- class PyXA.apps.Music.XAMusicPlaylistWindow(properties)[source]
Bases:
XAMusicWindow
A playlist window in media apps.
New in version 0.0.1.
Attributes:
The selected tracks.
The playlist currently displayed in the window.
- property selection: XAMusicTrackList
The selected tracks.
- property view: XAMusicPlaylist
The playlist currently displayed in the window.
- class PyXA.apps.Music.XAMusicPlaylistWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicWindowList
A wrapper around lists of music playlist windows that employs fast enumeration techniques.
All properties of music playlist windows can be called as methods on the wrapped list, returning a list containing each windows’s value for the property.
New in version 0.0.7.
Methods:
by_selection
(selection)by_view
(view)view
()- by_selection(selection: XAMusicTrackList) XAMusicPlaylistWindow | None [source]
- by_view(view: XAMusicPlaylist) XAMusicPlaylistWindow | None [source]
- selection() XAMusicTrackList [source]
- view() XAMusicPlaylistList [source]
- class PyXA.apps.Music.XAMusicRadioTunerPlaylist(properties)[source]
Bases:
XAMusicPlaylist
A radio playlist in Music.app.
See also
New in version 0.0.7.
Methods:
url_tracks
([filter])Returns a list of URL tracks, as PyXA objects, matching the given filter.
- url_tracks(filter: dict | None = None) XAMusicURLTrackList [source]
Returns a list of URL tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned URL tracks will have, or None
- Returns:
The list of URL tracks
- Return type:
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicRadioTunerPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicPlaylistList
A wrapper around lists of radio tuner playlists that employs fast enumeration techniques.
All properties of radio tuner playlists can be called as methods on the wrapped list, returning a list containing each playlist’s value for the property.
See also
New in version 0.0.7.
Bases:
XAMusicTrack
A shared track in media apps.
New in version 0.0.1.
Bases:
XAMusicTrackList
A wrapper around lists of music shared tracks that employs fast enumeration techniques.
All properties of music shared tracks can be called as methods on the wrapped list, returning a list containing each track’s value for the property.
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicSource(properties)[source]
Bases:
XAMusicItem
A media source in Music.app.
See also
New in version 0.0.1.
Methods:
audio_cd_playlists
([filter])Returns a list of audio CD playlists, as PyXA objects, matching the given filter.
library_playlists
([filter])Returns a list of library playlists, as PyXA objects, matching the given filter.
playlists
([filter])Returns a list of playlists, as PyXA objects, matching the given filter.
radio_tuner_playlists
([filter])Returns a list of radio tuner playlists, as PyXA objects, matching the given filter.
subscription_playlists
([filter])Returns a list of subscription playlists, as PyXA objects, matching the given filter.
user_playlists
([filter])Returns a list of user playlists, as PyXA objects, matching the given filter.
Attributes:
The total size of the source, if it has a fixed size.
The free space on the source, if it has a fixed size.
The source kind.
- audio_cd_playlists(filter: dict | None = None) XAMusicAudioCDPlaylistList [source]
Returns a list of audio CD playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned audio CD playlists will have, or None
- Returns:
The list of audio CD playlists
- Return type:
New in version 0.0.7.
- property capacity: int
The total size of the source, if it has a fixed size.
- property free_space: int
The free space on the source, if it has a fixed size.
- property kind: SourceKind
The source kind.
- library_playlists(filter: dict | None = None) XAMusicLibraryPlaylistList [source]
Returns a list of library playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned library playlists will have, or None
- Returns:
The list of library playlists
- Return type:
New in version 0.0.7.
- playlists(filter: dict | None = None) XAMusicPlaylistList [source]
Returns a list of playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned playlists will have, or None
- Returns:
The list of playlists
- Return type:
New in version 0.0.7.
- radio_tuner_playlists(filter: dict | None = None) XAMusicRadioTunerPlaylistList [source]
Returns a list of radio tuner playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned radio tuner playlists will have, or None
- Returns:
The list of radio tuner playlists
- Return type:
New in version 0.0.7.
- subscription_playlists(filter: dict | None = None) XAMusicSubscriptionPlaylistList [source]
Returns a list of subscription playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned subscription playlists will have, or None
- Returns:
The list of subscription playlists
- Return type:
New in version 0.0.7.
- user_playlists(filter: dict | None = None) XAMusicUserPlaylistList [source]
Returns a list of user playlists, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned user playlists will have, or None
- Returns:
The list of user playlists
- Return type:
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicSourceList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicItemList
A wrapper around lists of sources that employs fast enumeration techniques.
All properties of sources can be called as methods on the wrapped list, returning a list containing each source’s value for the property.
See also
New in version 0.0.7.
Methods:
by_capacity
(capacity)by_free_space
(free_space)by_kind
(kind)capacity
()kind
()- by_capacity(capacity: int) XAMusicSource | None [source]
- by_free_space(free_space: int) XAMusicSource | None [source]
- by_kind(kind: SourceKind) XAMusicSource | None [source]
- kind() list[SourceKind] [source]
- class PyXA.apps.Music.XAMusicSubscriptionPlaylist(properties)[source]
Bases:
XAMusicPlaylist
A subscription playlist from Apple Music in Music.app.
See also
New in version 0.0.7.
Methods:
file_tracks
([filter])Returns a list of file tracks, as PyXA objects, matching the given filter.
url_tracks
([filter])Returns a list of URL tracks, as PyXA objects, matching the given filter.
- file_tracks(filter: dict | None = None) XAMusicFileTrackList [source]
Returns a list of file tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned file tracks will have, or None
- Returns:
The list of file tracks
- Return type:
New in version 0.0.7.
- url_tracks(filter: dict | None = None) XAMusicURLTrackList [source]
Returns a list of URL tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned URL tracks will have, or None
- Returns:
The list of URL tracks
- Return type:
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicSubscriptionPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicPlaylistList
A wrapper around lists of subscription playlists that employs fast enumeration techniques.
All properties of subscription playlists can be called as methods on the wrapped list, returning a list containing each playlist’s value for the property.
See also
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicTrack(properties)[source]
Bases:
XAMusicItem
A class for managing and interacting with tracks in Music.app.
See also
New in version 0.0.1.
Attributes:
The name of the track's album.
The album artist of the track.
Whether the album for the track is disliked.
Whether the album for the track is loved.
The rating of the track's album.
The album's rating kind.
The artist/source of the track.
The track's bitrate in kbps.
The bookmark time of the track in seconds.
Whether the playback position is kept in memory after stopping the track.
The tempo of the track in beats per minute.
The category of the track.
The iCloud status of the track.
User-provided notes on the track.
Whether the track is from a compilation album.
The composer of the track.
A unique ID for the track.
The date the track was added to the current playlist.
The number of discs in the source album.
The index of the disc containing the track.
Whether the track is disliked.
The Apple ID of the person who downloaded the track.
The full name of the person who downloaded the track.
Length of the track in seconds.
Whether the track is able to be played.
A unique ID for the episode of the track.
The episode number of the track.
The name of the EQ preset of the track.
The time in seconds from the start at which the track stops playing.
Whether the track is a from a gapless album.
The music/audio genre category of the track.
The current section/chapter/movement of the track.
A text description of the track.
A long description for the track.
Whether the track is loved.
The lyrics of the track.
A description of the track's media type.
The last modification date of the track's content.
The movement name of the track.
The total number of movements in the work.
The index of the movement in the work.
A string description of the track.
The number of the times the track has been played.
The date the track was last played.
The Apple ID of the person who bought the track.
The full name of the person who bought the track.
The rating of the track from 0 to 100.
Whether the rating is user-provided or computed.
The date the track was released.
The sample rate of the track in Hz.
The number of the season the track belongs to.
The name of the show the track belongs to.
Whether the track is included when shuffling.
The size of the track in bytes.
The number of times the track has been skipped.
The date the track was last skipped.
The string used for this track when sorting by album.
The string used for this track when sorting by album artist.
The string used for this track when sorting by artist.
The string used for this track when sorting by composer.
The string used for this track when sorting by name.
The string used for this track when sorting by show.
The start time of the track in seconds.
HH:MM:SS representation for the duration of the track.
The number of tracks in the track's album.
The index of the track within its album.
Whether the track has been played before.
Volume adjustment setting for this track from -100 to +100.
The work name of the track.
The year the track was released.
Methods:
artworks
([filter])Returns a list of artworks, as PyXA objects, matching the given filter.
duplicate
(location)Duplicates the track at the specified location.
move
(location)Moves the track to the specified location, copying it if appropriate.
play
()Plays the item.
select
()Selects the item.
- property album: str
The name of the track’s album.
- property album_artist: str
The album artist of the track.
- property album_disliked: bool
Whether the album for the track is disliked.
- property album_loved: bool
Whether the album for the track is loved.
- property album_rating: int
The rating of the track’s album.
- property album_rating_kind: RatingKind
The album’s rating kind.
- property artist: str
The artist/source of the track.
- artworks(filter: dict | None = None) XAMusicArtworkList [source]
Returns a list of artworks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned artworks will have, or None
- Returns:
The list of artworks
- Return type:
New in version 0.0.7.
- property bit_rate: int
The track’s bitrate in kbps.
- property bookmark: float
The bookmark time of the track in seconds.
- property bookmarkable: bool
Whether the playback position is kept in memory after stopping the track.
- property bpm: int
The tempo of the track in beats per minute.
- property category: str
The category of the track.
- property cloud_status: iCloudStatus
The iCloud status of the track.
- property comment: str
User-provided notes on the track.
- property compilation: bool
Whether the track is from a compilation album.
- property composer: str
The composer of the track.
- property database_id: int
A unique ID for the track.
- property date_added: datetime
The date the track was added to the current playlist.
- property disc_count: int
The number of discs in the source album.
- property disc_number: int
The index of the disc containing the track.
- property disliked: bool
Whether the track is disliked.
- property downloader_apple_id: str
The Apple ID of the person who downloaded the track.
- property downloader_name: str
The full name of the person who downloaded the track.
- duplicate(location: XAMusicPlaylist | XAMusicSource)[source]
Duplicates the track at the specified location.
- Parameters:
location (Union[XAMusicPlaylist, XAMusicSource]) – The location to duplicate the track to
New in version 0.2.2.
- property duration: float
Length of the track in seconds.
- property enabled: bool
Whether the track is able to be played.
- property episode_id: str
A unique ID for the episode of the track.
- property episode_number: int
The episode number of the track.
- property eq: str
The name of the EQ preset of the track.
- property finish: float
The time in seconds from the start at which the track stops playing.
- property gapless: bool
Whether the track is a from a gapless album.
- property genre: str
The music/audio genre category of the track.
- property grouping: str
The current section/chapter/movement of the track.
- property kind: str
A text description of the track.
- property long_description: str
A long description for the track.
- property loved: bool
Whether the track is loved.
- property lyrics: str
The lyrics of the track.
- property modification_date: datetime
The last modification date of the track’s content.
- move(location: XAMusicPlaylist | XAMusicSource)[source]
Moves the track to the specified location, copying it if appropriate.
- Parameters:
location (Union[XAMusicPlaylist, XAMusicSource]) – The playlist or source to move the track to
New in version 0.2.2.
- property movement: str
The movement name of the track.
- property movement_count: int
The total number of movements in the work.
- property movement_number: int
The index of the movement in the work.
- property object_description: str
A string description of the track.
- play() XAMusicItem [source]
Plays the item.
- Returns:
A reference to the media item object.
- Return type:
_XAMusicItem
New in version 0.0.1.
- property played_count: int
The number of the times the track has been played.
- property played_date: datetime
The date the track was last played.
- property purchaser_apple_id: str
The Apple ID of the person who bought the track.
- property purchaser_name: str
The full name of the person who bought the track.
- property rating: int
The rating of the track from 0 to 100.
- property rating_kind: RatingKind
Whether the rating is user-provided or computed.
- property release_date: datetime
The date the track was released.
- property sample_rate: int
The sample rate of the track in Hz.
- property season_number: int
The number of the season the track belongs to.
- select() XAMusicItem [source]
Selects the item.
- Returns:
A reference to the media item object.
- Return type:
See also
reveal()
New in version 0.0.1.
- property show: str
The name of the show the track belongs to.
- property shufflable: bool
Whether the track is included when shuffling.
- property size: int
The size of the track in bytes.
- property skipped_count: int
The number of times the track has been skipped.
- property skipped_date: datetime
The date the track was last skipped.
- property sort_album: str
The string used for this track when sorting by album.
- property sort_album_artist: str
The string used for this track when sorting by album artist.
- property sort_artist: str
The string used for this track when sorting by artist.
- property sort_composer: str
The string used for this track when sorting by composer.
- property sort_name: str
The string used for this track when sorting by name.
- property sort_show: str
The string used for this track when sorting by show.
- property start: float
The start time of the track in seconds.
- property time: str
HH:MM:SS representation for the duration of the track.
- property track_count: int
The number of tracks in the track’s album.
- property track_number: int
The index of the track within its album.
- property unplayed: bool
Whether the track has been played before.
- property volume_adjustment: int
Volume adjustment setting for this track from -100 to +100.
- property work: str
The work name of the track.
- property year: int
The year the track was released.
- class PyXA.apps.Music.XAMusicTrackList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XAMusicItemList
A wrapper around lists of music tracks that employs fast enumeration techniques.
All properties of music tracks can be called as methods on the wrapped list, returning a list containing each track’s value for the property.
See also
New in version 0.0.7.
Methods:
- album_rating_kind() list[RatingKind] [source]
- by_album(album: str) XAMusicTrack | None [source]
- by_album_artist(album_artist: str) XAMusicTrack | None [source]
- by_album_disliked(album_disliked: bool) XAMusicTrack | None [source]
- by_album_loved(album_loved: bool) XAMusicTrack | None [source]
- by_album_rating(album_rating: int) XAMusicTrack | None [source]
- by_album_rating_kind(album_rating_kind: RatingKind) XAMusicTrack | None [source]
- by_artist(artist: str) XAMusicTrack | None [source]
- by_bit_rate(bit_rate: int) XAMusicTrack | None [source]
- by_bookmark(bookmark: float) XAMusicTrack | None [source]
- by_bookmarkable(bookmarkable: bool) XAMusicTrack | None [source]
- by_bpm(bpm: int) XAMusicTrack | None [source]
- by_category(category: str) XAMusicTrack | None [source]
- by_cloud_status(cloud_status: iCloudStatus) XAMusicTrack | None [source]
- by_comment(comment: str) XAMusicTrack | None [source]
- by_compilation(compilation: bool) XAMusicTrack | None [source]
- by_composer(composer: str) XAMusicTrack | None [source]
- by_database_id(database_id: int) XAMusicTrack | None [source]
- by_date_added(date_added: datetime) XAMusicTrack | None [source]
- by_disc_count(disc_count: int) XAMusicTrack | None [source]
- by_disc_number(disc_number: int) XAMusicTrack | None [source]
- by_disliked(disliked: bool) XAMusicTrack | None [source]
- by_downloader_apple_id(downloader_apple_id: str) XAMusicTrack | None [source]
- by_downloader_name(downloader_name: str) XAMusicTrack | None [source]
- by_duration(duration: float) XAMusicTrack | None [source]
- by_enabled(enabled: bool) XAMusicTrack | None [source]
- by_episode_id(episode_id: str) XAMusicTrack | None [source]
- by_episode_number(episode_number: int) XAMusicTrack | None [source]
- by_eq(eq: str) XAMusicTrack | None [source]
- by_finish(finish: float) XAMusicTrack | None [source]
- by_gapless(gapless: bool) XAMusicTrack | None [source]
- by_genre(genre: str) XAMusicTrack | None [source]
- by_grouping(grouping: str) XAMusicTrack | None [source]
- by_kind(kind: str) XAMusicTrack | None [source]
- by_long_description(long_description: str) XAMusicTrack | None [source]
- by_loved(loved: bool) XAMusicTrack | None [source]
- by_lyrics(lyrics: str) XAMusicTrack | None [source]
- by_media_kind(media_kind: MediaKind) XAMusicTrack | None [source]
- by_modification_date(modification_date: datetime) XAMusicTrack | None [source]
- by_movement(movement: str) XAMusicTrack | None [source]
- by_movement_count(movement_count: int) XAMusicTrack | None [source]
- by_movement_number(movement_number: int) XAMusicTrack | None [source]
- by_object_description(object_description: str) XAMusicTrack | None [source]
- by_played_count(played_count: int) XAMusicTrack | None [source]
- by_played_date(played_date: datetime) XAMusicTrack | None [source]
- by_purchaser_apple_id(purchaser_apple_id: str) XAMusicTrack | None [source]
- by_purchaser_name(purchaser_name: str) XAMusicTrack | None [source]
- by_rating(rating: int) XAMusicTrack | None [source]
- by_rating_kind(rating_kind: RatingKind) XAMusicTrack | None [source]
- by_release_date(release_date: datetime) XAMusicTrack | None [source]
- by_sample_rate(sample_rate: int) XAMusicTrack | None [source]
- by_season_number(season_number: int) XAMusicTrack | None [source]
- by_show(show: str) XAMusicTrack | None [source]
- by_shufflable(shufflable: bool) XAMusicTrack | None [source]
- by_size(size: int) XAMusicTrack | None [source]
- by_skipped_count(skipped_count: int) XAMusicTrack | None [source]
- by_skipped_date(skipped_date: datetime) XAMusicTrack | None [source]
- by_sort_album(sort_album: str) XAMusicTrack | None [source]
- by_sort_album_artist(sort_album_artist: str) XAMusicTrack | None [source]
- by_sort_artist(sort_artist: str) XAMusicTrack | None [source]
- by_sort_composer(sort_composer: str) XAMusicTrack | None [source]
- by_sort_name(sort_name: str) XAMusicTrack | None [source]
- by_sort_show(sort_show: str) XAMusicTrack | None [source]
- by_start(start: float) XAMusicTrack | None [source]
- by_time(time: str) XAMusicTrack | None [source]
- by_track_count(track_count: int) XAMusicTrack | None [source]
- by_track_number(track_number: int) XAMusicTrack | None [source]
- by_unplayed(unplayed: bool) XAMusicTrack | None [source]
- by_volume_adjustment(volume_adjustment: int) XAMusicTrack | None [source]
- by_work(work: str) XAMusicTrack | None [source]
- by_year(year: int) XAMusicTrack | None [source]
- cloud_status() list[iCloudStatus] [source]
- rating_kind() list[RatingKind] [source]
- class PyXA.apps.Music.XAMusicURLTrack(properties)[source]
Bases:
XAMusicTrack
A URL track in media apps.
New in version 0.0.1.
Attributes:
The URL for the track.
- class PyXA.apps.Music.XAMusicURLTrackList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicTrackList
A wrapper around lists of music URL tracks that employs fast enumeration techniques.
All properties of music URL tracks can be called as methods on the wrapped list, returning a list containing each track’s value for the property.
New in version 0.0.7.
Methods:
address
()by_address
(address)- by_address(address: str) XAMusicURLTrack | None [source]
- class PyXA.apps.Music.XAMusicUserPlaylist(properties)[source]
Bases:
XAMusicPlaylist
A user-created playlist in Music.app.
See also
New in version 0.0.1.
Methods:
file_tracks
([filter])Returns a list of file tracks, as PyXA objects, matching the given filter.
shared_tracks
([filter])Returns a list of shared tracks, as PyXA objects, matching the given filter.
url_tracks
([filter])Returns a list of URL tracks, as PyXA objects, matching the given filter.
Attributes:
Whether the playlist is a genius playlist.
Whether the playlist is shared.
Whether the playlist is a smart playlist.
- file_tracks(filter: dict | None = None) XAMusicFileTrackList [source]
Returns a list of file tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned file tracks will have, or None
- Returns:
The list of file tracks
- Return type:
New in version 0.0.7.
- property genius: bool
Whether the playlist is a genius playlist.
Whether the playlist is shared.
Returns a list of shared tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned shared tracks will have, or None
- Returns:
The list of shared tracks
- Return type:
New in version 0.0.7.
- property smart: bool
Whether the playlist is a smart playlist.
- url_tracks(filter: dict | None = None) XAMusicURLTrackList [source]
Returns a list of URL tracks, as PyXA objects, matching the given filter.
- Parameters:
filter (Union[dict, None]) – A dictionary specifying property-value pairs that all returned URL tracks will have, or None
- Returns:
The list of URL tracks
- Return type:
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicUserPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicPlaylistList
A wrapper around lists of music user playlists that employs fast enumeration techniques.
All properties of music user playlists can be called as methods on the wrapped list, returning a list containing each playlist’s value for the property.
See also
New in version 0.0.7.
Methods:
by_genius
(genius)by_shared
(shared)by_smart
(smart)genius
()shared
()smart
()- by_genius(genius: bool) XAMusicUserPlaylist | None [source]
- by_smart(smart: bool) XAMusicUserPlaylist | None [source]
- class PyXA.apps.Music.XAMusicVideoWindow(properties)[source]
Bases:
XAMusicWindow
A video window in media apps.
New in version 0.0.1.
- class PyXA.apps.Music.XAMusicVideoWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicWindowList
A wrapper around lists of music video windows that employs fast enumeration techniques.
All properties of music video windows can be called as methods on the wrapped list, returning a list containing each windows’s value for the property.
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicVisual(properties)[source]
Bases:
XAMusicPlaylist
A music visual in Music.app.
See also
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicVisualList(properties: dict, filter: dict | None = None)[source]
Bases:
XAMusicItemList
A wrapper around lists of music visuals that employs fast enumeration techniques.
All properties of music visuals can be called as methods on the wrapped list, returning a list containing each visual’s value for the property.
See also
New in version 0.0.7.
- class PyXA.apps.Music.XAMusicWindow(properties)[source]
Bases:
XASBWindow
,XAMusicItem
A window of Music.app.
See also
New in version 0.0.1.
Attributes:
Whether the window is currently full screen.
The upper left position of the window.
- property full_screen: bool
Whether the window is currently full screen.
- property position: tuple[int, int]
The upper left position of the window.
- class PyXA.apps.Music.XAMusicWindowList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XAMusicItemList
A wrapper around lists of music windows that employs fast enumeration techniques.
All properties of music windows can be called as methods on the wrapped list, returning a list containing each windows’s value for the property.
See also
New in version 0.0.7.
Methods:
bounds
()by_bounds
(bounds)by_closeable
(closeable)by_collapseable
(collapseable)by_collapsed
(collapsed)by_full_screen
(full_screen)by_position
(position)by_resizable
(resizable)by_visible
(visible)by_zoomable
(zoomable)by_zoomed
(zoomed)position
()visible
()zoomable
()zoomed
()- by_bounds(bounds: tuple[tuple[int, int], tuple[int, int]]) XAMusicWindow | None [source]
- by_closeable(closeable: bool) XAMusicWindow | None [source]
- by_collapseable(collapseable: bool) XAMusicWindow | None [source]
- by_collapsed(collapsed: bool) XAMusicWindow | None [source]
- by_full_screen(full_screen: bool) XAMusicWindow | None [source]
- by_position(position: tuple[int, int]) XAMusicWindow | None [source]
- by_resizable(resizable: bool) XAMusicWindow | None [source]
- by_visible(visible: bool) XAMusicWindow | None [source]
- by_zoomable(zoomable: bool) XAMusicWindow | None [source]
- by_zoomed(zoomed: bool) XAMusicWindow | None [source]