A modern simfile parsing & editing library for Python 3.
Full documentation can be found on Read the Docs.
Features
- Supports both SM and SSC files
- Timing data support
- Beat ↔︎ song time conversion
- Handles BPM changes, stops, delays and warps
- Accepts "split timing" from SSC charts
- Note streams from charts
- Fully typed, documented, and tested API
Installation
simfile is available on PyPI:
pip3 install simfile
Quickstart
Load simfiles from disk using simfile.open or simfile.load:
>>> import simfile
>>> springtime = simfile.open('testdata/Springtime/Springtime.ssc')
>>> springtime
<SSCSimfile: Springtime>
>>> with open('testdata/nekonabe/nekonabe.sm', 'r') as infile:
... nekonabe = simfile.load(infile)
...
>>> nekonabe
<SMSimfile: 猫鍋>
Use lowercase attributes to access most common properties:
>>> springtime.artist
'Kommisar'
>>> springtime.banner
'springbn.png'
>>> springtime.subtitle = '(edited)'
>>> springtime
<SSCSimfile: Springtime (edited)>
Alternatively, use uppercase strings to access the underlying dictionary:
>>> springtime['ARTIST']
'Kommisar'
>>> springtime['ARTIST'] is springtime.artist
True
>>> list(springtime.keys())[:7]
['VERSION', 'TITLE', 'SUBTITLE', 'ARTIST', 'TITLETRANSLIT', 'SUBTITLETRANSLIT', 'ARTISTTRANSLIT']
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']
Developing
simfile uses Pipenv for dependency management. Activate the environment:
pipenv shell
To run the unit tests:
py -m unittest
To build the documentation:
docs/make html
Metadata
Release files for simfile 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simfile-2.1.1.tar.gz | 33.8 kB | Without provenance | Details for simfile-2.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simfile-2.1.1-py3-none-any.whl | Python 3 | none | any | Details for simfile-2.1.1-py3-none-any.whl |
Total release size: 76.1 kB
Release files / simfile-2.1.1.tar.gz
| Download URL | simfile-2.1.1.tar.gz |
|---|---|
| Size | 33.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7885f8395cdd0f19cd79da34e5675da778aa0e8dda76543cf075e21b862c4b7
|
|
BLAKE2b-256 checksum How to use checksums |
fe75156a1913b0a6636dfc76ac8a28da9b8a9da859fc3bb8ea5a15176f0e077d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.6
|
Release files / simfile-2.1.1-py3-none-any.whl
| Download URL | simfile-2.1.1-py3-none-any.whl |
|---|---|
| Size | 42.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
133094a33cf6b841ca7e620880ef8354c56dd4aef6b2c77582de7f120f69c620
|
|
BLAKE2b-256 checksum How to use checksums |
dff9b0c67f88f6aa15697cecb941ccfa7cb3377296ac14c8c9fceea326f05d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.6
|
Security for simfile 2.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.