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.19.tar.gz
(25.7 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.19-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ff12108c9153e8736580a901904373eb596e7c573bbe3be08c4b742aaee7f72 |
|
MD5 | f92e2bc9887300c1189919e798581111 |
|
BLAKE2b-256 | c108c6b28a8660e9d894791744b7a3d54df4b43718534a7031f9828c8c17e724 |
Close
Hashes for rina_pp_pyb-0.9.19-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6742d8d190269f0e5829d578bd4ae12ad048e1b3267f9678925dd235e54cb739 |
|
MD5 | 2a7d185fc9fc42229ec9efcf64da1206 |
|
BLAKE2b-256 | fae3fb610de3e752d6f806346eb506477badcb2f5ac8f082158c0a308da68b06 |
Close
Hashes for rina_pp_pyb-0.9.19-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86f6714a11cee572263cc0bb905816044ccbd39927d2574968b5ecf86715ffea |
|
MD5 | a317fc1298cd57015580d8d5877d4925 |
|
BLAKE2b-256 | 0f55c5676a0d6d59942d2056b15691d1d5f42cc584ac15de9486a9b97534d87f |
Close
Hashes for rina_pp_pyb-0.9.19-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39e7428e2ba6b6c34becb937c83d809260be3a05c45a699a7323b1115ba18640 |
|
MD5 | 2a1e05175e45e6f2b98aac6249705504 |
|
BLAKE2b-256 | b011aa6cc26c53b2cee3ac71cae39ccd266d5ba1a63835fd94c4e20bdea26eb9 |
Close
Hashes for rina_pp_pyb-0.9.19-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c1652f16e39fc9a0605e7d9405e9dba1f67745f0ee7686395fcbe4da59f654b |
|
MD5 | ea3ef38fcd033265ae20cdc9afb428d8 |
|
BLAKE2b-256 | be362b89bd8d7b4214eb12c832ba28c7940e1da800137c7ccb7854ef3e521e12 |
Close
Hashes for rina_pp_pyb-0.9.19-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 646411fe39c6c2aa1bb40cd3e45fd64420887a2e144a1738879839ed9d502563 |
|
MD5 | 4834714a0749cc0f47c21c351693f2ee |
|
BLAKE2b-256 | a0cca354c21506bff371445aa000fef59c88acb49871c098c936ddf876a9a700 |
Close
Hashes for rina_pp_pyb-0.9.19-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f6a8da195a6ffd76c3825c8db9106d98566690e6a8b58d4c4b41de38a67a70a |
|
MD5 | 08e21b2d20fa28698116bfee19c3a977 |
|
BLAKE2b-256 | 4ff107a24152cd764d05e4e130ea65a0df4a2401f66e27b1e31eff3fea67a4d5 |
Close
Hashes for rina_pp_pyb-0.9.19-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 761f64b22f820efa5b43cd22eb5c63ac964ba768c115c240bda9d7e454477235 |
|
MD5 | 004b07653bedfaa09f81ccc92455bc81 |
|
BLAKE2b-256 | f3c2a72481e6db0b80c90c83191160c0563d798e89a557e2f1f14ea414f1b627 |
Close
Hashes for rina_pp_pyb-0.9.19-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59a5068b3cadfa180459fd96305778d6bd8c8b31e4ce61b91a2d1a8e2a67a7ed |
|
MD5 | 420bb3daa271aef83d8bac07d1788176 |
|
BLAKE2b-256 | 8fcfbd154e4c3f72cd97200e647efcef2145efda545b158e9e1b2564c9f029e8 |
Close
Hashes for rina_pp_pyb-0.9.19-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c4fa515d1f8fb1cfd50f9022704960405865e646fbe8cbf75940e9da7e75e56 |
|
MD5 | bb3b5b428f46c564785db3caffaa8d57 |
|
BLAKE2b-256 | afc5df0d9061e3dde6528a4b08e7b1d122476aebd31f04216b375dac813d03d2 |
Close
Hashes for rina_pp_pyb-0.9.19-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc8f172863880fbcf3a6d05856f46bf81b748cc1dce8c3c55ed42efa3424e7b2 |
|
MD5 | 6867365251b83071e5b76bf723723cd5 |
|
BLAKE2b-256 | 6e8b42b259364e332f22a82a3dc011c81e459be65f5fe9ced60642fda0eade5a |
Close
Hashes for rina_pp_pyb-0.9.19-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03da6333a9d446cdc421ee75cf496ff8fd3c3b407f1298c4696183894cb149a6 |
|
MD5 | 5b55ef13138ec47b1ae9b0413e15b869 |
|
BLAKE2b-256 | caba6bf288ab304604681fe3bc4ed5c04b23cd8580f5352dc85b11e3516b48eb |
Close
Hashes for rina_pp_pyb-0.9.19-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86d8d5835837f73b664e885fe3850aced362e2f0085a9e5132a3c1bae660640f |
|
MD5 | 7df83310137fa24a0e5e67aac2e44260 |
|
BLAKE2b-256 | 7cdd6363b42f48c8d3b5151988cbb3a236a4ad6206ea9033a06cfd544454cf1b |
Close
Hashes for rina_pp_pyb-0.9.19-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cd8ed243d2747f0c4a73ead6550deee8e789ff6e923fede9c36b8768207fbf6 |
|
MD5 | b21a8147cf620d47af128f37fbacbd70 |
|
BLAKE2b-256 | 2f24aa354ea906f984ca48468e93fde58bd3ebf1a0f621880121e483d871ed81 |
Close
Hashes for rina_pp_pyb-0.9.19-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a995bd3998b2d18fe87c8048c5696c1f71e481837dd678e029df615d712a5024 |
|
MD5 | 1e96274170729d8152efd338f1e37e14 |
|
BLAKE2b-256 | 3cf5ef6a4d53ff91f9477994f0e8adc7740c21bd9a2a35f43f316539b29c5dc7 |
Close
Hashes for rina_pp_pyb-0.9.19-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f90766bd0656d70a06132233c896e35c684317867ce6d953838bd97635757d43 |
|
MD5 | 25b836729c1c049ba20eaa14c0bde92f |
|
BLAKE2b-256 | 985456365c6df0ba9ff11fb811126437d822522a4447b1f4a2e5235cfc5adcca |
Close
Hashes for rina_pp_pyb-0.9.19-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa8b838730f552a48ede2290ca6b7f1ef978ebe31bb88490159f493e50648164 |
|
MD5 | d6df3c59a2a5db6e70bc2bd871f50513 |
|
BLAKE2b-256 | 2251279d6250e2f902779b642c5991dc7f8390fad8d5468e7a1ae0a90236c857 |
Close
Hashes for rina_pp_pyb-0.9.19-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2a454d1f808062ad87a3b161b4af50b7a5048d7beaf8a3556f0c9449a4cb68 |
|
MD5 | e7035ae41fd085a274049fc22e4ea70e |
|
BLAKE2b-256 | 92f20ca06f6d890a83998a6d90e118e3d36b6a8da90bc67aef24d11c0f23aca3 |
Close
Hashes for rina_pp_pyb-0.9.19-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 115af2a352ad5f54d326c778265b1f3769ec29d798220193d3d4200db2c38833 |
|
MD5 | fc49593b87e70a9c5fa0cc2d61d2eb64 |
|
BLAKE2b-256 | 3bb6e5fd458724a1086ba45f096b42e4476f629fecd7fbde07c501bf832be6e7 |
Close
Hashes for rina_pp_pyb-0.9.19-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dd799399d956b47838a9c0e7de984d1e65f766bedc357098ffd40878eaa05ab |
|
MD5 | f0659745ed7051b1569388cf7f63bf5b |
|
BLAKE2b-256 | cb7ab82238f72bdf82060bede604702d3029de6dd2b466448ee43ddca04793e7 |
Close
Hashes for rina_pp_pyb-0.9.19-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a8404db23c3b3c1fccbdb9acf942b1d906353bce9901292ac3dae7af833f005 |
|
MD5 | 42d3a05f45b0e3429d843a7ea707f233 |
|
BLAKE2b-256 | fa622a9d2748131a59a352d5e3ee34820ed037368f8a264fc318f6208b9a0a76 |
Close
Hashes for rina_pp_pyb-0.9.19-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69537af4ed1171659dd8d0558bffcbc29be41b3962df5af3820f833d2a9d9698 |
|
MD5 | 34d5c3ec09af10e782a73a5fecbaafa5 |
|
BLAKE2b-256 | 323f6ed087bbe81afb0963bec4cc1ce3a86d3fd5d74ce3ae5fb012dd2e125087 |
Close
Hashes for rina_pp_pyb-0.9.19-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c63618341edc5ce371bcbe11628022fb79bb2c8a34d20743a1cf6c24360e452 |
|
MD5 | 3a9840516ef6559adfd3dbf8f1bc784a |
|
BLAKE2b-256 | 2b41bd4eb19d35e644dc770c8e5d0c23c573a954ffedcbdff023394e44fcbc4e |
Close
Hashes for rina_pp_pyb-0.9.19-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7227fd9486af2be2554746c049619a197e70599fe015e7caa088c06f32aef6e3 |
|
MD5 | 2854294bb306cee91b73e4e3124abbfc |
|
BLAKE2b-256 | 5a4dd80a6d29c76032c378006dac6be8c1d598d96bdb0fe3947bb87ce872766c |
Close
Hashes for rina_pp_pyb-0.9.19-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fc1a6a5bc7504e9182f3fd2bb062c7d906d8f15a22d9a6cad5d40c6ebf2199a |
|
MD5 | 7c9501d4fac8d3492fe820ffa8e1b26d |
|
BLAKE2b-256 | 677d5d3dabae8cab277dcf5799e90eeb99e9bb9a9ff671088d1dc9e434f1c1a8 |
Close
Hashes for rina_pp_pyb-0.9.19-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d68eada7f0eb6c44417c07c8ba103d8bf0ac207989878eba1cf60805f784cd3 |
|
MD5 | 93e6c8fc8670a1b73f42d0a1230668f2 |
|
BLAKE2b-256 | 4e10224d0122fc8da7ca7ee104d3d3a793d478233cf7b7502559d5f5c4b8fcf9 |
Close
Hashes for rina_pp_pyb-0.9.19-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f06c20fe27f8d37ff5d38ac8cbf55f60207cd2bd8da4db0dca73f06a51abe516 |
|
MD5 | e84d49e7e88dac35e48610b5f2e2f483 |
|
BLAKE2b-256 | 3f469db82bd2c1f91e6d5f6dc6144d201854e29e20ae0cf831992e1daa00c62f |
Close
Hashes for rina_pp_pyb-0.9.19-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f68e1f4f999c305d38d464b10eb9067781fdd1cfc7355bddc72d810d07e50a1 |
|
MD5 | 2378f1e09f1c30a2a997e81adfcc4662 |
|
BLAKE2b-256 | 324c791e3c3b27818b2dab3faea98baf542952c128d7c669fd587e068337a593 |
Close
Hashes for rina_pp_pyb-0.9.19-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 211dbfce2472ed36ae6ace3c767ac49112a446321d08ed00aa88bf374ab69ae1 |
|
MD5 | 9b113a80a7a4cf738e107d7b8d7f62fe |
|
BLAKE2b-256 | fd94b4a9106da1f16579a8ac77d470a62af65667cda0803f211e3fd221ba3f77 |
Close
Hashes for rina_pp_pyb-0.9.19-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ffcfcfaa42f99ac6721a484e5adfbb9791f3fa559a188814e2a885cf431377f |
|
MD5 | 920870b1d7d2ff3bf6f0f95d621a2f59 |
|
BLAKE2b-256 | e281df442cbeeb81309d4857e4d10c1a5f7aa6fe271bbb0b8dc50d95c38fa3a2 |