Skip to main content

A SUS (Sliding Universal Score) parser and generator.

Project description

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.

Functionality

  • Parse sus into tick-based objects.
  • Allow json output.

Usage

sus.loads(data: str)

import sus

print(sus.loads("#00002: 4\n#BPM01: 120\n#00008: 01"))

sus.load(fp: TextIO)

import sus

with open("score.sus", "r") as f:
    score = sus.load(f)
    print(score)

Score(...).to_json(...), Score.from_json(...)

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)

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

License

MIT © 2021 mkpoli

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sus-io-0.2.1.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

sus_io-0.2.1-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page