TV Module Reference
New in version 0.0.1.
Control the macOS TV application using JXA-like syntax.
Classes:
|
An enumeration. |
|
A class for managing and interacting with TV.app. |
|
An artwork in media apps. |
|
A wrapper around lists of music artworks that employs fast enumeration techniques. |
|
A browser window of media apps. |
|
A wrapper around lists of music browser windows 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 playlist in media apps. |
|
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 shared track in media apps. |
|
A wrapper around lists of music shared tracks that employs fast enumeration techniques. |
|
A media source in media apps. |
|
A wrapper around lists of sources that employs fast enumeration techniques. |
|
A class for managing and interacting with tracks in media apps. |
|
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 media apps. |
|
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 windows of media apps. |
|
A wrapper around lists of windows that employs fast enumeration techniques. |
- class PyXA.apps.TV.TVObjectClass(value)[source]
Bases:
Enum
An enumeration.
Attributes:
- APPLICATION = 'capp'
- ARTWORK = 'cArt'
- BROWSER_WINDOW = 'cBrW'
- ENCODER = 'cEnc'
- FILE_TRACK = 'cFlT'
- FOLDER_PlAYLIST = 'cFoP'
- ITEM = 'cobj'
- LIBRARY_PLAYLIST = 'cLiP'
- MINIPLAYER_WINDOW = 'cMPW'
- PLAYLIST = 'cPly'
- PLAYLIST_WINDOW = 'cPlW'
- SHARED_TRACK = 'cShT'
- SOURCE = 'cSrc'
- TRACK = 'cTrk'
- URL_TRACK = 'cURT'
- USER_PLAYLIST = 'cUsP'
- VIDEO_WINDOW = 'cNPW'
- WINDOW = 'cwin'
- class PyXA.apps.TV.XATVApplication(properties)[source]
Bases:
XASBApplication
,XACanOpenPath
A class for managing and interacting with TV.app.
See also
XATVWindow
, class:XATVSource,XATVPlaylist
,XATVTrack
New in version 0.0.1.
Classes:
MediaKind
(value)Types of media items.
ObjectType
(value)Object types able to be created by the application.
PlayerState
(value)States of the music player.
PlaylistKind
(value)Types of special playlists.
RatingKind
(value)Types of ratings for media items.
SearchFilter
(value)Filter restrictions on search results.
SourceKind
(value)Types of sources for media items.
Methods:
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.
Returns the currently playing (or paused but not stopped) track.
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.
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.
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.
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.
video_windows
([filter])Returns a list of video windows, as PyXA objects, matching the given filter.
Attributes:
The playlist containing the currently targeted track.
The name of the currently streaming track.
The URL of the currently streaming track.
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.
The sound output volume.
The version of the application.
- class MediaKind(value)[source]
Bases:
Enum
Types of media items.
Attributes:
A home video track
A movie track
A TV show track
An unknown media item kind
- HOME_VIDEO = 1800823880
A home video track
- MOVIE = 1800823885
A movie track
- TV_SHOW = 1800823892
A TV show track
- UNKNOWN = 1800760939
An unknown media item kind
- class ObjectType(value)[source]
Bases:
Enum
Object types able to be created by the application.
Attributes:
- ARTWORK = 'artwork'
- BROWSER_WINDOW = 'browser_window'
- FILE_TRACK = 'file_track'
- FOLDER_PLAYLIST = 'folder_playlist'
- LIBRARY_PLAYLIST = 'library_playlist'
- PLAYLIST = 'playlist'
- PLAYLIST_WINDOW = 'playlist_window'
- SHARED_TRACK = 'shared_track'
- SOURCE = 'source'
- TRACK = 'track'
- URL_TRACK = 'url_track'
- USER_PLAYLIST = 'user_playlist'
- VIDEO_WINDOW = 'video_window'
- 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
The system library playlist
A playlist containing movie items
An unknown playlist kind
A playlist containing TV show items
An unknown playlist kind
- FOLDER = 1800630342
A folder
- LIBRARY = 1800630348
The system library playlist
- MOVIES = 1800630345
A playlist containing movie items
- NONE = 1800302446
An unknown playlist kind
- TV_SHOWS = 1800630356
A playlist containing TV show items
- UNKNOWN = 0
An unknown playlist kind
- 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 SearchFilter(value)[source]
Bases:
Enum
Filter restrictions on search results.
Attributes:
Search albums
Search all
Search artists
Search the currently displayed playlist
Search track names only
- ALBUMS = 1800630860
Search albums
- ALL = 1799449708
Search all
- ARTISTS = 1800630866
Search artists
- DISPLAYED = 1800630870
Search the currently displayed playlist
- NAMES = 1800630867
Search track names only
- class SourceKind(value)[source]
Bases:
Enum
Types of sources for media items.
Attributes:
The iTunes Store source
A library source
A shared library source
An unknown source
- ITUNES_STORE = 1799967827
The iTunes Store source
- LIBRARY = 1800169826
A library source
- SHARED_LIBRARY = 1800628324
A shared library source
- UNKNOWN = 1800760939
An unknown source
- back_track() XATVApplication [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) XATVBrowserWindowList [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 current_playlist: XATVPlaylist
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.
- current_track() XATVTrack [source]
Returns the currently playing (or paused but not stopped) track.
New in version 0.0.1.
- fast_forward() XATVApplication [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) XATVFileTrackList [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.
- library_playlists(filter: dict | None = None) XATVLibraryPlaylistList [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, track, URL track, shared track, file track, artwork, window, browser window, playlist window, video window, or source.- Parameters:
specifier (Union[str, XATVApplication.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.
- property mute: bool
Whether sound output is muted or not.
- property name: str
The name of the application.
- next_track() XATVApplication [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) XATVApplication [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() XATVApplication [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: XATVItem | None = None, play_once: bool = True) XATVApplication [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 (_XATVItem, 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) XATVPlaylistWindowList [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) XATVPlaylistList [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() XATVApplication [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() XATVApplication [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.
- resume() XATVApplication [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() XATVApplication [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: XATVItemList
The selected media items.
- set_volume(new_volume: float) XATVApplication [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 sound_volume: int
The sound output volume.
- sources(filter: dict | None = None) XATVSourceList [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() XATVApplication [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.
- tracks(filter: dict | None = None) XATVTrackList [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) XATVURLTrackList [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.
- property version: str
The version of the application.
- video_windows(filter: dict | None = None) XATVVideoWindowList [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.
- class PyXA.apps.TV.XATVArtwork(properties)[source]
Bases:
XATVItem
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.TV.XATVArtworkList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVItemList
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) XATVArtwork | None [source]
- by_downloaded(downloaded: bool) XATVArtwork | None [source]
- by_format(format: int) XATVArtwork | None [source]
- by_kind(kind: int) XATVArtwork | None [source]
- by_object_description(object_description: str) XATVArtwork | None [source]
- by_raw_data(raw_data: bytes) XATVArtwork | None [source]
- class PyXA.apps.TV.XATVBrowserWindow(properties)[source]
Bases:
XATVWindow
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: XATVTrackList
The selected tracks.
- property view: XATVPlaylist
The playlist currently displayed in the window.
- class PyXA.apps.TV.XATVBrowserWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVWindowList
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: XATVTrackList) XATVPlaylistWindow | None [source]
- by_view(view: XATVPlaylist) XATVPlaylistWindow | None [source]
- selection() XATVTrackList [source]
- view() XATVPlaylistList [source]
- class PyXA.apps.TV.XATVFileTrack(properties)[source]
Bases:
XATVTrack
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.TV.XATVFileTrackList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVTrackList
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) XATVFileTrack | None [source]
- class PyXA.apps.TV.XATVFolderPlaylist(properties)[source]
Bases:
XATVUserPlaylist
A folder playlist in media apps.
New in version 0.0.7.
- class PyXA.apps.TV.XATVFolderPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVUserPlaylistList
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.TV.XATVItem(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() XATVItem [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.
- class PyXA.apps.TV.XATVItemList(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
()- 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.TV.XATVLibraryPlaylist(properties)[source]
Bases:
XATVPlaylist
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) XATVFileTrackList [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) XATVURLTrackList [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.TV.XATVLibraryPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVPlaylistList
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.TV.XATVPlaylist(properties)[source]
Bases:
XATVItem
A playlist in media apps.
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.
move_to
(parent_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:
The total length of all tracks in seconds.
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: XATVTrackList | list[XATVTrack])[source]
Add one or more tracks to this playlist.
- Parameters:
tracks (Union[XATVTrackList, list[XATVTrack]]) – The list of tracks to add to this playlist
New in version 0.2.2.
- artworks(filter: dict | None = None) XATVArtworkList [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.
- duplicate(location: XATVSource | XATVFolderPlaylist | None = None)[source]
Duplicates the playlist to the specified source or folder playlist.
- Parameters:
location (Union[XATVSource, XATVFolderPlaylist, 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.
- move(location: XATVSource | XATVFolderPlaylist)[source]
Moves the playlist to the specified source or folder playlist.
- Parameters:
location (Union[XATVSource, XATVFolderPlaylist]) – 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: XATVPlaylist
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) XATVTrackList [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.TV.XATVPlaylistList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XATVItemList
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.
New in version 0.0.7.
Methods:
by_duration
(duration)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)duration
()name
()parent
()push
(*elements)Appends the object referenced by the provided PyXA wrapper to the end of the list.
size
()time
()visible
()- by_duration(duration: int) XATVPlaylist | None [source]
- by_name(name: str) XATVPlaylist | None [source]
- by_object_description(object_description: str) XATVPlaylist | None [source]
- by_parent(parent: XATVPlaylist) XATVPlaylist | None [source]
- by_size(size: int) XATVPlaylist | None [source]
- by_special_kind(special_kind: PlaylistKind) XATVPlaylist | None [source]
- by_time(time: str) XATVPlaylist | None [source]
- by_visible(visible: bool) XATVPlaylist | None [source]
- parent() XATVPlaylistList [source]
- push(*elements: list[XATVPlaylist]) XATVPlaylist | list[XATVPlaylist] | 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.TV.XATVPlaylistWindow(properties)[source]
Bases:
XATVWindow
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: XATVTrackList
The selected tracks.
- property view: XATVPlaylist
The playlist currently displayed in the window.
- class PyXA.apps.TV.XATVPlaylistWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVWindowList
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: XATVTrackList) XATVPlaylistWindow | None [source]
- by_view(view: XATVPlaylist) XATVPlaylistWindow | None [source]
- selection() XATVTrackList [source]
- view() XATVPlaylistList [source]
Bases:
XATVTrack
A shared track in media apps.
New in version 0.0.1.
Bases:
XATVTrackList
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.TV.XATVSource(properties)[source]
Bases:
XATVItem
A media source in media apps.
New in version 0.0.1.
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.
Methods:
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.
user_playlists
([filter])Returns a list of user playlists, as PyXA objects, matching the given filter.
- 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) XATVLibraryPlaylistList [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) XATVPlaylistList [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.
- user_playlists(filter: dict | None = None) XATVUserPlaylistList [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.TV.XATVSourceList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XATVItemList
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.
New in version 0.0.7.
Methods:
by_capacity
(capacity)by_free_space
(free_space)by_kind
(kind)capacity
()kind
()- by_capacity(capacity: int) XATVSource | None [source]
- by_free_space(free_space: int) XATVSource | None [source]
- by_kind(kind: SourceKind) XATVSource | None [source]
- kind() list[SourceKind] [source]
- class PyXA.apps.TV.XATVTrack(properties)[source]
Bases:
XATVItem
A class for managing and interacting with tracks in media apps.
See also
XATVSharedTrack
,XATVFileTrack
,XATVRemoteURLTrack
New in version 0.0.1.
Attributes:
The name of the track's album.
The rating of the track's album.
The album's rating kind.
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 category of the track.
User-provided notes on 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.
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 time in seconds from the start at which the track stops playing.
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.
A description of the track's media type.
The last modification date of the track's content.
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.
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 director.
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 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_rating: int
The rating of the track’s album.
- property album_rating_kind: RatingKind
The album’s rating kind.
- artworks(filter: dict | None = None) XATVArtworkList [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 category: str
The category of the track.
- property comment: str
User-provided notes on 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 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: XATVPlaylist | XATVSource)[source]
Duplicates the track at the specified location.
- Parameters:
location (Union[XATVPlaylist, XATVSource]) – 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 finish: float
The time in seconds from the start at which the track stops playing.
- 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 modification_date: datetime
The last modification date of the track’s content.
- move(location: XATVPlaylist | XATVSource)[source]
Moves the track to the specified location, copying it if appropriate.
- Parameters:
location (Union[XATVPlaylist, XATVSource]) – The playlist or source to move the track to
New in version 0.2.2.
- property object_description: str
A string description of the track.
- play() XATVItem [source]
Plays the item.
- Returns:
A reference to the media item object.
- Return type:
_XATVItem
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() XATVItem [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 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_director: str
The string used for this track when sorting by director.
- 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 year: int
The year the track was released.
- class PyXA.apps.TV.XATVTrackList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XATVItemList
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.
New in version 0.0.7.
Methods:
- album_rating_kind() list[RatingKind] [source]
- by_album_rating_kind(album_rating_kind: RatingKind) XATVTrack | None [source]
- by_rating_kind(rating_kind: RatingKind) XATVTrack | None [source]
- rating_kind() list[RatingKind] [source]
- class PyXA.apps.TV.XATVURLTrack(properties)[source]
Bases:
XATVTrack
A URL track in media apps.
New in version 0.0.1.
Attributes:
The URL for the track.
- class PyXA.apps.TV.XATVURLTrackList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVTrackList
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) XATVURLTrack | None [source]
- class PyXA.apps.TV.XATVUserPlaylist(properties)[source]
Bases:
XATVPlaylist
A user-created 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.
Attributes:
Whether the playlist is shared.
Whether the playlist is a smart playlist.
- file_tracks(filter: dict | None = None) XATVFileTrackList [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.
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) XATVURLTrackList [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.TV.XATVUserPlaylistList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVPlaylistList
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.
New in version 0.0.7.
Methods:
by_shared
(shared)by_smart
(smart)shared
()smart
()- by_smart(smart: bool) XATVUserPlaylist | None [source]
- class PyXA.apps.TV.XATVVideoWindow(properties)[source]
Bases:
XATVWindow
A video window in media apps.
New in version 0.0.1.
- class PyXA.apps.TV.XATVVideoWindowList(properties: dict, filter: dict | None = None)[source]
Bases:
XATVWindowList
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.TV.XATVWindow(properties)[source]
Bases:
XASBWindow
,XATVItem
A windows of media apps.
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.TV.XATVWindowList(properties: dict, filter: dict | None = None, obj_class=None)[source]
Bases:
XATVItemList
A wrapper around lists of windows that employs fast enumeration techniques.
All properties of 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:
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]]) XATVWindow | None [source]
- by_closeable(closeable: bool) XATVWindow | None [source]
- by_collapseable(collapseable: bool) XATVWindow | None [source]
- by_collapsed(collapsed: bool) XATVWindow | None [source]
- by_full_screen(full_screen: bool) XATVWindow | None [source]
- by_position(position: tuple[int, int]) XATVWindow | None [source]
- by_resizable(resizable: bool) XATVWindow | None [source]
- by_visible(visible: bool) XATVWindow | None [source]
- by_zoomable(zoomable: bool) XATVWindow | None [source]
- by_zoomed(zoomed: bool) XATVWindow | None [source]