osu! difficulty and pp calculation for all modes
Project description
rosu-pp-py
Difficulty and performance calculation for all osu! modes.
This is a python binding to the Rust library rosu-pp which was bootstrapped through PyO3. Since all the heavy lifting is done by Rust, rosu-pp-py comes with a very fast performance. Check out rosu-pp's README for more info.
Exposed types
The library exposes the following classes:
Calculator
: Contains various parameters to calculate strains or map, difficulty, or performance attributesBeatmap
: Contains a parsed beatmapBeatmapAttributes
: Contains various attributes about the map itselfDifficultyAttributes
: Contains various attributes about the difficulty based on the modePerformanceAttributes
: Contains various attributes about the performance and difficulty based on the modeStrains
: Contains strain values for each skill based on the mode
Additionally, the following error types are exposed:
ParseError
: Failed to parse a beatmapKwargsError
: Invalid kwargs were provided
How to use rosu-pp-py
- The first step is to create a new
Beatmap
instance by providing appropriate kwargs. Either of the kwargspath
,content
, orbytes
must be given. The kwargsar
,cs
,hp
, andod
are optional. With the settersset_ar
,set_cs
,set_hp
, andset_od
you can specify custom attributes.
map = Beatmap(path = "/path/to/file.osu", ar = 9.87)
map.set_od(1.23)
with open("/path/to/file.osu", "rb") as file:
map = Beatmap(bytes = file.read())
with open("/path/to/file.osu") as file:
map = Beatmap(content = file.read())
- Next, you need to create an instance of
Calculator
by providing the appropriate kwargs again. Any of the following kwargs are allowed:mode
,mods
,acc
,n_geki
,n_katu
,n300
,n100
,n50
,n_misses
,combo
,passed_objects
,clock_rate
, anddifficulty
. Each of these also have a setter method e.g.set_n_misses
.
calc = Calculator(mode = 2, acc = 98.76)
calc.set_mods(8 + 64) # HDDT
- The last step is to call any of the methods
map_attributes
,difficulty
,performance
, orstrains
on the calculator and provide them aBeatmap
.
Example
from rosu_pp_py import Beatmap, Calculator
map = Beatmap(path = "./maps/100.osu")
calc = Calculator(mods = 8)
# Calculate an SS on HD
max_perf = calc.performance(map)
# The mods are still set to HD
calc.set_acc(99.11)
calc.set_n_misses(1)
calc.set_combo(200)
# A good way to speed up the calculation is to provide
# the difficulty attributes of a previous calculation
# so that they don't need to be recalculated.
# **Note** that this should only be done if neither
# the map, mode, mods, nor passed objects amount changed.
calc.set_difficulty(max_perf.difficulty)
curr_perf = calc.performance(map)
print(f'PP: {curr_perf.pp}/{max_perf.pp} | Stars: {max_perf.difficulty.stars}')
map_attrs = calc.map_attributes(map)
print(f'BPM: {map_attrs.bpm}')
strains = calc.strains(map)
print(f'Maximum aim strain: {max(strains.aim)}')
Installing rosu-pp-py
Installing rosu-pp-py requires a supported version of Python and Rust.
Once Python and Rust and ready to go, you can install the project with pip:
$ pip install rosu-pp-py
or
$ pip install git+https://github.com/MaxOhn/rosu-pp-py
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-0.9.22.tar.gz
(25.7 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.22-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1778ef5f497833098f325daf2870f1bba002ecf672640485e636db5f1a642e43 |
|
MD5 | 7d715445dc52bdbcbe22ab01031e356b |
|
BLAKE2b-256 | be4739aab33f5127bc5d897bcbda59b6704c26806b520775130cad6f144ec44f |
Close
Hashes for rina_pp_pyb-0.9.22-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86a7678d32fe43e563998a04f522dbb4b27f889925d63d63166f35a653d2258c |
|
MD5 | 0c1486a31a87aa111f4bfef678524bfd |
|
BLAKE2b-256 | aee1dc6811c5b4495ddf64c9b54147a14c82b7a852df3ee5c3d3bdae91f0537a |
Close
Hashes for rina_pp_pyb-0.9.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccd676a4972ce25b911488be0fb20130d89a8131bf7f4f1cab3fb1caf391777a |
|
MD5 | 84300ecde8950f511d72d55dba7b2238 |
|
BLAKE2b-256 | 1bb9d93db3048f9f3af4e704fb1b416d6020b7baeeffa2946d2fb6bc3ce36b58 |
Close
Hashes for rina_pp_pyb-0.9.22-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47808f26f966467af2ac9df6a8c0a1ee6f83902fbff0ede99c1440e017c7b5d1 |
|
MD5 | 1c476714984449b09128a498e3fdc360 |
|
BLAKE2b-256 | 91cfc6db8cae603edbe30c3e8f4665c106ab9c5dfac692f4b6d9307ad63a61b2 |
Close
Hashes for rina_pp_pyb-0.9.22-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be6c49a0861858c22edb0928fffe64ca2dc6851d7a8acf4be0619e12cb95b19b |
|
MD5 | 67da0cfb3921230bb317c5444f0cc77f |
|
BLAKE2b-256 | fc87f97541af3b744dc5551c28b1266a8277f3c1e3cdd93476f881ccb5aeb6bc |
Close
Hashes for rina_pp_pyb-0.9.22-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f19247e3cdd339ba4937590cb8bcff21cfd87fc1704cb19aa97fe6d20d5b902e |
|
MD5 | f25a14cfc05abb367869dc5d7a36b573 |
|
BLAKE2b-256 | 5943e02c534d3ffadc572e1828c25c5d313ef534312ce96893113d061ab7f14d |
Close
Hashes for rina_pp_pyb-0.9.22-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe69beb7b42463d1d8a64d7421023ce05eacc903dab8f68ba5d0ad940ec9ef41 |
|
MD5 | de3c986bd67d31eaa4df27292ef397aa |
|
BLAKE2b-256 | 225eb0047f0cea33a3dedacdecb4f18f75bee86dab7d48f0ab54449e693b3567 |
Close
Hashes for rina_pp_pyb-0.9.22-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02180cdf0af52021e3cc2aee2d58613e2b2db0a91754603895acefca57ecb701 |
|
MD5 | 9afa72b2d466731610aefc96979b4f3a |
|
BLAKE2b-256 | fa80480b51e60026586811b26c0962abed416be9a6c7cc7bd659af306e6e84de |
Close
Hashes for rina_pp_pyb-0.9.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a293626c4f5672f926220959ccf269d384220e363ee20d157e0edd1b733d8af6 |
|
MD5 | b655226c295ddcae959aa74487869a91 |
|
BLAKE2b-256 | 1ec6ad85b9a32ba58f1f4bd96953d77d36c1285d363838941068f7eb9c408e47 |
Close
Hashes for rina_pp_pyb-0.9.22-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff21515051794afd22617ba7b9b58b02b0f6d04dafefe3b910aa0c6624cd0aea |
|
MD5 | 9fa1906db6c45a04493c64272ae40bc3 |
|
BLAKE2b-256 | 5d41ec6cba961c6291e0d685fa308f559b2942570829d3ef118ee24401da2fa7 |
Close
Hashes for rina_pp_pyb-0.9.22-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d65bba3134b1124fb29c5912893967c508afee2d2d7b56aea58e7add52a5208d |
|
MD5 | 036d13fba5faed6f7c19f92ed8ff4eb2 |
|
BLAKE2b-256 | b9b8cb4c0e274d8f64f2a9ca56f7fc1118e08e12ec70101fcbe7b77d14fa1863 |
Close
Hashes for rina_pp_pyb-0.9.22-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 862af3f7db06360e8a89a7c0726a19ee8e93336c3d1fc16bd2360f2d16515840 |
|
MD5 | e5b768f49e44f92485be80a67577ce43 |
|
BLAKE2b-256 | 0405769f9d7925c5b170ad889bde15dae11f6c64b015ce668cba5e225387956d |
Close
Hashes for rina_pp_pyb-0.9.22-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 122ba65e80fe7cb5823842ffd07a491affbabeab89f18058a97146cff4c55abc |
|
MD5 | b0147a1da90aa1ff56ebdee486e59093 |
|
BLAKE2b-256 | 1233c3b1662176b4e54783a86aebad8eb4ce9be990219c3de2ab0365751fe80e |
Close
Hashes for rina_pp_pyb-0.9.22-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a41a8ae921f6c6e81529d717c4324442b71a2c01c5ba3c54577fcc75d0034a3 |
|
MD5 | 9169d5f79bad0c40d9d09ebc8972a07e |
|
BLAKE2b-256 | 4647e23c8174baa82deda7bdc0612c21ebf4fdcaae11f1c6c309daae48642b62 |
Close
Hashes for rina_pp_pyb-0.9.22-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe1bb85b199112839f6c8dcb7aa6ed78c2023faf58166f49e39b1c17ce275616 |
|
MD5 | 0e7247cad123eca1884bcb8887ac5eef |
|
BLAKE2b-256 | 0203c2e414dce155fea2130a9010a1dec2431ec909eeab51a7efc61c1af63775 |
Close
Hashes for rina_pp_pyb-0.9.22-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54046e3501ec14ddfcabb41a29477d5d95f939e109cd3470b9b3c01f5348e58c |
|
MD5 | 27a456e21aa735fd65b077e41c5a4594 |
|
BLAKE2b-256 | 3179b9259d0aaa6104166990e981e34e46a127f37e51f1c6d1feb29f9c29e380 |
Close
Hashes for rina_pp_pyb-0.9.22-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dce400bccd318c0ea94a0e9df9f10e355ddd8be8e134498271ed5fb388c8792 |
|
MD5 | 239b6dffad7869d6df1bae1f4052b53d |
|
BLAKE2b-256 | c9d0768d5d626000d1866a201f9b5eb89830eb87bf3500fbf7e2a01545f00a4b |
Close
Hashes for rina_pp_pyb-0.9.22-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9fa0acd82aba73ba541e26a4f0e45259897677f89db8c6658ba7f342432734e |
|
MD5 | 6ca5742def2dd664eae4c7c46cfe378f |
|
BLAKE2b-256 | de62400fa2765a1f75e0fd05d90fe6d2c4657f5942068c63e939ca4a940975d9 |
Close
Hashes for rina_pp_pyb-0.9.22-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edfa136edd4abbbd4de6fd272196aa9bca5d79eae45e304196368a4fa44d1084 |
|
MD5 | 34f09d3ebee4827f5b5cda676ed357e6 |
|
BLAKE2b-256 | 858ae62ab2c508e57618858f89ec2a7ae07b38a740b31148886aefd9b979ab59 |
Close
Hashes for rina_pp_pyb-0.9.22-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d8d8a5b6f2ceda265b944374add56358420c4b19d566cb53c8a6a76fe9e5e5 |
|
MD5 | 062a2cadf532bd5697d08d6b82e92b07 |
|
BLAKE2b-256 | cd93976216cba7c77dafbd2b64f605c1630fb89fa7fdbfe52824fdf48bbe111f |
Close
Hashes for rina_pp_pyb-0.9.22-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e4d1ed334f504581e34baedf763e82fd753173c028948f83ac26e79d30a55c1 |
|
MD5 | f1e3c96d63129abb2df1827f1833e687 |
|
BLAKE2b-256 | f7125ef5ee0d65372e3d4fb623df7a93cfbd4ee9af8a9b0044b117e309d5465d |
Close
Hashes for rina_pp_pyb-0.9.22-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fc4041e31bd5b414a8a0303509aec5ff930d2e959a3a3e9e04c7b8736b9f317 |
|
MD5 | 82442367d542690e7b82c0d074d32d72 |
|
BLAKE2b-256 | 5cd647f9eecec20dd08c1770c2e6ab9b4f00ec7aa6be60790271e82f08b7fc14 |
Close
Hashes for rina_pp_pyb-0.9.22-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a62bf6f830ca21f1493af4b8d7051e1dfd25d5df686689e00b662ea3f166c9f7 |
|
MD5 | 6e51e6da86d20460a5c1c31331cde127 |
|
BLAKE2b-256 | 8bf8237006b97666c1f439a825917b8a2a9608cd725e0168595da9a831a8799f |
Close
Hashes for rina_pp_pyb-0.9.22-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24be544c417c949ab9d99df1c16bf6b0591cebc6dc748fb3fadb20794fcad01b |
|
MD5 | cd3edb19ac91bc5291af0324b6578028 |
|
BLAKE2b-256 | 41673082d8ad391bb5c715f6d54bbcf848a7cd03d26d133c7c5fdb9960f0a9a6 |
Close
Hashes for rina_pp_pyb-0.9.22-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ec2218698037865410535527a1fb5759062e956415d7f7b394b0d24f9e165ef |
|
MD5 | 824eac3708eb5b2c54c41bc670fe9d43 |
|
BLAKE2b-256 | 60dc23a0d7cd62f6d92e57e11bc1d0b20336628bd6e6cad35ab703364e9e8bd9 |
Close
Hashes for rina_pp_pyb-0.9.22-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb05798dce376985d58fb37e113be73606bb559ff5a785aab8ae7b082c3f7af |
|
MD5 | 632a0f65c038f3ff6c42b192c2e547f2 |
|
BLAKE2b-256 | dec17194d82348213230ddbeb9fbe50fa0af4c45b2493610674153641363a1ee |
Close
Hashes for rina_pp_pyb-0.9.22-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90332dde0ff4b582922b6058f03e8c134e3dc4d1b2ed2721070b187a2224878d |
|
MD5 | 1dcb4ade3524848d90f93d097bc942ee |
|
BLAKE2b-256 | 65018c14bf0ad1553b92b647b3f6e98d8fda10d3bd2c882cb103498cf77c224c |
Close
Hashes for rina_pp_pyb-0.9.22-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 306993396d2dcb9165a45e625b4f95a004497076fc0c1e375d54150926d955f4 |
|
MD5 | 1f1d728738caf07a19da905b80c9ebbc |
|
BLAKE2b-256 | e7cc7f9f614c4f2d78f2f9f01aab873f9a815022b455163851bf687a521d64d0 |
Close
Hashes for rina_pp_pyb-0.9.22-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9de15504b76fbe9c03d1a9175d7978ab4946e456e151953d806bd02f1d0ff07 |
|
MD5 | 2fb38e05877ad3b7353d67d50b4ea80a |
|
BLAKE2b-256 | 47ca46164fd5734d1a79d8aa993c802191cc85cae6e66f8bc76ee4a36a092550 |
Close
Hashes for rina_pp_pyb-0.9.22-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a170123a3e589ce1dd2d2336539f071c8df69dbe52173aa8fe2143a464411bb |
|
MD5 | 243f7be1732c1d86c5d03080a5ee94ca |
|
BLAKE2b-256 | 2e60e472744284649045c80f5ab528fd7c064e0c4ddf223e32049d1811aa5317 |