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.8.tar.gz
(17.3 kB
view hashes)
Built Distributions
rina_pp_pyb-0.9.8-cp39-none-win32.whl
(329.5 kB
view hashes)
rina_pp_pyb-0.9.8-cp38-none-win32.whl
(329.7 kB
view hashes)
rina_pp_pyb-0.9.8-cp37-none-win32.whl
(329.8 kB
view hashes)
Close
Hashes for rina_pp_pyb-0.9.8-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79b20cd1e221df9c103dec09315f5b4ab77cb1c6bc3e879e834d5fa392c4d384 |
|
MD5 | 8d068b7739fe10d424309830f35f2ba3 |
|
BLAKE2b-256 | ed0164e155dc274fb3f28c08549d49ad43e28df1da8620df2f4a5f13c4f90f90 |
Close
Hashes for rina_pp_pyb-0.9.8-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60707192773602ce3c32276e0da2d80209e5b3a9cdb90e3eaaf9b5f998879230 |
|
MD5 | 636c36bfc28aa98292a88254056b9e2d |
|
BLAKE2b-256 | 4bab321d1d332bbc4517ffa520ed2eb6e7830c93e677ff98169842115a3c5fa2 |
Close
Hashes for rina_pp_pyb-0.9.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e034d318061dc264327f758cdecbbc36495ed00006b6db338afe764e6ae591b6 |
|
MD5 | 603865f30329d99df1746a8369d9bfdc |
|
BLAKE2b-256 | 706583696f737485d571e8beec3cdf667bf998b9a1273bd8d16f31131705eacd |
Close
Hashes for rina_pp_pyb-0.9.8-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 713b786ff16c0ba0fef6976d20007880632af68be9227ab63f3fe788ecf067d0 |
|
MD5 | 43a26bf60b75a4718e0d7158f18f931f |
|
BLAKE2b-256 | 806da220eb022ef91b1d53d4cb80d2017ff1a3c1519c49d4d54984a918401d83 |
Close
Hashes for rina_pp_pyb-0.9.8-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c10da03cf50c236af56d8999b8e0666f6dfd629374f7df97efcdd87d940f99b5 |
|
MD5 | ca89ad2074a2d6f20befd6fd26e2e16b |
|
BLAKE2b-256 | 02892b79acc43676ec27215ace40609fa3204f6784916337a3f4b576417eae45 |
Close
Hashes for rina_pp_pyb-0.9.8-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97ef4bf4e7bb56bd1d466d0ce211571834289d3eb3b8f26ca63b1ace9900d685 |
|
MD5 | 85e072fbb8d4b82cfdf261685d1807c8 |
|
BLAKE2b-256 | cf20f131c55d5b426eed8de393a86d9dc3021cb4c898c0beb449b3e9779d5ae9 |
Close
Hashes for rina_pp_pyb-0.9.8-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a79da7143fff48d8cc2aa09e6a232f382c92c72298fad71c90bfdf4824dd8f27 |
|
MD5 | ac21714b9ab9cf7426b81ed89c2020c7 |
|
BLAKE2b-256 | 9bfb6688ee41bd193f8c9e7b7192fdf03af6a808bf2e4d892914ba5e9121bcbb |
Close
Hashes for rina_pp_pyb-0.9.8-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa576724395ac1333f6dcea5fc79a6710394e514e9244960181c1dd1d6188940 |
|
MD5 | a86b0fe4938e6a38692e41202bf800e7 |
|
BLAKE2b-256 | 7cf3ed55bdaad3cf6a8a301819e40d510e58a1fe72459c658da8664fa0fae434 |
Close
Hashes for rina_pp_pyb-0.9.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c354bd79089265bd3693c0def7d627563c1411651f228c7d686ce6af62064c |
|
MD5 | d6c04ec2b7243f804e8b2b052a26637d |
|
BLAKE2b-256 | 8206476e6d19f22cdf7fbe43e07495147bb94554d2c444cf7d3a68a3d301eef6 |
Close
Hashes for rina_pp_pyb-0.9.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 867c757bfdff26cd0fbcadeb2092b9b6285626516c1f1588bb2dfe128264214e |
|
MD5 | 2dbb73df5baa7c546fd918d949c8ccc7 |
|
BLAKE2b-256 | c9a5bdd143eaff4529ead932534c4facf3fbe9468339c5b74e6ba5dba5b442a3 |
Close
Hashes for rina_pp_pyb-0.9.8-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d901ce2bf58e15bde02814fce16d93f9f51eb25972db86946708d07d4dd7b5ea |
|
MD5 | 5b1e6c1166886a3109c95be28090dadb |
|
BLAKE2b-256 | 55ba9f7c93c3269dc675e78b79554f2bd94099c23f65cdf1fc51a4aa280cffcb |
Close
Hashes for rina_pp_pyb-0.9.8-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ec203b85dd0c0520f31407dc0e94332519595746f15ddfd5156719cf1dad5e0 |
|
MD5 | c5ac2bfad6c4abb0d53802db67bc4bae |
|
BLAKE2b-256 | 4e41c5eacc39d8eb2848903d718185a54b157c8a2429bd2bf4da463bcee7a448 |
Close
Hashes for rina_pp_pyb-0.9.8-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b21f151a45cd77e4789e145f5426172e2e30848cef39645256a6e30d9292e371 |
|
MD5 | 0e4ab66b71c6ff8c6f3a19b24b1c70e8 |
|
BLAKE2b-256 | 5ca6d08af08624efc6e1bb6be705481523474dbce7a8cd5cc49a781848f28280 |
Close
Hashes for rina_pp_pyb-0.9.8-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af71e05b0cf00d944151dda2faedb71c5acb935405868254a1043e1cd580e844 |
|
MD5 | b712e86fab62fa38556b030d663916bb |
|
BLAKE2b-256 | 35facbe4e187a5d4bdf3186f17a3f4a27de0c61fc15e362654aae677b69ee6fa |
Close
Hashes for rina_pp_pyb-0.9.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6d54e2bc8e3a583adcbcda5ccf2eb9cd07a7ebef04d8d2b87696edd48cf596f |
|
MD5 | 4cc66c42361def601ead3baeef69f204 |
|
BLAKE2b-256 | 627b9be6ef9f0291f7d02d2b50ed1a8e580f3d056f75e2fd37fd53111e2621b5 |
Close
Hashes for rina_pp_pyb-0.9.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb36e90d6f765d8c0a5c2c0226255812617de5604c428c3a6b82a6b9181f643b |
|
MD5 | fde712bdf2fa8700c977e4e1a04a1416 |
|
BLAKE2b-256 | 07fcc513879ebbf51bb4ec41f91b64579e6ae21b8ea00a5cfd15a0c97bad075d |
Close
Hashes for rina_pp_pyb-0.9.8-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b38b060d9bc8061cd41b20993aa750ffafab7bbacaeb7f5108551f5a485e105 |
|
MD5 | 8535fad1d38545bfda9bd176f7c5f37b |
|
BLAKE2b-256 | 45546f74e2a938abaf5f655730ae8423b76a01d59b56d91abd730ca84e902464 |
Close
Hashes for rina_pp_pyb-0.9.8-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34c7d8d52ee279eb5aab869f4dc84c5569e964a5113633317ff87e6b4ae89a22 |
|
MD5 | 6e9920c9257272549d2595a71366a2f4 |
|
BLAKE2b-256 | a7aeb89b520f84ae5cb8b03c256e3c73009bb30282f7fcd82f68971dd158b522 |
Close
Hashes for rina_pp_pyb-0.9.8-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b302464bc2633c6d672f21ed834cc752def27f51f62a57cb1bc489ed96793151 |
|
MD5 | 5b3192849f7d6f06927d3bd133c21945 |
|
BLAKE2b-256 | 65cc74a1252dda3b7a24037bce95d85211ccbc760128a8ac16e637dc6f7433cb |
Close
Hashes for rina_pp_pyb-0.9.8-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 826579e9134f93af9a1c004258b8669e53959c091b50a8e9cf8aeb66fc1599d8 |
|
MD5 | a027f705cda84f3e537cf0da8ab4c641 |
|
BLAKE2b-256 | 264368dc16bab846eabf201dd65255521908edbf6a80a5040e5e74bba93923a3 |
Close
Hashes for rina_pp_pyb-0.9.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67c6b92d8584dea002f26cfce6e04ad2021ff35895d741cd3990cb5854186720 |
|
MD5 | b702f5406c0ddddaa19d739f2279c376 |
|
BLAKE2b-256 | d5e2ddf2a8734ee5af42fb3980fab65c9866bda0bb0ff754d12f3865f039b2b3 |
Close
Hashes for rina_pp_pyb-0.9.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2d6131f26d84c2c586d322720b92ba27c31259bede7e9088bfab773e82bae17 |
|
MD5 | a36a9b85986400615c6f80492737430b |
|
BLAKE2b-256 | 7d3d67fe94c94125ecb195c2aace7efa6ef0753fffee99fbcf8cd9fcf2c05dbd |
Close
Hashes for rina_pp_pyb-0.9.8-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c699d8b93ce7b56040f142fdd279a9440ca33e36aabb009bd872c9255540fbb1 |
|
MD5 | 3ba3c992e0d059d0bd4c846f54938ed7 |
|
BLAKE2b-256 | 8f2ca5b3ba5c1442e73b0ba71acfbd4ddb73950faa3c8d4ab4ec397a6f2679df |
Close
Hashes for rina_pp_pyb-0.9.8-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48176c240a9b901d3eca90be88e84985592979605473889ac85dd9f6a367a8ee |
|
MD5 | 464410b48a1cbdbbbe2501a540fddcc8 |
|
BLAKE2b-256 | aa2f23c5b7b5adb32feb886d550bdb44e9da5822a2c00c95f2fbd880c5e52e47 |
Close
Hashes for rina_pp_pyb-0.9.8-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7fefc46aa9d55e62f2caefa36f0d3d8c57dc63e77fe5601533442cf3bfac9f6 |
|
MD5 | 9a62877ede844aea98012c72e282935d |
|
BLAKE2b-256 | 7b21ad901fd630274bec5bdd069c4826d6b69b4bbdda6f3c344b9464b4f9cdc1 |
Close
Hashes for rina_pp_pyb-0.9.8-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b6bc0a9455d58f853db70fdc39b86aaa4168be303ebc050ea3e95605037f478 |
|
MD5 | 6ca6eb84c173de5dbe88c5f402f97175 |
|
BLAKE2b-256 | 7eae7c357d8d1032ca3968694c8da08afe5ae6db8f4bb29935aa4566cfa1f3d1 |
Close
Hashes for rina_pp_pyb-0.9.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db2043e54a27bfa59e5a951499a4fe7eacffef4ed7bdcac36ff1962e54bf180f |
|
MD5 | 1af0b1e5829e31298cf29aeb0b999a71 |
|
BLAKE2b-256 | 3c0c7d3526f10acf7c23e88de98e3abea20947b817f754ff70c1d6740150148e |
Close
Hashes for rina_pp_pyb-0.9.8-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c38413112fa2895bda833cfae2ed381aee06c7519be63320e05aa3d1c83ebfb |
|
MD5 | c15b82002538a6e7034f98efd9df14ab |
|
BLAKE2b-256 | bec207fceebc1c978936cb245e4f4c1a30520a557abcecb94fb91b44067ef2c2 |
Close
Hashes for rina_pp_pyb-0.9.8-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e4dc0b71c46f3923ab0e6a39e2faf014a8cdf242a9749693e7ffa347c3c9ecd |
|
MD5 | 12675c094479b4a574f659b3bf91665f |
|
BLAKE2b-256 | 44c369b8fa7e13bb9d230be72835823d17f8c4fabf95b328eb7a686cf5c124bf |
Close
Hashes for rina_pp_pyb-0.9.8-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f1aca531a8f5af1e10092b13bafad8d8590261223626c7f97a232b7be54f05e |
|
MD5 | 071cc653c909f184c95430e55b4cb92d |
|
BLAKE2b-256 | 7c8ee840c482cd30b147b4e5cd71db9b1fe73e197e0a1fb2119b4a053259ec4a |