Skip to main content

Library for work with xspf format

Project description

Python package

Library to work with xspf.



Install and update via pip:

pip install -U xspf-lib


  1. Generating new playlist.
>>> import xspf_lib as xspf
>>> killer_queen = xspf.Track(location="file:///home/music/killer_queen.mp3",
                              title="Killer Queen",
                              album="Sheer Heart Attack",
                              annotation="#2 in GB 1975",
>>> anbtd = xspf.Track()
>>> anbtd.location = ["",
>>> anbtd.title = "Another One Bites the Dust"
>>> anbtd.creator = "Queen"
>>> anbtd.identifier = [""]
>>> = [xspf.Link("link.namespace", "")]
>>> anbtd.meta = [xspf.Meta("meta.namespace", "METADATA_INFO")]
>>> playlist = xspf.Playlist(title="Some Tracks",
                             annotation="I did this only for examples!.",
                             trackList=[killer_queen, anbtd])
>>> print(playlist.xml_string())
<playlist version="1" xmlns=""><title>Some Tracks</title><creator>myself</creator><annotation>I did this only for examples!.</annotation><date>2020-02-03T14:29:59.199202+03:00</date><trackList><track><location>file:///home/music/killer_queen.mp3</location><title>Killer Queen</title><creator>Queen</creator><annotation>#2 in GB 1975</annotation><info></info><image>file:///home/images/killer_queen_cover.png</image><album>Sheer Heart Attack</album><trackNum>2</trackNum><duration>177000</duration></track><track><location></location><location>file:///home/music/anbtd.mp3</location><identifier></identifier><title>Another One Bites the Dust</title><creator>Queen</creator><link rel="link.namespace"></link><meta rel="meta.namespace">METADATA_INFO</meta></track></trackList></playlist>
>>> playlist.write("some_tracks.xspf")
  1. Parsing from file.
>>> from xspf_lib import Playlist
>>> playlist = Playlist.parse("some_tracks.xspf")


The license of the project is MIT License - see LICENSE file for details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xspf-lib-0.2.0.tar.gz (15.0 kB view hashes)

Uploaded source

Built Distribution

xspf_lib-0.2.0-py3-none-any.whl (10.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page