calliope.import_

Convert playlists from different serialization formats.

See also: cpe import command.

Package Contents

Functions

guess_format(text)

Guess the format of the input playlist.

parse_pls(text)

Parse playlist in PLS format.

parse_xspf(text)

Parse playlist in XSPF format.

parse_jspf(text)

Parse playlist in JSPF format.

import_(text)

Parse playlist data from a file.

exception calliope.import_.PlaylistReadError

Bases: Exception

Exception raised if playlist parsing fails.

Initialize self. See help(type(self)) for accurate signature.

calliope.import_.guess_format(text)

Guess the format of the input playlist.

This is a simple function which tries different parsers in succession until one succeeds. It’s not the most efficient way to load a playlist.

Parameters

text (str) –

Return type

calliope.playlist.PlaylistFormat

calliope.import_.parse_pls(text)

Parse playlist in PLS format.

Parameters

text (str) –

Return type

calliope.playlist.Playlist

calliope.import_.parse_xspf(text)

Parse playlist in XSPF format.

Parameters

text (str) –

Return type

calliope.playlist.Playlist

calliope.import_.parse_jspf(text)

Parse playlist in JSPF format.

Parameters

text (str) –

Return type

calliope.playlist.Playlist

calliope.import_.import_(text)

Parse playlist data from a file.

The type of the input data will be autodetected. The supported formats are: PLS, XSPF, JSPF.

Parameters

text (str) – The file contents.

Returns

A playlist.

Return type

calliope.playlist.Playlist