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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file sus-io-0.2.1.tar.gz.

File metadata

  • Download URL: sus-io-0.2.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Windows/10

File hashes

Hashes for sus-io-0.2.1.tar.gz
Algorithm Hash digest
SHA256 302f9e39a4e700efd0a44c7be1667bf399c858564e364a5fa27fa3ca948e39fc
MD5 48129529a0914fd0fd1dfe59cfef926d
BLAKE2b-256 038b54dbc8f3af57dfeac87a86a2ca8926a85b9f5c4e54d2252e509084869a35

See more details on using hashes here.

File details

Details for the file sus_io-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: sus_io-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Windows/10

File hashes

Hashes for sus_io-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb7f8cb5aab4b44c08b041f212600fb60fb30087eec538edc6d54c94bac504a6
MD5 481f454f7349051131aef1992e543928
BLAKE2b-256 de9c741562acda5fd4ca2b9e0426f221fa30ea4bad1a3aa86e10d15b7642e265

See more details on using hashes here.

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