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.6.tar.gz
(17.3 kB
view hashes)
Built Distributions
rina_pp_pyb-0.9.6-cp39-none-win32.whl
(327.8 kB
view hashes)
rina_pp_pyb-0.9.6-cp38-none-win32.whl
(328.1 kB
view hashes)
rina_pp_pyb-0.9.6-cp37-none-win32.whl
(328.1 kB
view hashes)
Close
Hashes for rina_pp_pyb-0.9.6-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 601af70cfaa17edd0ff8a774299377525bec2b453f964050e24fba7e39f08168 |
|
MD5 | bbf5885fab85e4312be5580608c82a00 |
|
BLAKE2b-256 | 0a8e6d2f0d152f953c05233261b43092c258b963057c5b70ee1f4b97c48fdd21 |
Close
Hashes for rina_pp_pyb-0.9.6-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1022d97a53e21b66272cc198af1e98a6e94798426ff2b2fee76a28ee4fa005 |
|
MD5 | 9dfcc2814b723c6cffc08bbea6975fb2 |
|
BLAKE2b-256 | b4cc926fae6c118d69bb20d0524a436fdd65029f38cf982f7c9a1bc3cd65ab21 |
Close
Hashes for rina_pp_pyb-0.9.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfa54d0d2b7e10d2e22332263c8cb863e600ddc2204c7c578a24aa21a61a1f7c |
|
MD5 | cf5400924b686399c68c2bcebaa8cc2f |
|
BLAKE2b-256 | 6c3aea4e312f330d74c79c6d6e828eccf3f03552ad0e15f2955b017894478528 |
Close
Hashes for rina_pp_pyb-0.9.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dabc65050eb6ecd787603f10812cff56419df045bbacfb18cd4cdd256d35e9fb |
|
MD5 | 20eee381de8f6ccacc3bdb2c2797a897 |
|
BLAKE2b-256 | 7b2915fa69df97a7003eff75c2098d9083864ba7bc620af9dc38b7fa744adf58 |
Close
Hashes for rina_pp_pyb-0.9.6-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb561862c49890f3985cd0d4fc14ed60b8ca983cdbf83976187f7a4d6c74092f |
|
MD5 | ab92cdd6f2d4d3ad7f8d6c1e30f4a8e8 |
|
BLAKE2b-256 | faf01f94d1d68569e606c9a0d994903450f3898f3d31b332dcacc96f18aef6e7 |
Close
Hashes for rina_pp_pyb-0.9.6-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8b20cd5a9ba76e1cc4fb1f67034876c194bfaf2c441ff1d66e3f882b6c50336 |
|
MD5 | 724c5e76adf3693f1fd71646e3d77c1e |
|
BLAKE2b-256 | ea5123388e9ea0c5ed2f0a7a60a4707d7ba45d444d9b8bbdbc18720b7834197a |
Close
Hashes for rina_pp_pyb-0.9.6-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 842c13916c423c02db36e9f76d56e7d86cf525a0916d4472f3522e32b01e4fa8 |
|
MD5 | cff8994f74b8bbe07b8f0294043f23a0 |
|
BLAKE2b-256 | 50ac6128421764c75887825084deeb5fcc8e4ea4a6ea7adac87ad1ff381160c5 |
Close
Hashes for rina_pp_pyb-0.9.6-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8255fb1132d34e0ee02acf69426ed2ea3e488cab3f029a662ce0a48ef58528 |
|
MD5 | fef40dc670c0614a100af135387c5f5c |
|
BLAKE2b-256 | 21d709d334a4c41b692aa36d6341e50a85fcdd1f901a129f43c98a1ae491d29f |
Close
Hashes for rina_pp_pyb-0.9.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6797f388705f76cf10dcc63b3bd7e82ce0689902f0ec151f78055eeb985a6259 |
|
MD5 | 2d9ef9862338e281ddccdb48f3b4b98b |
|
BLAKE2b-256 | 587b6415a3e92d32afe7a094df3c39798e36f4d1d09e7a9042b87eaefeb9b429 |
Close
Hashes for rina_pp_pyb-0.9.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fee991bed2338d172feb20bb7d835f780d9893f2b07291bd035d4f1689c8e9e |
|
MD5 | d5aa0843fd43b82578d30f547e624870 |
|
BLAKE2b-256 | 2d83a00f20c059c3528847ee9531973d8b6f78981a0a97bb3b735b770a9ed7b7 |
Close
Hashes for rina_pp_pyb-0.9.6-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ffa070f4209a3768ad65b11e38259cae97a91fa2ceb2b6832f493dcf6f074c0 |
|
MD5 | de471ca5b7d2f170d9e62bd256c632ad |
|
BLAKE2b-256 | 48812f6c351cf4f5eec8cef357b16775f024cf9b57cb59b644f957255bef91cd |
Close
Hashes for rina_pp_pyb-0.9.6-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99706789641fbac5972daa65fe459dcf5fa98291516e46c80bef4fefd2d1c294 |
|
MD5 | 5ea47643198602b2c4d222a3f9a3142d |
|
BLAKE2b-256 | 97ea4a0b70b3a0b4fb139f2f6d562fd0aa722f75c5e361f0b8b5dab942d4fefa |
Close
Hashes for rina_pp_pyb-0.9.6-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edb45a25770f5cb51e366c3a82a39084ce85b120e4eb1fc50c5a2e04fee1768c |
|
MD5 | 08da6dd020b28c7ef55b28c426dd99b0 |
|
BLAKE2b-256 | 2d92a632de897aa68c53590c43ae13bf7a3e66674e5f808051deb8b356d37b2e |
Close
Hashes for rina_pp_pyb-0.9.6-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e6df7c19198b4faca29e9c75517e550ce712db3f55151f8cadba4002b7e1c16 |
|
MD5 | b01ef2d0fcce8a8632819842a517e2b6 |
|
BLAKE2b-256 | 7c3c81da9ae8f09c87ef927a1197133ac16d903bce8446421a52b114cd04cb47 |
Close
Hashes for rina_pp_pyb-0.9.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42d3115901204661f4c293a64c4999302af0440e60549c7eac6745df85a2615a |
|
MD5 | 00156a541b5dc15e4a25c0bba555a192 |
|
BLAKE2b-256 | b7305e43056615e437e08f39dfa987b92a3a4a8b42010e65821d558e0c39bc51 |
Close
Hashes for rina_pp_pyb-0.9.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64729143e01d253ef33c5bfbfec4342b54d0a853c6af58dd73523ab7b1086beb |
|
MD5 | e0265e6c83d2602dc09f049cd3de371e |
|
BLAKE2b-256 | dfdb5d3113c19ace2fa1a813a086cf1b14e794508a79b3cea178a76786dfcec4 |
Close
Hashes for rina_pp_pyb-0.9.6-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b0a568f38f34cfca5d31c22fb1927ddca01b6064aba842cc6f0d8a840b8377c |
|
MD5 | 1600b2a0c15ba8b358afffd03e162561 |
|
BLAKE2b-256 | 321f9df5a01e2dfea81f072d1e6cd401633f26c0442a4abc98eeb442a6fbb3ec |
Close
Hashes for rina_pp_pyb-0.9.6-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eefa2ee3f9b40a6a077bf7a501cfa94bd8e03d00228c043d73661a57d83d89b7 |
|
MD5 | 934a226dd54841c8229640ad4b61d0b7 |
|
BLAKE2b-256 | 9bcfb5307db10ed6bc66b7e68ca1673ceb02846c2c5086cfb6dcb90aa724ae93 |
Close
Hashes for rina_pp_pyb-0.9.6-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 463cac6201201a3fd18f23260b014b0a4e1117bb089f3882d72e82f91572886d |
|
MD5 | e70faf1ee2e10f8548f1b3022ba99e61 |
|
BLAKE2b-256 | 160c9239ea9509f405dd13eff359b320ff8232fbdd5f1bf0bd41afebd87eda8f |
Close
Hashes for rina_pp_pyb-0.9.6-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeaf98faebf993c2c99b4a8e3755f8820a67f52bf3533a4ac17619d958cf7cd9 |
|
MD5 | 543cd0d97bb3dc384eb148ca021ab6c3 |
|
BLAKE2b-256 | 5cb498b22e44a116d068de496ea79617f6e8fb25d74a965f889d0249cdabd5d3 |
Close
Hashes for rina_pp_pyb-0.9.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 707c087800dfaa63249599332a1f1a428e2d781c002bff279eacf0337d3663bb |
|
MD5 | b81b6e6f96d6d620200a3e439660342b |
|
BLAKE2b-256 | 284b7150f61c983f2bd2966a37cdd09d439a7bb8b2dfe8588cd7af71aa27970b |
Close
Hashes for rina_pp_pyb-0.9.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57308a11c45f28073730b340c10c3fca75201a4a6185d436e0a3f2abeb0da9c7 |
|
MD5 | 58f30d0ddd89edfd869c36852c221b54 |
|
BLAKE2b-256 | 5e2e820222fca8867e476c438d3d25890575885b4080b4aaf93fcd8a083c9cea |
Close
Hashes for rina_pp_pyb-0.9.6-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea0f6a88e9eb4b01596e5d7e6a4f545f04cf5f7290ab79abc453887518974b26 |
|
MD5 | 5223062c8b41103b7ed38fa4449c6297 |
|
BLAKE2b-256 | e502c1196d91d1c7476ec0928a4f832babb413e3552182c9445506ffb5f72aa0 |
Close
Hashes for rina_pp_pyb-0.9.6-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dab5622efa41db7060e118ca3cf259e17a59a7b5cd8643340a36f88ad7b862e |
|
MD5 | 9160909af453d31cbcd8f65da0bff26e |
|
BLAKE2b-256 | 65e0543f1e9200d5b56886cbefeb69d01b594e542cc7bbceb3f2dc1ddeb9a9b5 |
Close
Hashes for rina_pp_pyb-0.9.6-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 663d916d3d8599cb3c6d2b9e1305f680cfd00dfbe021a90956d15a8e6c3711d1 |
|
MD5 | 8b8062e00b61c1ebd79c2dfc6f0b9bbc |
|
BLAKE2b-256 | 4f206e70931190c09874b31d2ee9d2f84dceb1e0eda69600e41f43332808435a |
Close
Hashes for rina_pp_pyb-0.9.6-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4709a4a5e5ac26ee0efa7389d929b6b85d7c88333d8a063c15958b48134efd5 |
|
MD5 | 68647873667495f6865410bc95fe30bb |
|
BLAKE2b-256 | 337ea6d311452de530c03144a74e7380a19cea3017ade9d5e5777e70af25c6c8 |
Close
Hashes for rina_pp_pyb-0.9.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3beb6bb5b39443ede60077f86427b0cf1da5255657503f9aad437d37cef7ad10 |
|
MD5 | a7a617d57dcf2e4e276975679d34d312 |
|
BLAKE2b-256 | c9c78450c5178bf86366487fb393e65a7ab153831685de48992945c10722f500 |
Close
Hashes for rina_pp_pyb-0.9.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10eb4f869584b1cd469412327e73cee45bff49aedf944dcbded819c56b9e7246 |
|
MD5 | e58099118502303aebf0decf37dd8639 |
|
BLAKE2b-256 | 32cb51a94d3c9a6d9b8c975024e80eb46796b1678ca717a6da1dedf5a2758164 |
Close
Hashes for rina_pp_pyb-0.9.6-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 643a5afeca63a307705327017ccb891bcdc63fe09eb9af302a184036ba8f7406 |
|
MD5 | e98cf71f0fc6b308bde0dddf8d48dd35 |
|
BLAKE2b-256 | 7e8051c5ac387a5f666081c9e0cc5464cd777f655f78df50d1a65696e806c8c1 |
Close
Hashes for rina_pp_pyb-0.9.6-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd8aa6f9f88132c7f7413ff70ca72dcb51751918f963a336ccaaa22afe0d43a8 |
|
MD5 | 4ac51650bc0ba561c4ac9991e2646d41 |
|
BLAKE2b-256 | df164f39d92e935395971679e752d6cc926c1d8a7fec1129c00119527c5d7101 |