![simfile - for Python 3](docs/source/_static/simfile-600.png?raw=true)
A modern simfile parsing & editing library for Python 3.
Full documentation can be found on **[Read the Docs](https://simfile.readthedocs.io/en/latest/)**.
## Features
* Supports both SM and SSC files
- [Format-agnostic API for reading & writing simfiles](https://simfile.readthedocs.io/en/latest/reading-writing.html)
- [SM ↔︎ SSC conversion](https://simfile.readthedocs.io/en/latest/autoapi/simfile/convert/index.html)
* [Timing data support](https://simfile.readthedocs.io/en/latest/timing-note-data.html#reading-timing-data)
- [Beat ↔︎ song time conversion](https://simfile.readthedocs.io/en/latest/timing-note-data.html#converting-song-time-to-beats)
- Handles BPM changes, stops, delays and warps
- Accepts "split timing" from SSC charts
* [Note streams from charts](https://simfile.readthedocs.io/en/latest/timing-note-data.html#reading-note-data)
- [Algorithms for grouping jumps & hold/roll head/tail notes](https://simfile.readthedocs.io/en/latest/timing-note-data.html#handling-holds-rolls-and-jumps)
- [Flexible note counting functions](https://simfile.readthedocs.io/en/latest/timing-note-data.html#counting-notes)
- [Timing data integration](https://simfile.readthedocs.io/en/latest/timing-note-data.html#combining-notes-and-time)
* Fully typed, documented, and tested API
## Installation
**simfile** is available on PyPI:
```bash
pip3 install simfile
```
## Quickstart
Load simfiles from disk using `simfile.open` or `simfile.load`:
```python
>>> 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:
```python
>>> springtime.artist
'Kommisar'
>>> springtime.banner
'springbn.png'
>>> springtime.subtitle = '(edited)'
>>> springtime
<SSCSimfile: Springtime (edited)>
```
Alternatively, use uppercase strings to access the underlying dictionary:
```python
>>> 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:
```python
>>> 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:
```bash
pipenv shell
```
To run the unit tests:
```bash
py -m unittest
```
To build the documentation:
```bash
docs/make html
```
Raw data
{
"_id": null,
"home_page": "https://github.com/garcia/simfile",
"name": "simfile",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "stepmania simfile sm ssc",
"author": "Ash Garcia",
"author_email": "python-simfile@garcia.sh",
"download_url": "https://files.pythonhosted.org/packages/fe/75/156a1913b0a6636dfc76ac8a28da9b8a9da859fc3bb8ea5a15176f0e077d/simfile-2.1.1.tar.gz",
"platform": null,
"description": "![simfile - for Python 3](docs/source/_static/simfile-600.png?raw=true)\n\nA modern simfile parsing & editing library for Python 3.\n\nFull documentation can be found on **[Read the Docs](https://simfile.readthedocs.io/en/latest/)**.\n\n## Features\n\n* Supports both SM and SSC files\n - [Format-agnostic API for reading & writing simfiles](https://simfile.readthedocs.io/en/latest/reading-writing.html)\n - [SM \u2194\ufe0e SSC conversion](https://simfile.readthedocs.io/en/latest/autoapi/simfile/convert/index.html)\n* [Timing data support](https://simfile.readthedocs.io/en/latest/timing-note-data.html#reading-timing-data)\n - [Beat \u2194\ufe0e song time conversion](https://simfile.readthedocs.io/en/latest/timing-note-data.html#converting-song-time-to-beats)\n - Handles BPM changes, stops, delays and warps\n - Accepts \"split timing\" from SSC charts\n* [Note streams from charts](https://simfile.readthedocs.io/en/latest/timing-note-data.html#reading-note-data)\n - [Algorithms for grouping jumps & hold/roll head/tail notes](https://simfile.readthedocs.io/en/latest/timing-note-data.html#handling-holds-rolls-and-jumps)\n - [Flexible note counting functions](https://simfile.readthedocs.io/en/latest/timing-note-data.html#counting-notes)\n - [Timing data integration](https://simfile.readthedocs.io/en/latest/timing-note-data.html#combining-notes-and-time)\n* Fully typed, documented, and tested API\n\n## Installation\n\n**simfile** is available on PyPI:\n\n```bash\npip3 install simfile\n```\n\n## Quickstart\n\nLoad simfiles from disk using `simfile.open` or `simfile.load`:\n\n```python\n>>> import simfile\n>>> springtime = simfile.open('testdata/Springtime/Springtime.ssc')\n>>> springtime\n<SSCSimfile: Springtime>\n>>> with open('testdata/nekonabe/nekonabe.sm', 'r') as infile:\n... nekonabe = simfile.load(infile)\n...\n>>> nekonabe\n<SMSimfile: \u732b\u934b>\n```\n\nUse lowercase attributes to access most common properties:\n\n```python\n>>> springtime.artist\n'Kommisar'\n>>> springtime.banner\n'springbn.png'\n>>> springtime.subtitle = '(edited)'\n>>> springtime\n<SSCSimfile: Springtime (edited)>\n```\n\nAlternatively, use uppercase strings to access the underlying dictionary:\n\n```python\n>>> springtime['ARTIST']\n'Kommisar'\n>>> springtime['ARTIST'] is springtime.artist\nTrue\n>>> list(springtime.keys())[:7]\n['VERSION', 'TITLE', 'SUBTITLE', 'ARTIST', 'TITLETRANSLIT', 'SUBTITLETRANSLIT', 'ARTISTTRANSLIT']\n```\n\nCharts are stored in a list under the `.charts` attribute and function similarly to simfile objects:\n\n```python\n>>> len(springtime.charts)\n9\n>>> chart = springtime.charts[0]\n>>> chart\n<SSCChart: dance-single Challenge 12>\n>>> list(chart.keys())[:7]\n['CHARTNAME', 'STEPSTYPE', 'DESCRIPTION', 'CHARTSTYLE', 'DIFFICULTY', 'METER', 'RADARVALUES']\n```\n\n## Developing\n\n**simfile** uses Pipenv for dependency management. Activate the environment:\n\n```bash\npipenv shell\n```\n\nTo run the unit tests:\n\n```bash\npy -m unittest\n```\n\nTo build the documentation:\n\n```bash\ndocs/make html\n```\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Modern simfile library for Python",
"version": "2.1.1",
"project_urls": {
"Homepage": "https://github.com/garcia/simfile"
},
"split_keywords": [
"stepmania",
"simfile",
"sm",
"ssc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dff9b0c67f88f6aa15697cecb941ccfa7cb3377296ac14c8c9fceea326f05d81",
"md5": "a78bff3ff4431ad2cb785d15343c37e6",
"sha256": "133094a33cf6b841ca7e620880ef8354c56dd4aef6b2c77582de7f120f69c620"
},
"downloads": -1,
"filename": "simfile-2.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a78bff3ff4431ad2cb785d15343c37e6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 42227,
"upload_time": "2023-01-08T23:41:51",
"upload_time_iso_8601": "2023-01-08T23:41:51.887354Z",
"url": "https://files.pythonhosted.org/packages/df/f9/b0c67f88f6aa15697cecb941ccfa7cb3377296ac14c8c9fceea326f05d81/simfile-2.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fe75156a1913b0a6636dfc76ac8a28da9b8a9da859fc3bb8ea5a15176f0e077d",
"md5": "46c1f7f836a282b678ac6401d418e93f",
"sha256": "a7885f8395cdd0f19cd79da34e5675da778aa0e8dda76543cf075e21b862c4b7"
},
"downloads": -1,
"filename": "simfile-2.1.1.tar.gz",
"has_sig": false,
"md5_digest": "46c1f7f836a282b678ac6401d418e93f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 33848,
"upload_time": "2023-01-08T23:41:52",
"upload_time_iso_8601": "2023-01-08T23:41:52.919443Z",
"url": "https://files.pythonhosted.org/packages/fe/75/156a1913b0a6636dfc76ac8a28da9b8a9da859fc3bb8ea5a15176f0e077d/simfile-2.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-08 23:41:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "garcia",
"github_project": "simfile",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "simfile"
}