# sus-io
A SUS (Sliding Universal Score) parser and generator.
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
## Functionality
- Parse sus into tick-based objects.
- Allow json output.
## Usage
### ``sus.loads(data: str)``
```python
import sus
print(sus.loads("#00002: 4\n#BPM01: 120\n#00008: 01"))
```
### ``sus.load(fp: TextIO)``
```python
import sus
with open("score.sus", "r") as f:
score = sus.load(f)
print(score)
```
### ``Score(...).to_json(...)``, ``Score.from_json(...)``
```python
import sus
from sus import Score
with open("score.sus", "r") as fi, open("score.json", "w") as fo:
score = sus.load(fi)
json = score.to_json(indent=4)
fo.write(json)
print(Score.from_json(json))
```
### ``sus.dump(score: Score)``, ``sus.dumps(score: Score)``
```python
import sus
with open("score.sus", 'r') as fi, open(sus_file.with_suffix('.dumped.sus'), 'w') as fd:
score = sus.load(fi)
print(sus.dumps(score))
sus.dump(score, fd, comment='Custom comment.', space=False)
```
## Todo
- Acknowledgement
- Add example I/O
- Contribution Guide
- High Speed
- etc.
## Links
### Javascript
- [``sus-io (npm)``](https://www.npmjs.com/package/sus-io)
- [``sus-parse (npm)``](https://www.npmjs.com/package/sus-parse)
- [``sus-stringify (npm)``](https://www.npmjs.com/package/sus-stringify)
## License
MIT © 2021 mkpoli
Raw data
{
"_id": null,
"home_page": "https://github.com/mkpoli/sus-io#readme",
"name": "sus-io",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "sus,pjsekai,chunithm,seaurchin",
"author": "mkpoli",
"author_email": "mkpoli@mkpo.li",
"download_url": "https://files.pythonhosted.org/packages/03/8b/54dbc8f3af57dfeac87a86a2ca8926a85b9f5c4e54d2252e509084869a35/sus-io-0.2.1.tar.gz",
"platform": "",
"description": "# sus-io\n\nA SUS (Sliding Universal Score) parser and generator.\n\n[![Project Status: Active \u2013 The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n\n## Functionality\n- Parse sus into tick-based objects.\n- Allow json output.\n\n## Usage\n\n### ``sus.loads(data: str)``\n```python\nimport sus\n\nprint(sus.loads(\"#00002: 4\\n#BPM01: 120\\n#00008: 01\"))\n```\n\n### ``sus.load(fp: TextIO)``\n```python\nimport sus\n\nwith open(\"score.sus\", \"r\") as f:\n score = sus.load(f)\n print(score)\n```\n\n### ``Score(...).to_json(...)``, ``Score.from_json(...)``\n```python\nimport sus\nfrom sus import Score\n\nwith open(\"score.sus\", \"r\") as fi, open(\"score.json\", \"w\") as fo:\n score = sus.load(fi)\n json = score.to_json(indent=4)\n fo.write(json)\n\n print(Score.from_json(json))\n```\n\n### ``sus.dump(score: Score)``, ``sus.dumps(score: Score)``\n```python\nimport sus\n\nwith open(\"score.sus\", 'r') as fi, open(sus_file.with_suffix('.dumped.sus'), 'w') as fd:\n score = sus.load(fi)\n print(sus.dumps(score))\n sus.dump(score, fd, comment='Custom comment.', space=False)\n```\n\n## Todo\n\n- Acknowledgement\n- Add example I/O\n- Contribution Guide\n- High Speed\n- etc.\n\n## Links\n\n### Javascript\n- [``sus-io (npm)``](https://www.npmjs.com/package/sus-io)\n- [``sus-parse (npm)``](https://www.npmjs.com/package/sus-parse)\n- [``sus-stringify (npm)``](https://www.npmjs.com/package/sus-stringify)\n\n## License\n\nMIT \u00a9 2021 mkpoli\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A SUS (Sliding Universal Score) parser and generator.",
"version": "0.2.1",
"project_urls": {
"Bug Tracker": "https://github.com/mkpoli/sus-io/issues",
"Changelog": "https://github.com/mkpoli/sus-io/blob/main/CHANGELOG.md",
"Homepage": "https://github.com/mkpoli/sus-io#readme",
"Repository": "https://github.com/mkpoli/sus-io"
},
"split_keywords": [
"sus",
"pjsekai",
"chunithm",
"seaurchin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "de9c741562acda5fd4ca2b9e0426f221fa30ea4bad1a3aa86e10d15b7642e265",
"md5": "481f454f7349051131aef1992e543928",
"sha256": "cb7f8cb5aab4b44c08b041f212600fb60fb30087eec538edc6d54c94bac504a6"
},
"downloads": -1,
"filename": "sus_io-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "481f454f7349051131aef1992e543928",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 9848,
"upload_time": "2022-02-12T15:54:29",
"upload_time_iso_8601": "2022-02-12T15:54:29.217394Z",
"url": "https://files.pythonhosted.org/packages/de/9c/741562acda5fd4ca2b9e0426f221fa30ea4bad1a3aa86e10d15b7642e265/sus_io-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "038b54dbc8f3af57dfeac87a86a2ca8926a85b9f5c4e54d2252e509084869a35",
"md5": "48129529a0914fd0fd1dfe59cfef926d",
"sha256": "302f9e39a4e700efd0a44c7be1667bf399c858564e364a5fa27fa3ca948e39fc"
},
"downloads": -1,
"filename": "sus-io-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "48129529a0914fd0fd1dfe59cfef926d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 7502,
"upload_time": "2022-02-12T15:54:27",
"upload_time_iso_8601": "2022-02-12T15:54:27.995364Z",
"url": "https://files.pythonhosted.org/packages/03/8b/54dbc8f3af57dfeac87a86a2ca8926a85b9f5c4e54d2252e509084869a35/sus-io-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-02-12 15:54:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mkpoli",
"github_project": "sus-io#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "sus-io"
}