Skip to main content
Python package isort black pre-commit

Library to work with xspf.

Requirements

Installing

Install and update via pip:

pip install -U xspf-lib

Example

  1. Generating new playlist.

>>> import xspf_lib as xspf
>>> killer_queen = xspf.Track(location="file:///home/music/killer_queen.mp3",
                              title="Killer Queen",
                              creator="Queen",
                              album="Sheer Heart Attack",
                              trackNum=2,
                              duration=177000,
                              annotation="#2 in GB 1975",
                              info="https://ru.wikipedia.org/wiki/Killer_Queen",
                              image="file:///home/images/killer_queen_cover.png")
>>> anbtd = xspf.Track()
>>> anbtd.location = ["https://freemusic.example.com/loc.ogg",
                      "file:///home/music/anbtd.mp3"]
>>> anbtd.title = "Another One Bites the Dust"
>>> anbtd.creator = "Queen"
>>> anbtd.identifier = ["id1.group"]
>>> anbtd.link = [xspf.Link("link.namespace", "link.uri.info")]
>>> anbtd.meta = [xspf.Meta("meta.namespace", "METADATA_INFO")]
>>> playlist = xspf.Playlist(title="Some Tracks",
                             creator="myself",
                             annotation="I did this only for examples!.",
                             trackList=[killer_queen, anbtd])
>>> print(playlist.xml_string())
<playlist version="1" xmlns="http://xspf.org/ns/0/"><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>https://ru.wikipedia.org/wiki/Killer_Queen</info><image>file:///home/images/killer_queen_cover.png</image><album>Sheer Heart Attack</album><trackNum>2</trackNum><duration>177000</duration></track><track><location>https://freemusic.example.com/loc.ogg</location><location>file:///home/music/anbtd.mp3</location><identifier>id1.group</identifier><title>Another One Bites the Dust</title><creator>Queen</creator><link rel="link.namespace">link.uri.info</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")

License

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

Metadata

Release files for xspf-lib 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xspf-lib 0.3.4
File Size Uploaded
xspf_lib-0.3.4.tar.gz 25.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xspf-lib 0.3.4
File Interpreter ABI Platform
xspf_lib-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 38.9 kB

Release files / xspf_lib-0.3.4.tar.gz

Download URL xspf_lib-0.3.4.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
58ecbbe04dc00444042cb7d4933d796047a7411f4a74f14f7e8ca958b606a223
BLAKE2b-256 checksum
How to use checksums
78eb90c96d2a94bc52297d66477d6d476b1559b306eba4b0ee557a41cadcf9c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / xspf_lib-0.3.4-py3-none-any.whl

Download URL xspf_lib-0.3.4-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff5dd25aaae6606a310ca395b9427ded58b16aa96703b0e614e8bc6ee645d75f
BLAKE2b-256 checksum
How to use checksums
662f4845e975a257910ba422838092a217cdb15409f013073de56bc03ef27a27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page