powersong

The powersong module provides the functionality for importing PowerSong songs into the OpenLP database.

class openlp.plugins.songs.lib.importers.powersong.PowerSongImport(manager, **kwargs)[source]

Bases: openlp.plugins.songs.lib.importers.songimport.SongImport

The PowerSongImport class provides the ability to import song files from PowerSong.

PowerSong 1.0 Song File Format:

The file has a number of label-field (think key-value) pairs.

Label and Field strings:

  • Every label and field is a variable length string preceded by an integer specifying it’s byte length.
  • Integer is 32-bit but is encoded in 7-bit format to save space. Thus if length will fit in 7 bits (ie <= 127) it takes up only one byte.

Metadata fields:

  • Every PowerSong file has a TITLE field.
  • There is zero or more AUTHOR fields.
  • There is always a COPYRIGHTLINE label, but its field may be empty. This field may also contain a CCLI number: e.g. “CCLI 176263”.

Lyrics fields:

  • Each verse is contained in a PART field.
  • Lines have Windows line endings CRLF (0x0d, 0x0a).
  • There is no concept of verse types.

Valid extensions for a PowerSong song file are:

  • .song
do_import()[source]

Receive either a list of files or a folder (unicode) to import.

static is_valid_source(import_source)[source]
Checks if source is a PowerSong 1.0 folder:
  • is a directory
  • contains at least one *.song file