Simple MSD parser (rhythm game format)
Project description
msdparser
Simple MSD parser for Python. MSD is the underlying file format for many rhythm games, most notably both StepMania simfile formats (.sm and .ssc).
Installing
msdparser
is available on PyPI. During the current beta phase, make sure to pass --pre
to pip
:
pip install --pre msdparser
Usage
parse_msd
takes a named file
or string
argument and yields parameters as (key, value) pairs of strings:
from msdparser import parse_msd
with open('simfile.sm', 'r', encoding='utf-8') as simfile:
for (key, value) in parse_msd(file=simfile):
if key == 'NOTES':
break
print(key, '=', repr(value))
Documentation
https://msdparser.readthedocs.io/en/latest/
The MSD format
In general, MSD key-value pairs look like #KEY:VALUE;
- the #
starts a parameter, the first :
separates the key from the value, and the ;
terminates the value. Keys are not expected to be unique. There are no escape sequences.
Comments start with //
and persist until the end of the line.
Keys can contain any text except for :
, //
, and a newline followed by a #
(see below). Values are the same, except :
is allowed.
Keys and values can be blank. The :
separator can even be omitted, which has the same result as a blank value.
StepMania recovers from a missing ;
if it finds a #
marker at the start of a line, so this parser does too.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for msdparser-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1637ef397f8d76ed8e8c31bf679424fb83aa9ae24034ef6eb8ea4b70491cb6c7 |
|
MD5 | c2291639616dea5ed740161b86d8ea3d |
|
BLAKE2b-256 | 8301ba792e5a0183c57ed97036ae4694a934a8903a5f1684982b64e28c462303 |