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.2.tar.gz
(22.6 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-1.0.2-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0286eb2dad3d351513f9a57d797917c5db1f6e7330663489bb33fc2993b2884d |
|
MD5 | e5cfd81f900d874523542837f6b6a55e |
|
BLAKE2b-256 | fcbee202bd675a352abb49b74ed4d88e772a75cf87cf1729068720fd20bcf82d |
Close
Hashes for rina_pp_pyb-1.0.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9964d82c85297f3b84ed8912b4c690134b5bc0e6bd5859f339997e5df263ed6 |
|
MD5 | 139396248ff13d2d3a019e6bde021513 |
|
BLAKE2b-256 | c7ea215061f227639587469d42e1aaa75260c1865a42c33dcbd4334dbdfeb4c8 |
Close
Hashes for rina_pp_pyb-1.0.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10406aed5700a1a99076c4e82bad56ce7a86a40ac5f4dce9c712922d957839d7 |
|
MD5 | 4168536708230749cee352d352120038 |
|
BLAKE2b-256 | c72aa3cb9825b4079b9882110d013b5c8d99fb646ad395bc504d9f8eaaafaa68 |
Close
Hashes for rina_pp_pyb-1.0.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0f44b150039f71e4ecd638fe3e64df384fa004906e1f9d68be22e47074b8dd |
|
MD5 | 1b7d14a23af0f1c1297f1fe4a5b2b14f |
|
BLAKE2b-256 | afd71abf19173a3dae2c412b673d69faed1181522a216b531fa19d56d386fd0d |
Close
Hashes for rina_pp_pyb-1.0.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b566c266e06bcc61ec860c7902efb5e86374f20168554afc895ab24104700d19 |
|
MD5 | 964b36a80f6ab01f6a00903f1fed7aad |
|
BLAKE2b-256 | 552d761a172c152e4396ab2360784b28391296a5dd6e21f54478cc8c2871d591 |
Close
Hashes for rina_pp_pyb-1.0.2-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a48fa7c815ec1fb83ed8df1b31e6ceb92795702fa5ec88688ff3f264943c03b |
|
MD5 | cf60eb2c884a3bb304906c97ae2adcf0 |
|
BLAKE2b-256 | eac77d67e210a9b1803d4a7ce903c5519efefb5c681224bb66f5d9c1573be770 |
Close
Hashes for rina_pp_pyb-1.0.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a258567c57350043374db0e1a1e0b0ff6a7fe02c8cc8571c1dcc9905f3213b1 |
|
MD5 | 85bd69ebb9e6993f3bb90387c444de44 |
|
BLAKE2b-256 | 53269c117b503597c46b958ef15359577b3f9c7c41256860441bde633c015838 |
Close
Hashes for rina_pp_pyb-1.0.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 947933c794ae84bdd32dbd07f7f88237c50378a8b868291bda0171ec81ccec28 |
|
MD5 | ecaeaacc878b3e9ca65f478907240d41 |
|
BLAKE2b-256 | 60488949b6bac4175f777fdb2af985290cdb684b526757a3f3fbfb3f10906fd6 |
Close
Hashes for rina_pp_pyb-1.0.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2d20ea3cf6704227134e382f0000a7c33fba73024b86aff9868162bff8a698f |
|
MD5 | 23ecbd008f2b12568345b9f4e04bbf3a |
|
BLAKE2b-256 | 0bd05ba66de3ea3c409656f8c489aa4d14367bd36b8207f0da33892bb73a3b7f |
Close
Hashes for rina_pp_pyb-1.0.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4baee33fc1d5291c5dfdd4bffcab6c493fc49d7962967f45faa61908d3a7db45 |
|
MD5 | 9b0d12b0769ed599ce078e0bd4fa8c8d |
|
BLAKE2b-256 | b1a3c4475fed68a92e1241aadc45d6f96cb689e09b8a9d861820239f37343c1d |
Close
Hashes for rina_pp_pyb-1.0.2-cp312-none-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d20c2863a1640ceeef8186ca0d7649ba8046fc86ec9c1569a1b336667074ba74 |
|
MD5 | 46ec7096d09f84f8aa7251c6fb5a5857 |
|
BLAKE2b-256 | e9c4114f219f02d90d568b6f4e359380e5ecf5422460387e826da99534c831b1 |
Close
Hashes for rina_pp_pyb-1.0.2-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a48943d9e20042f40349591e737a1eea45bb4b7d6193e30db096a54a4e409b0 |
|
MD5 | d09f1d4cd0cd59f4f9395733529242d9 |
|
BLAKE2b-256 | 2e39170df92d4d6f3c28d506b97ddf96c447d2857803b21ef088adb4c711d1d8 |
Close
Hashes for rina_pp_pyb-1.0.2-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e28813f63ff6efd13aaaa6d69629458dba80b8c0b1afeacfecbaeb290be7fe80 |
|
MD5 | d86dd93bfe38c5c5aaa14ae51ed0328d |
|
BLAKE2b-256 | 3b5ba4066e41bc7041ae1fd7f112e1c9ba9e83e2c716ff8cd6cedeee011c4f61 |
Close
Hashes for rina_pp_pyb-1.0.2-cp312-cp312-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8c07d566cc347ea1de4841508fd2635135330f4e5214155e0f5f127b4595df6 |
|
MD5 | e7812f1d837ec922c1b2ac0226b4d81c |
|
BLAKE2b-256 | 5d5c86b2c8fcdff68d900724b04d077e1ab6d96a6a7c289399d37dd0661ca22f |
Close
Hashes for rina_pp_pyb-1.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cb20ace5fd03a2732cd16b02c1fe0aedc318de8a2259dd677e07e165a5390bb |
|
MD5 | a5eb996ea5760a1b07d8fcb296a51b31 |
|
BLAKE2b-256 | 0802eac00ead621d4dfaeaa246bc01f68c4e5057777293e0758017fc3888f668 |
Close
Hashes for rina_pp_pyb-1.0.2-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9548bb2a60e4eb23cc9e43707a60e246f38192f4a679120775993a0f8ae259fe |
|
MD5 | 75e6e28a91569d079e12749c43e08b8d |
|
BLAKE2b-256 | 077cf857a32981e10500106c91e35d04846eaaa236641491b7953a5c331fde7c |
Close
Hashes for rina_pp_pyb-1.0.2-cp311-none-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e1955e59673810917d53aa0faad6d1e9fc4e2b04709813d3af9924572bdde35 |
|
MD5 | a2d683106fd885e501c7eb1962be37c5 |
|
BLAKE2b-256 | 528c85bf83f9c4a27107430936526be9606b22fefe2e0b8b7ee20ca7613a522b |
Close
Hashes for rina_pp_pyb-1.0.2-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 193a3a008ba2d091ee146e4789bd0fe3fba2ca85ce64e99bee36858ee554ea13 |
|
MD5 | 094941d3ea6963068b94ecb5b018bac0 |
|
BLAKE2b-256 | 122ff10346c44d1b4d844b2c1d9afc8ece79255ecc5e86fab2a8376b887cff15 |
Close
Hashes for rina_pp_pyb-1.0.2-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbe2ea12ffd4813a096bfc9780293bdf1501f55b8eb2847ff79ae86e44c05fb5 |
|
MD5 | 98cec5309c4a5c57c6d49f89425abebd |
|
BLAKE2b-256 | e0056cd6352029000473e72b10e42cf41912187f05630b62157738953143cebe |
Close
Hashes for rina_pp_pyb-1.0.2-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e11c73694e92c78efe585ffb4e30473d9542a92cba1d1dff7b7075d056d65ef9 |
|
MD5 | e3567504a54d9053646a55bc5fd07b56 |
|
BLAKE2b-256 | 39d4bc0a332d76d5662c63d341198d93ca62f351dd79bf5c32ec9d1858af4149 |
Close
Hashes for rina_pp_pyb-1.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc1cd4257a9a8a7bfa03ac269979d2ea3a83f9db85b2a9c819e26d12e36c1088 |
|
MD5 | 1b2da496d29a33b1f1738557ae737105 |
|
BLAKE2b-256 | 9cad56d8b449c5997dd8726c314ced5edebd4b9c32b9e8ee8230aa05670adfbd |
Close
Hashes for rina_pp_pyb-1.0.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 334219150b8aad61e0ecc6a9dfa9b97953e0c387f8608d8e4e49b6a0d7a01cee |
|
MD5 | 78dae3bcba75e87bf24f11b322dd826f |
|
BLAKE2b-256 | 1415145b6152ee56e7782b241ab6cdcbe3d727c6a5e57500484f7c3f11097b57 |
Close
Hashes for rina_pp_pyb-1.0.2-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89676dd834a1e65cef99eb9e34597a76cfa2c04ca9b329e5137797e28c234726 |
|
MD5 | d06712646696df2bd8ac2762db43f5b9 |
|
BLAKE2b-256 | 6bb38c4eb25caf88b23a415eafa00bebd75bbc071129fee0b7d6567ffff76ec8 |
Close
Hashes for rina_pp_pyb-1.0.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53d70f7068a7e9f19f247ff4524151fbc2a2220550b176dc2d66881faa32d919 |
|
MD5 | 65b7f56c645490bac2362318db9d3459 |
|
BLAKE2b-256 | e379626929d2a75cd200a7b7d0f6b92717bb4c759af2ad3daa45ef7132d95010 |
Close
Hashes for rina_pp_pyb-1.0.2-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c17f4a38c1bb35cc525f19acbc3ae4a4f34216df0dcbcec720e420b805440a8 |
|
MD5 | 9688a875143c6fc61f3c92346e97aa0c |
|
BLAKE2b-256 | 4dc992f6092dae2554aa883d9db1e75b9a1c0087438bba963e26c06edcb6fb6d |
Close
Hashes for rina_pp_pyb-1.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70489b610186cd46166f7fa635b7e529456b8d006ee3e66c07063855ac328362 |
|
MD5 | 33e7f799f0f83b3f530415ae49f9d711 |
|
BLAKE2b-256 | 3bfaea2e69a53b4ebcb024880057162dbe963c7fc66f263a5ae6743e6ef61e8b |
Close
Hashes for rina_pp_pyb-1.0.2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d02d2019428f66b43b6ad4b7acb73e24115279841438daf592adf11a97df5e1 |
|
MD5 | e20f58e9867d8f55cebe854ebabbd8d3 |
|
BLAKE2b-256 | 8fa75925152fd1192b93815d51d77e841fad84c98e8a6e8a958c67ae52c13263 |
Close
Hashes for rina_pp_pyb-1.0.2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4001b25ad2aaa468297bae4a638fcc1c76930c9ac8dd8338250d1e8f5ed7e06 |
|
MD5 | afb428998e59248d216199584bdffe35 |
|
BLAKE2b-256 | adead78698ebe044a5950805474a850f72fb6ef0b8ebc8ea87b9b8e7ae0c377e |
Close
Hashes for rina_pp_pyb-1.0.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22ca7febaf61ea702c65138e41d8665d9f6c7ea1052cd0494ac3c473e60db478 |
|
MD5 | 9d2b38869d57dcc13f043101856cbf23 |
|
BLAKE2b-256 | 5de5020a826f4f476ff412276ddfee2a3be23b010c9d5a0efcea5630b6ee6d25 |
Close
Hashes for rina_pp_pyb-1.0.2-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b0bc031a986eae1044751d93d3c80ad911ffe2c8018e67182a1e6f0b11729a3 |
|
MD5 | fa95fdf46bace81137d1f0d065deddab |
|
BLAKE2b-256 | a7711119852b79f256969f0381bcc7d9633e5d3588a76a5cf3bb207e87895316 |
Close
Hashes for rina_pp_pyb-1.0.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba594f93d2ac3ca08ce82048905a52ac62b5ce6773d186138ee1c242401d02a2 |
|
MD5 | d0afd55a33327e66d1d794629d5a3787 |
|
BLAKE2b-256 | 19349658bb8438aece827411d3ab820aa75b9222405d24c1cb77068c67491741 |
Close
Hashes for rina_pp_pyb-1.0.2-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 919e1856145d1db8259aba8c9f376827559a606a20c91b2bb11d4567907233da |
|
MD5 | b0c58e7712fb52efce239c8f484a626e |
|
BLAKE2b-256 | 73a6dfc77d36de0ecafbe008793c47b44c035337b6be7894843a2c05b9ddff99 |
Close
Hashes for rina_pp_pyb-1.0.2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f2e45ed9d686e40b1a0852925681ee8ad09f2a5ee34421aa46faafb5ca20e38 |
|
MD5 | f8a7dcf22a2077e96558318974f543f9 |
|
BLAKE2b-256 | 8df54cb42ed2b6a03cf0676a605c939d635f5e924b37059acc5c266f29afa273 |
Close
Hashes for rina_pp_pyb-1.0.2-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9c5eb0bd4d611bab7687f1ebb92d1ff9d3715e07b73d1367bf03d9fef0a5ebb |
|
MD5 | bebf6e412484c572c84697cf5083c4cc |
|
BLAKE2b-256 | 70f1cd254aaf577a11f9dc0d0671b055fc765345546c9c8d469fe5d25b00935b |
Close
Hashes for rina_pp_pyb-1.0.2-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4885daa8d766d8f7419ce32755edc5ee112ab48749324ff280f11dff5382a15a |
|
MD5 | 8ca84944c6c70409581740546ebe4ac2 |
|
BLAKE2b-256 | 10126c880c454c5e0c9ef0b51c698e7b7e001bda3770fba760bd86d18bd8cb19 |
Close
Hashes for rina_pp_pyb-1.0.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c99f641da0cafc71c1bf786d1a010a88cb6ebad7b1930414d94be991b0bae659 |
|
MD5 | 400898a0d55ae2577e9ec868bf421635 |
|
BLAKE2b-256 | ef403c81d2b1de3450aeee5fc67072b9cd49c9dff7e1186cb4c364979b8bb71c |
Close
Hashes for rina_pp_pyb-1.0.2-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52d1db096f2f14897a9b1ad3390224f0c0e6c741ac18a0065f2a92936d175461 |
|
MD5 | eef643d5c9e22a304e58bfb5525f835f |
|
BLAKE2b-256 | 37833c1016171f25bd532837c5a07457024b930c6560a54a53d8357da1e5a2ff |