Skip to main content

MrHelix's osu! star rating calculator rewritten for your Python needs

Project description

osu_sr_calculator

Package to calculate star rating of any osu beatmap with any mod combination.

Updated on: 19.02.2021

Disclaimer

calculated star ratings may be varying slightly from original values (margin of 0.01)

Yeah, thats a complete bullshit right now, its pretty bugged. For example:

for i in range(10):
    sr = calculateStarRating(filepath='test.osu')
    print(sr)

produces 10 different star rating values:

{'nomod': 5.955382197693518}
{'nomod': 6.109616666952475}
{'nomod': 6.172281009645555}
{'nomod': 6.20557690741399}
{'nomod': 6.225886061332697}
{'nomod': 6.239371401049138}
{'nomod': 6.248839053432763}
{'nomod': 6.255751258545029}
{'nomod': 6.2609497007447885}
{'nomod': 6.264954757521128}

I guess lack of any tests does not help at all.

Usage

from osu_sr_calculator import calculateStarRating
starRating = calculateStarRating(returnAllDifficultyValues, filepath, map_id, mods, allCombinations)

calculateStarRating method accepts these parameters:

  • returnAllDifficultyValues: returns total star rating value if False. when set to True, method will also return aim and speed difficulty
  • filepath (optional if map_id is set): Path to .osu file
  • map_id (optional if filepath is set): BeatmapID number of a beatmap
  • mods (optional): Specify which mods to include during star rating calculation
  • allCombinations (optional): when set to True, will return star rating of every possible mod combination

Examples

  • local file nomod star rating:
starRating = calculateStarRating(filepath='path/to/file.osu')
# Response: { 'nomod': x.xxxx }
  • BeatmapID DT star rating:
starRating = calculateStarRating(map_id=123456, mods=['DT'])
# Response: { 'DT': x.xxxx }
  • All possible star ratings:
starRatings = calculateStarRating(filepath='path/to/file.osu', allCombinations=True)
# Response:
# {
#     nomod: x.xxxx,
#     DT: x.xxxx,
#     HT: x.xxxx,
#     HR: x.xxxx,
#     HRDT: x.xxxx,
#     HRHT: x.xxxx,
#     EZ: x.xxxx,
#     EZDT: x.xxxx,
#     EZHT: x.xxxx,
# }
  • Aim and Speed ratings:
starRatings = calculateStarRating(filepath='path/to/file.osu', returnAllDifficultyValues=True)
# Response:
# {
#     nomod: {
#         aim: x.xxxx,
#         speed: x.xxxx,
#         total: x.xxxx,
#     }
# }

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

osu_sr_calculator-1.0.0.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osu_sr_calculator-1.0.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file osu_sr_calculator-1.0.0.tar.gz.

File metadata

  • Download URL: osu_sr_calculator-1.0.0.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for osu_sr_calculator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0920fe05f4eacf6af821c7fcadd95c40a806b96f1e3d71080fcd30fa0d022403
MD5 240b79eaefa1908eb9007ac885831c55
BLAKE2b-256 3f0cfb834f5e43a7c90f940a04fb5fb33c862dcdd13a838e364d74680f14448d

See more details on using hashes here.

File details

Details for the file osu_sr_calculator-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: osu_sr_calculator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for osu_sr_calculator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b85e5233be284f30dd23b3bac468ebbdc544a501e9124cc7a5fe6831023c21b0
MD5 efcf2eebe2053ca80669aadb1ade0c25
BLAKE2b-256 9a98f706bbe6664805d640560a602cdf8ba1afb939b69d9c655c1a4f62e3f19a

See more details on using hashes here.

Supported by

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