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.18.tar.gz
(25.7 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.18-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c8fd9c8d47d317579e38c7a8328210fd3009735308e661fd8cb9bd221cc1c3c |
|
MD5 | ae33e64411be4a0815ebe91ec036a100 |
|
BLAKE2b-256 | 67939150c80553179ada4319ca16de43c178995aaa6fe6d0e66b8f6a2b4998e7 |
Close
Hashes for rina_pp_pyb-0.9.18-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06e3be3e042ab6d71874121fb0c3c77e093c125cbb0e10d1b437c1b0e5e5f566 |
|
MD5 | 7fe2a0f92999146804e6b1972d5677a0 |
|
BLAKE2b-256 | 7d43cb56b70a704150cabad59d2cbf835e6852866fb99cd41155c0415109cd26 |
Close
Hashes for rina_pp_pyb-0.9.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 188673083b81b0859fcf63b2289bfa863c464d8f37f2f36532644e7686d1f42a |
|
MD5 | 9bb9a460c49a20bce63a0b57879147b8 |
|
BLAKE2b-256 | 42f57ca86427e4417f8c2a99bda2dddd8cc5ed8ebacf668c404d6db5f498baeb |
Close
Hashes for rina_pp_pyb-0.9.18-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6924f58092a2ecfb90429b9934e1c97fff7df5ea3514d776110dac758861d38f |
|
MD5 | 371b2ef34df84af302372f4ca2999099 |
|
BLAKE2b-256 | e54308345eb9535e77d3193985c6dbabb53b1f8aa67a88959611d16d477f2a8c |
Close
Hashes for rina_pp_pyb-0.9.18-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979dc894c27e8275d4a6576ef37841a83c29baeddb4d4a8542454839f8dc27bb |
|
MD5 | d2c2ad58c0d4f97e9943398abed1b968 |
|
BLAKE2b-256 | 87850240dfb84516312b183e56f0973ab1a95a59c0cf659a76297cb8da076335 |
Close
Hashes for rina_pp_pyb-0.9.18-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d5f7d4ba36644d8bf65a09baadf50cf6ecd2279884062c1e5485559ea64e53a |
|
MD5 | 699f0b26e4ae73a478db338dff853161 |
|
BLAKE2b-256 | c7ed86e7ea3bca64420245f593b8a73c8ea5b48de1c8da3057a3921e61ed9df6 |
Close
Hashes for rina_pp_pyb-0.9.18-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e9fd17c65914e676626ba66675d6f95bc0887c5e8c019dd7080bc4b2fc2e48 |
|
MD5 | b7dd3595f31b6ed4e76354f3ea780b77 |
|
BLAKE2b-256 | 78c3ed74a3b12803132f26b671e84d1cd8cfe4214e4bc8131db971f589a906dd |
Close
Hashes for rina_pp_pyb-0.9.18-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eff5cd58c891de36480c6a0b3ef8cb0bfd0e43a8fd8d37cb0e0a67c624336def |
|
MD5 | 359dcf74872a5521f0905d0c73386a1c |
|
BLAKE2b-256 | 7b9743400e934bf9075ced847d086383e529d41d73547cdfcee4c311de446a4c |
Close
Hashes for rina_pp_pyb-0.9.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 418d05f2b0dc6254233e337086e82349cdeba700fa9bec006567cee52f3b9602 |
|
MD5 | e70a4be52219f29adc0445d24b7455d6 |
|
BLAKE2b-256 | dab7594f67e1078fc8926341f6f72b2bd28c8b629a74ed766bc5a1492deed9db |
Close
Hashes for rina_pp_pyb-0.9.18-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 531555c6685d5f0bc53ebd5d1acc89c5ef70b2db4d59d4f1049c3dd6bfe61867 |
|
MD5 | e7854cf89a4bc60961a9e5ea6096b2a8 |
|
BLAKE2b-256 | 5e5b2237107ead15ffff704d1bed09047a3e657f352e939c0a76d8fe680466d2 |
Close
Hashes for rina_pp_pyb-0.9.18-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72da7e2f561b81955fddc971c9c521006f10685c6e1c620fae51591ca5cdd2c8 |
|
MD5 | 447c1afe2cf00b8a3b85904a30a22ce6 |
|
BLAKE2b-256 | 2781d2466355e0b4a0244067bc470aa763b6589bf8d03374e1b389305d3ff118 |
Close
Hashes for rina_pp_pyb-0.9.18-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82d474212545320c9db567337d2e78a3cd29ba3b2bc175e0ba151c34970fe54b |
|
MD5 | d024079e95f082da83ac336abc348f32 |
|
BLAKE2b-256 | 4cabcbe3928dca302da929c25490f185750c2ff5d6b518e1fbbcb0fcf8c98afc |
Close
Hashes for rina_pp_pyb-0.9.18-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30605e2ec1d4f3b12fca633523ea9cb6706663a8191009d4df4473fdc42cf337 |
|
MD5 | ecf2db8f0b65dcf8fdfad20267cfc06f |
|
BLAKE2b-256 | b122f2e6de3c78292567c5a73ad5d72abcb3569a41f6ea5cc32964fc993b2318 |
Close
Hashes for rina_pp_pyb-0.9.18-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bead37de51cd4906915e631503e3788483ee887ce8a00ed26f376858a83593a |
|
MD5 | 81bed8559416b2aa1be09845960712a9 |
|
BLAKE2b-256 | e9c09207303e571aa73cdc1421ff5e17367722a9f071b39e028f6dba6aa14881 |
Close
Hashes for rina_pp_pyb-0.9.18-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ef2c58a0b66840545faac440a33d5bcdcd82e10aa262d1ece7f897723b08d73 |
|
MD5 | 1dbac9d7e28ac54a67a8b84ba10bf035 |
|
BLAKE2b-256 | 6ce591d32b73aa8fea431dba5fc6725878703bde97f956f807cca538d2e3a295 |
Close
Hashes for rina_pp_pyb-0.9.18-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e7e196e9abd6f83a08bda283ca19224ea524ab3c864325fc117a364637f0565 |
|
MD5 | 91a308429bc0cf1a3abdb98867c7cb7c |
|
BLAKE2b-256 | 5768d9c177505fdff147b878f40c5058c4d24fe109f333d87c565e4b1a23ccd3 |
Close
Hashes for rina_pp_pyb-0.9.18-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a15c040b45eb82f173c1e66d9f8d3ba2c1154f9c2708b6f3ec1e7ecbdd8b7721 |
|
MD5 | 3c8a510e46bdc623c5de24e8040b851a |
|
BLAKE2b-256 | 2d149929c237dde8e6cf2cb31bb5b0a852441bf8695efc93d217ab8c432c17b8 |
Close
Hashes for rina_pp_pyb-0.9.18-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70b2dbb96c9e2ae97da65af4107c1f934751431a814a7398760e125befb998f1 |
|
MD5 | 79cbfee66153f68bcbcd4f809b6cf31d |
|
BLAKE2b-256 | f4ef8d90af7962b9f70b8da197c6c6d61068302a4b25894b4ae2c6006c5699b2 |
Close
Hashes for rina_pp_pyb-0.9.18-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 732bf5030f8e571cb9cf1c60e32d121a0c528e9dbc37a09d74686199699f8185 |
|
MD5 | 95f628181039086beef2a079ebf466f4 |
|
BLAKE2b-256 | 09c8183989095afb3dcf464001a6a14a8f75b76322fff2481deb2dd9c5cbe5ff |
Close
Hashes for rina_pp_pyb-0.9.18-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6f5c43b5daf8fa2dac0e29a4e9614a8b5da1a22f1b00070972c88c9a78073d |
|
MD5 | 622cb2a1767262d044836ea0adcdfeed |
|
BLAKE2b-256 | b6d5257419c170e5f283038356eb4fdaee1652adf044f0a4c12619fccd91b006 |
Close
Hashes for rina_pp_pyb-0.9.18-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db81f592efa7d76bd8baa7ab2f3422fdf8ef146d506a68f9c0278f04b23ac55d |
|
MD5 | 3c2a84d1894037bb6a81148b7adba61f |
|
BLAKE2b-256 | e2dd0b7adfa84cd77d536f5f7866731e7da9bc11eb1476c31be3057ba1e4b07c |
Close
Hashes for rina_pp_pyb-0.9.18-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5978ed99780e5163b69cfc24c7337ab01d5b4fcd128f5bad0201f3631ddcc4d0 |
|
MD5 | d0c56606a4518d88892b155416d0832d |
|
BLAKE2b-256 | d119d9cbec5107e41ca2dd833bdb1fdbf7b19dd34ea2972efb875e63c53f403c |
Close
Hashes for rina_pp_pyb-0.9.18-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d93456133c2349b5e08f9fbebdbc51f2625c11d5ed15d562794157fe23944e9 |
|
MD5 | b5737e64617c861c23ee31e78300bbfb |
|
BLAKE2b-256 | 1cd2ffd4bc8a9cca181fe1c7d05344fe8d8bf33620de03bd77da8d5eba992063 |
Close
Hashes for rina_pp_pyb-0.9.18-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ec8b2edd1d187cde434e0aa179db869cc76ab6ab80e40128108cf948048592c |
|
MD5 | 8aebf04d7237edf01e3306306cbf72bc |
|
BLAKE2b-256 | 47580bbef340e079a3b8358067241735475878f15a0cca669728cbe2666829c3 |
Close
Hashes for rina_pp_pyb-0.9.18-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be7d9cb26c5f04966b77e69b58e5e48bc5f18736b4014116be5fc51fe2f4da3 |
|
MD5 | 3849fc547cf560217dad321b027bb26b |
|
BLAKE2b-256 | e55a6300df2598a7f7a207fde7ebfe30ad20e744a8d9379a091abaf45c200c7a |
Close
Hashes for rina_pp_pyb-0.9.18-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 885722ffd98f0e4da3788d0c3251ce7c174934469a7e909c27f5591871408fbb |
|
MD5 | 93d27a6f91e0c88853f91cbda5b2b046 |
|
BLAKE2b-256 | 35cceeb2197542b9a9caf80a6b02de411ee4959adfea3723709806f1ae9c3c46 |
Close
Hashes for rina_pp_pyb-0.9.18-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27d82699b857c38fd67ce69e07d21da25040833b34ddf07bbd4301b946e32ecb |
|
MD5 | 2b5066e5c3ea9d678b21e9c36e548f99 |
|
BLAKE2b-256 | 6f78eb19daecb8b1d78665917a8bb685172c9f4835b7476eb84506ae0d55816a |
Close
Hashes for rina_pp_pyb-0.9.18-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0adde37b919fdf3b6b51053c66e3f2272ce57e49e16290f243f96bef8a5ed719 |
|
MD5 | a2f2a5239fbba12207864872ad148b44 |
|
BLAKE2b-256 | 6fdeddd4fde18d54f23ac70258f0506b0289d057fd2f7f434e385c6b70972f2c |
Close
Hashes for rina_pp_pyb-0.9.18-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f4529ff1f2a1823b7de97cb063e2b06bb245638996115785976aaccc5bfdaf0 |
|
MD5 | d5d875e1d77ab273553ed01be0a0acc0 |
|
BLAKE2b-256 | 9ca13fded33bf946475547f690b4cbce58f1434b2137db5b2ada48d3362f26a6 |
Close
Hashes for rina_pp_pyb-0.9.18-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4347721292e08bc3ddf6777030daa694abe2a6c92ff6f6c6d3c53352e072a43b |
|
MD5 | 2d7db7537b49bdba8b1c5f2ad6865b32 |
|
BLAKE2b-256 | 202a22305ae85b32eaaa6a40533ab3564e78b164748c14d995b5d1ed7d5dc0d9 |