Projects

A project is a wrapper around a song that gives the song a name and a version.

In addition to the pylsdj.Project object itself, the pylsdj.projects module contains functions for loading projects from .srm and .lsdsng files.

Usage Examples

from pylsdj import Project, load_srm, load_lsdsng

# Load a .srm file
srm_proj = load_srm("test1.srm")

# Load a .lsdsng file
lsdsng_proj = load_srm("test2.lsdsng")

# Convert the .srm project to .lsdsng
srm_proj.save_lsdsng("test1_conv.lsdsng")

# Get the srm project's song
song = srm_proj.song

API Documentation

pylsdj.load_lsdsng(filename)

Load a Project from a .lsdsng file.

Parameters:filename – the name of the file from which to load
Return type:pylsdj.Project
pylsdj.load_srm(filename)

Load a Project from an .srm file.

Parameters:filename – the name of the file from which to load
Return type:pylsdj.Project
class pylsdj.Project(name, version, size_blks, data)
name = None

the project’s name

save(filename)

Save a project in .lsdsng format to the target file.

Parameters:filename – the name of the file to which to save
Deprecated:use save_lsdsng(filename) instead
save_lsdsng(filename)

Save a project in .lsdsng format to the target file.

Parameters:filename – the name of the file to which to save
save_srm(filename)

Save a project in .srm format to the target file.

Parameters:filename – the name of the file to which to save
size_blks = None

the size of the song in filesystem blocks

song

the song associated with the project

version = None

the project’s version (incremented on every save in LSDJ)