xspf_lib.Track¶
- class xspf_lib.Track(location: Optional[Union[Iterable[str], str]] = None, identifier: Optional[Union[Iterable[str], str]] = None, title: Optional[str] = None, creator: Optional[str] = None, annotation: Optional[str] = None, info: Optional[str] = None, image: Optional[str] = None, album: Optional[str] = None, trackNum: Optional[int] = None, duration: Optional[int] = None, link: Optional[Iterable[Link]] = None, meta: Optional[Iterable[Meta]] = None, extension: Optional[Iterable[Extension]] = None)¶
Track info class.
- __init__(location: Optional[Union[Iterable[str], str]] = None, identifier: Optional[Union[Iterable[str], str]] = None, title: Optional[str] = None, creator: Optional[str] = None, annotation: Optional[str] = None, info: Optional[str] = None, image: Optional[str] = None, album: Optional[str] = None, trackNum: Optional[int] = None, duration: Optional[int] = None, link: Optional[Iterable[Link]] = None, meta: Optional[Iterable[Meta]] = None, extension: Optional[Iterable[Extension]] = None) None¶
Generate instances of tracks, ready to be put in
xspf_lib.Playlistclass.- Parameters:
location (list[URI] | URI | None) – URI or list of URI of resource to be rendered.
identifier (list[URI] | URI | None) – Canonical ID or list of ID for this resource.
title (str | None) – Name of the track.
creator (str | None) – Name of creator of resource.
annotation (str | None) – Comment on the track.
info (URI | None) – IRI of a place where info of this resource can be founded.
image (URL | None) – URI of an image to display for the duration of the track.
album (str | None) – Name of the collection from which this resource comes.
trackNum (int | None) – Integer giving the ordinal position of the media on the album. Must be gte 0
duration (int | None) – The time to render a resource in milliseconds.
link (list[
xspf_lib.Link] | None) – The link elements allows playlist extended without the use of XML namespace.meta (list[
xspf_lib.Meta] | None) – Metadata fields of playlist.extension (list[
xspf_lib.Extension] | None) – Extension of non-XSPF XML elements.
Methods
__init__([location, identifier, title, ...])Generate instances of tracks, ready to be put in
xspf_lib.Playlistclass.parse_from_xml_element(element)Parse
xml.etree.ElementTree.Elementto data modelto_xml_element()Create xml.ElementTree.Element of the track.
xml_string()Return XML representation of track.
Attributes
locationURI or list of URI of resource to be rendered.
identifierCanonical ID or list of ID for this resource.
titleName of the track.
creatorName of creator of resource.
annotationComment on the track.
infoURI of an image to display for the duration of the track.
imageURI of an image to display for the duration of the track.
albumName of the collection from which this resource comes.
linkThe link elements allows playlist extended without the use of XML namespace.
metaExtension of non-XSPF XML elements.
extensionExtension of non-XSPF XML elements.
durationThe time to render a resource in milliseconds.
trackNumInteger giving the ordinal position of the media on the album.