Modern simfile library for Python
Project description
simfile
A modern simfile parsing & editing library for Python 3.
Features
- Supports both SM and SSC files
- Format-agnostic API for reading & writing simfiles
- SM ↔︎ SSC conversion
- Timing data support
- Beat ↔︎ song time conversion
- Handles BPM changes and stops (delays & warps forthcoming)
- Accepts "split timing" from SSC charts
- Note streams from charts
- Algorithms for grouping jumps & hold/roll head/tail notes
- Flexible note counting functions
- Timing data integration
- Fully typed & documented API
Installation
simfile
is available on PyPI. During alpha, make sure to pass --pre
to pip
, otherwise you will fetch the latest 1.0 release:
pip3 install --pre simfile
Quickstart
Load simfiles from disk using simfile.open
or simfile.load
:
>>> import simfile
>>> springtime = simfile.open('testdata/Springtime.ssc')
>>> springtime
<SSCSimfile: Springtime>
>>> with open('testdata/Robotix.sm', 'r') as infile:
... robotix = simfile.load(infile)
...
>>> robotix
<SMSimfile: Robotix>
Access simfile properties through uppercase keys:
>>> springtime['ARTIST']
'Kommisar'
>>> list(springtime.keys())[:7]
['VERSION', 'TITLE', 'SUBTITLE', 'ARTIST', 'TITLETRANSLIT', 'SUBTITLETRANSLIT', 'ARTISTTRANSLIT']
Alternatively, you can use lowercase attributes for known properties:
>>> robotix.displaybpm
'150.000'
>>> robotix.displaybpm is robotix['DISPLAYBPM']
True
Charts are stored in a list under the .charts
attribute and function similarly to simfile objects:
>>> len(springtime.charts)
9
>>> chart = springtime.charts[0]
>>> chart
<SSCChart: dance-single Challenge 12>
>>> list(chart.keys())[:7]
['CHARTNAME', 'STEPSTYPE', 'DESCRIPTION', 'CHARTSTYLE', 'DIFFICULTY', 'METER', 'RADARVALUES']
Documentation
Full documentation can be found on Read the Docs.
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
simfile-2.0.0b1.tar.gz
(20.8 kB
view hashes)
Built Distribution
simfile-2.0.0b1-py3-none-any.whl
(40.6 kB
view hashes)
Close
Hashes for simfile-2.0.0b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f6b1a23e0d3a532b49c2e437f0e55ceb866cb67c00f5eb6f35d9acd8b5a909 |
|
MD5 | 44d50381ea456b5820a639e6d598cd0a |
|
BLAKE2b-256 | 5b33698c39e7a7c3243171812eba4a4b3c8a9da6dac3986384dea319abf57e03 |