Metadata-Version: 2.1
Name: sus-io
Version: 0.2.0
Summary: A SUS (Sliding Universal Score) parser and generator.
Home-page: https://github.com/mkpoli/sus-io#readme
License: MIT
Keywords: sus,pjsekai,chunithm,seaurchin
Author: mkpoli
Author-email: mkpoli@mkpo.li
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Games/Entertainment :: Arcade
Classifier: Topic :: Utilities
Requires-Dist: base36 (>=0.1.1,<0.2.0)
Requires-Dist: dataclasses-json (>=0.5.6,<0.6.0)
Requires-Dist: single-source (>=0.2.0,<0.3.0)
Project-URL: Repository, https://github.com/mkpoli/sus-io
Project-URL: changelog, https://github.com/mkpoli/sus-io/blob/main/CHANGELOG.md
Project-URL: issues, https://github.com/mkpoli/sus-io/issues
Description-Content-Type: text/markdown

# sus-io

A SUS (Sliding Universal Score) parser and generator.

[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)

## 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.

## License

MIT © 2021 mkpoli

