Difficulty and performance calculation for osu!
Project description
rina-pp-pyb
Library to calculate difficulty and performance attributes for all osu! modes.
This is a python binding to the Rust library rina-pp which was bootstrapped through PyO3. As such, its performance is much faster than a native python library.
Usage
The library exposes multiple classes:
Beatmap
: Parsed.osu
fileGameMode
- Calculators
Difficulty
: Class to calculate difficulty attributes, strains, or create gradual calculatorsPerformance
: Performance attributes calculatorGradualDifficulty
: Calculator to calculate difficulty attributes after each hitobjectGradualPerformance
: Calculator to calculator performance attributes after each hitresultBeatmapAttributesBuilder
: Beatmap attributes calculator
- Results
DifficultyAttributes
Strains
: Strain values of a difficulty calculation, suitable to plot difficulty over timePerformanceAttributes
BeatmapAttributes
HitResultPriority
: Passed toPerformance
, decides whether specified accuracy should be realized through good or bad hitresultsScoreState
: Hitresults and max combo of a score, found inPerformanceAttributes
and passed to gradual calculators
Example
Calculating performance
import rina_pp_pyb as rosu
# either `path`, `bytes`, or `content` must be specified when parsing a map
map = rosu.Beatmap(path = "/path/to/file.osu")
# Optionally convert to a specific mode
map.convert(rosu.GameMode.Mania)
perf = rosu.Performance(
# various kwargs available
accuracy = 98.76,
misses = 2,
combo = 700,
hitresult_priority = rosu.HitResultPriority.WorstCase, # favors bad hitresults
)
# Each kwarg can also be specified afterwards through setters
perf.set_accuracy(99.11) # override previously specified accuracy
perf.set_mods(8 + 64) # HDDT
perf.set_clock_rate(1.4)
# Second argument of map attributes specifies whether mods still need to be accounted for
# `True`: mods already considered; `False`: value should still be adjusted
perf.set_ar(10.5, True)
perf.set_od(5, False)
# Calculate for the map
attrs = perf.calculate(map)
# Note that calculating via map will have to calculate difficulty attributes
# internally which is fairly expensive. To speed it up, you can also pass in
# previously calculated attributes, but be sure they were calculated for the
# same difficulty settings like mods, clock rate, custom map attributes, ...
perf.set_accuracy(100)
perf.set_misses(None)
perf.set_combo(None)
# Calculate a new set of attributes by re-using previous attributes instead of the map
max_attrs = perf.calculate(attrs)
print(f'PP: {attrs.pp}/{max_attrs.pp} | Stars: {max_attrs.difficulty.stars}')
Gradual calculation
import rina_pp_pyb as rosu
# Parsing the map, this time through the `content` kwarg
with open("/path/to/file.osu") as file:
map = rosu.Beatmap(content = file.read())
# Specifying some difficulty parameters
diff = rosu.Difficulty(
mods = 16 + 1024, # HRFL
clock_rate = 1.1,
ar = 10.2,
ar_with_mods = True,
)
# Gradually calculating *difficulty* attributes
gradual_diff = diff.gradual_difficulty(map)
for i, attrs in enumerate(gradual_diff, 1):
print(f'Stars after {i} hitobjects: {attrs.stars}')
# Gradually calculating *performance* attributes
gradual_perf = diff.gradual_performance(map)
i = 1
while True:
state = rosu.ScoreState(
max_combo = i,
n300 = i,
n100 = 0,
# ...
)
attrs = gradual_perf.next(state)
if attrs is None:
# All hitobjects have been processed
break
print(f'PP: {attrs.pp}')
i += 1
Installing rina-pp-pyb
Installing rina-pp-pyb requires a supported version of Python and Rust.
Once Python and Rust are ready to go, you can install the project with pip:
$ pip install rina-pp-pyb
or
$ pip install git+https://github.com/osuthailand/rina-pp-pyb
Learn More
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rina_pp_pyb-1.0.4.tar.gz
(22.7 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-1.0.4-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80b57f8ef427e88193ca3c64c46dd95f23574d40b6553b33846a1f177975d908 |
|
MD5 | 92b0d87bab4b885244fc3622ddd2cc20 |
|
BLAKE2b-256 | bf4dfd4f3a594f39b2c8bebf1f9457c4d9bcf2c54a2971ecdc8db1b8000701f8 |
Close
Hashes for rina_pp_pyb-1.0.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b83b8f9f5c1eb52632c83138bd3c3e06775920799936da52957911a8738b1646 |
|
MD5 | 228a3827e83863e28fec3ba924028f21 |
|
BLAKE2b-256 | 32376e269270942e960071845ab38dcbcb8bc2bfa9a1445dfcd4229a226517ed |
Close
Hashes for rina_pp_pyb-1.0.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fefd6451f475597de88de0e1a02d146f7713b8707408bbe3c7d2206b7fdccc1d |
|
MD5 | e5a0da01d7d4b4528c29857d507a35bc |
|
BLAKE2b-256 | e5a83d29668699d47a05046c4690ec3e7f6f697352ecfba81f9f2d9e7adc9324 |
Close
Hashes for rina_pp_pyb-1.0.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c54210b313b291979425a7302e68b727f3628be2bf3dd07503fa503d853cf14 |
|
MD5 | bd23e21a7ecbfc579b8ca4f7cd999140 |
|
BLAKE2b-256 | be39d916f0553f7eda9659c6c7722aa77c83d8c1f3f6513c70a68ec06df2642e |
Close
Hashes for rina_pp_pyb-1.0.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b42fa81d18061ad602934d48890624559f8738fdb7ffc686ec2aebea9784cc02 |
|
MD5 | f848337d8b87453fd0391b0c3d44c780 |
|
BLAKE2b-256 | 861b54cd0a32e19b4906296f01df733764bb5abdc0e78f9ca3bc177ce0cb4bf3 |
Close
Hashes for rina_pp_pyb-1.0.4-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed2c793e7bf8b4b8c8835df3b2d7120dd90b4fa9e14010dbd731d7192139ee3e |
|
MD5 | eaadc829f7c1a2578ef5baf492f50d67 |
|
BLAKE2b-256 | dfa850e7d2067b8ba76f573dc2cdadae283de81808bd588036f0d6370d1818f1 |
Close
Hashes for rina_pp_pyb-1.0.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abb28b60a1e599ac91fc71d1f2f2fa0691a601cf4468221a71b9992ca00abb55 |
|
MD5 | e5160e11487120547e5409f2c7302565 |
|
BLAKE2b-256 | 41e0d485eaf205b01f9fda4719a5a1379fb0d9c00ac775f6e96710c5973c351b |
Close
Hashes for rina_pp_pyb-1.0.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64120ddd6e33b82e9dfcbc754dd40568bb108dc7e030744536cde5f3e1c21a09 |
|
MD5 | 63459f3e33bfa13fdea22d3c556f2538 |
|
BLAKE2b-256 | 89fd7c8cf3476bdbf269b30cd317d36af31b6d448a505aaab0bc44b02740568e |
Close
Hashes for rina_pp_pyb-1.0.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22b822a2b908eebddad5434d9fcecce703ca465ac8f4f772d1c8cdab5e99d988 |
|
MD5 | d3fb8a3dcc95d740f4c996d4e3e7d60f |
|
BLAKE2b-256 | 92d92c60b0aa77ff6d1de25cd1a9f2a9b0d01d4b28360dff660f5701656b6bc3 |
Close
Hashes for rina_pp_pyb-1.0.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9800735cf506695aa244994900a45d5d3803df8fddaf3993825f2157df5d71a8 |
|
MD5 | 1e5fde82c5e8a56b399ebd0024b63d4e |
|
BLAKE2b-256 | b7fc434dbe834179b80628442c428816145a25c99eec0dff58a199a360850c12 |
Close
Hashes for rina_pp_pyb-1.0.4-cp312-none-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ad2aa6d36202b37aaa1f715b7573a0bafdcb179d782d344144e86098df2e4e3 |
|
MD5 | c1d18b62bcb9e99b6e7c45f2f8f30dba |
|
BLAKE2b-256 | 0e42442df398582798c8ab3c0d5cec1be3c34f309d34a48025f6e78dfd9a58d5 |
Close
Hashes for rina_pp_pyb-1.0.4-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cfc8afafe8c7ddec41ce74980240488dca6a1b529439edd9a78f8ed4f5d5ab1 |
|
MD5 | 9ebef37187bba91229d2edf2548a6e66 |
|
BLAKE2b-256 | 4ae933ba741110f72361813b295f349f0850d4111cced2053104c55610cde173 |
Close
Hashes for rina_pp_pyb-1.0.4-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a7d3177c2b7a8de670c728295a1a43ef243733be76bba89a3171f58dcd5ae98 |
|
MD5 | a2e85165b9b5f71405650606400c4fa3 |
|
BLAKE2b-256 | 76d90441525cff4dc347f2407dd08d8bc2ce0eb733b1985b1b609e48b4c4afa7 |
Close
Hashes for rina_pp_pyb-1.0.4-cp312-cp312-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c375a1e2086852974cdeb9474bec325b0f71397b20eb8b70cd935f9d7baa676d |
|
MD5 | e5b0aa91606d9d5667d7a5f8594f0c97 |
|
BLAKE2b-256 | 9579f59fda370054f4ee5d71a51d7d19c33a22fc75ccd1bc299f53858a72c731 |
Close
Hashes for rina_pp_pyb-1.0.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03f891022dcb24608a27e16a5115acc83397bc3ab86ed64623a1b7e84b21dcbf |
|
MD5 | a921c0e27618e7b69f978eae12a0ff40 |
|
BLAKE2b-256 | 1d4c2be684129ecf4946898b285088d455502766741fb86ba4cd148ab44aa7cb |
Close
Hashes for rina_pp_pyb-1.0.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 306c21dcef96843e18123e62fb7ccd901afa504a13ba0a64521f4269e81d238d |
|
MD5 | fe5384a08f3dd4b37c3593a14033d0e6 |
|
BLAKE2b-256 | 7fa4c815b4c33f7c9b0e988a876236c9090d461f4f40a5078d93f34a2083fa2d |
Close
Hashes for rina_pp_pyb-1.0.4-cp311-none-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c81601a6f22ee8dd53bb9482b612737108cc2437ac1c8637f732de920adb47c |
|
MD5 | fe9bc269ae0967bdad8bc4e5886b3cc2 |
|
BLAKE2b-256 | c093e04f8753b9e8acd832bf512db71663085418e6deb7c074ff2936e149b7a4 |
Close
Hashes for rina_pp_pyb-1.0.4-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1881439a2327b22877906b472d6a74f36fbb6e31faf6be9ce1e872f73c085e76 |
|
MD5 | 99d9abab1767b612fce173987471ea32 |
|
BLAKE2b-256 | 5b87641198f0ff5e5d66632d5a41b5ea4be5eb417cc200b2fe2a2c9ee09182ef |
Close
Hashes for rina_pp_pyb-1.0.4-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afea93a5f1a003c986cbac18d2a4565c538a8927fcef77d6634a94a68baf6cf2 |
|
MD5 | 3fcbe9a855b07e473aedad2092e35b88 |
|
BLAKE2b-256 | 4535200648be765b5b6ea204375208ee80175793cf46fb27d04a10a17890c2bc |
Close
Hashes for rina_pp_pyb-1.0.4-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edd16158a228d70f8263fbc199ac136623dba5a19020c017641095eef1659cc1 |
|
MD5 | 810529e107937e3fadd1ba0eb592ef3d |
|
BLAKE2b-256 | 50f6096067d6adc74eb95450a7f717da8beda2e0e9627ac96901b786e51e48d6 |
Close
Hashes for rina_pp_pyb-1.0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d698654c2635f7e703df1c66b713d5ed475e7c396374eeb6945ab3b495b20fe3 |
|
MD5 | 1108b70414d6b625ab98541f2cfc1e3d |
|
BLAKE2b-256 | 4cd7b72999e5d731a1520ccccfb948261030f0e9d35206c761daefd9bc329071 |
Close
Hashes for rina_pp_pyb-1.0.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b78f57ee3a37af83b8b0f77e76d2af6599c509817982664a59ffb4262e52f616 |
|
MD5 | fd8e3275cec3d16c3c41fcbc36d6a3d8 |
|
BLAKE2b-256 | cf42c2ecc7c3b6bac23cb7772319c0c3074cb8dd50924f310b82521ff5462be1 |
Close
Hashes for rina_pp_pyb-1.0.4-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4a7c88a30fa12a95a650fb1c24e4e9dff2d498e80cd65bd47fb49d165b1f7d1 |
|
MD5 | cba09fcce7a6dc91995ae90d86d6e097 |
|
BLAKE2b-256 | ab5ef3fff5013b3d9982917278f6c49fcd31772636a9bf5fac991b771135150b |
Close
Hashes for rina_pp_pyb-1.0.4-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e4bd34fd9bb7eb5f304acea9ef93eff9bc45793a9108ef9b1b31702b4dfd5bb |
|
MD5 | 9003a9f8f74c617860cd273a207d2dec |
|
BLAKE2b-256 | 3db6c778ab6f30b4fc53925b9e1752b4b5c9a184b51ef48dfbe906a3eab69325 |
Close
Hashes for rina_pp_pyb-1.0.4-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39338905e1afb6f7cfb1cec9a86ab0037722852ceae0d7d44c7ca46c49347b99 |
|
MD5 | 30668e643cbb210fbc22b2570c7e434d |
|
BLAKE2b-256 | c5424dd53b13805248d007af9aaa2937790769fe2e3dcc1573017f4430327a5e |
Close
Hashes for rina_pp_pyb-1.0.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78f02574bb442f5c915f064029fd004fbb75133fd7c37277c7b82d8b9685debb |
|
MD5 | 0b9929d481d9fd068de33248e9ff434d |
|
BLAKE2b-256 | db1a8481f43071ce83ba9578b03a320063d34dbafde51b7fab4dca204fbd7649 |
Close
Hashes for rina_pp_pyb-1.0.4-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9ac7fee81f88fa56cc70f0c2ac5fd99de66777b3c610807be866d190592ae5 |
|
MD5 | 72da00ef43462f7ef36e3348d782473c |
|
BLAKE2b-256 | 1753f2460b06610b564a58402b5d13cff5f8d1b57f358b938e3def9ebd0df237 |
Close
Hashes for rina_pp_pyb-1.0.4-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d494b0673b76eb37289ec90342e844ae4e785e50f96c883c77e7622dbc757c0e |
|
MD5 | 9d1ef8f2097aa64b99703b72bebee009 |
|
BLAKE2b-256 | cc8c49368c6bc15bae6ec559172ce1b96d04049f3f2af580d33ba4dfbcc0e0f4 |
Close
Hashes for rina_pp_pyb-1.0.4-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b950e278e0546b20d5c659b389c06874911d8ab52fab345379a1ea9f2e1c0b5 |
|
MD5 | e33c85dd444dd0df135a37d652683b13 |
|
BLAKE2b-256 | 15f0ee9020168ca8fa273435d7a4e7561148d50f9736c79c87fd22e71d18b407 |
Close
Hashes for rina_pp_pyb-1.0.4-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0937d8e368a1dccb25cb42d25f00db7eb32b21835237577879d756dd8624f57d |
|
MD5 | 1ed26bd64dc1b99431037f4c747dce8d |
|
BLAKE2b-256 | 1bac4c31d6995a2711e5bd921352b85489135e65bacdc5f7f6f73b3e44a47159 |
Close
Hashes for rina_pp_pyb-1.0.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c07a8544923789e8f16dd6d4153cbbce29f31f2437f11a258a1602dfa32ba63 |
|
MD5 | 8260885f34c1828af39bd17b8292617d |
|
BLAKE2b-256 | b65ed8310b897f9273513a9ed1f288c99471c0a776dbd0ed8c06536599887ef8 |
Close
Hashes for rina_pp_pyb-1.0.4-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e89fab2e9b9d3daeb163c6a2ba59e88863957e4a924e9c08212886580cdcdeb4 |
|
MD5 | 55a6b00e77f7eb45b9abf331790293f1 |
|
BLAKE2b-256 | 82e85a39a9c6639913c20f66155c3eba4db81a20c6cc588dec18951a68e0a96b |
Close
Hashes for rina_pp_pyb-1.0.4-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c7a8faef724091234e19b1044cbc5527e1d5bfd438d86a5494ff0a616d0a7ed |
|
MD5 | 465381aa4f4066693c005c4673a248ae |
|
BLAKE2b-256 | 2865395f8793c0f2759fe6b56768cc3d56c08e926a5de0ed349d89fbc68cc0db |
Close
Hashes for rina_pp_pyb-1.0.4-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17c0062b0a4b51499152f526d6be3832dbeff6a7bc96dcd52fac1d78c5363208 |
|
MD5 | 9d32f64f21e65bacf6bbfe9ae4ec8ed5 |
|
BLAKE2b-256 | d2df0728ec245b3a55351a7e9ad012dd10ed561bda686f6ceb4ec497d7687957 |
Close
Hashes for rina_pp_pyb-1.0.4-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3eee51cf21fc0ea50d43969550249b1d82786ec01edf57060204e87df529b70 |
|
MD5 | 92f3daeafe789e35ade26f037f3f568e |
|
BLAKE2b-256 | 0d8536c29157197c06623c18aa732e9be9f1c04736e9eef6d4f7c0f85ea8c631 |
Close
Hashes for rina_pp_pyb-1.0.4-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e631ae56277a5f06bf3a480ea5513e22d606320b408d99699d04be9ca3738b9e |
|
MD5 | cb2ff7bd4a940950699990eaf878ed11 |
|
BLAKE2b-256 | 0cc5912750d2bf3094adbced857e4c3b440cf3e1ac796b069129366706f65433 |
Close
Hashes for rina_pp_pyb-1.0.4-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b76ef21abca040c33d74fbaade8a23c83f4fef3b24e72c615e49970d2c4fa3bd |
|
MD5 | a4ddd0ea1e93c731b7efe48e2cb93181 |
|
BLAKE2b-256 | 9fbd6bba1dee77a68682ff458d04427ce49739a0a9d8d5b75ac6ac770b7225fb |