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.16.tar.gz
(25.8 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.16-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd92cded31bc44a47d74a8f8a0ae8be944c978f90a7772096311e7d1b244fe51 |
|
MD5 | da0ee9e739e165bb220892e2d2d664aa |
|
BLAKE2b-256 | 4727b8d28d010c5e7bfac38d8ead42a5becfcc8f74cf675ec97bdbb3d96d982d |
Close
Hashes for rina_pp_pyb-0.9.16-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c80a8eaa95bf635da087a67562817d2c28fe8efa04db94adbda47b0069cf67c0 |
|
MD5 | 88ce1804f845fc50276a7a221ae55996 |
|
BLAKE2b-256 | 5a9b8fbfdee16f3919b8c12ecd039ebb5aef042d6e7b68ca680bf88b2ba1b73a |
Close
Hashes for rina_pp_pyb-0.9.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42053e0e4cc3f44511d82950a5a0add5a17e577311c6d72be5a65b94af22439e |
|
MD5 | b161353ab5ec75ee67d8284b603b4cfe |
|
BLAKE2b-256 | 0e1d5876acf4bf457ddac816a3db4bcdd11651cf0dd2a04e8479caf75952f53f |
Close
Hashes for rina_pp_pyb-0.9.16-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 429c8031a1a44bf891627d8ce1bd94ac923c8adbc913082910c0c5247938226b |
|
MD5 | d842afb217bb448b3cb6351f4a138f83 |
|
BLAKE2b-256 | 36a1e8446926363b82a9adb166adb711f257c9ed3747a51d253f478470649371 |
Close
Hashes for rina_pp_pyb-0.9.16-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec0d5c0cafa5b6d75d45a98fe863712b90afff666893f9b31c51184beb6027c3 |
|
MD5 | b1e95a3531a764c286a1d175d9ca85b1 |
|
BLAKE2b-256 | c1b092d9f54446b73f9c32496a742519aa744c347a532f3ec30a13f6a527b8c8 |
Close
Hashes for rina_pp_pyb-0.9.16-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c20e4079761f069b7931cbe0da7e33bed84c00061848ca73254011180bfc9a15 |
|
MD5 | 34a236a146044e324fae7ceedbe80230 |
|
BLAKE2b-256 | d59e890ce53eba4b3483f9c1eb94114e2dc8f181d30572232cd677c715ae264e |
Close
Hashes for rina_pp_pyb-0.9.16-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c3e36e0abf8a2b08010f508750f4c9a48e75585c2a48ff9e089a07052fca6cf |
|
MD5 | 2e921b0fcebbc1da0bcad5381274e4e5 |
|
BLAKE2b-256 | c21cd7ddc36485c6304ec1f87d245da880084d0a3dfdf7283e1b7e18fdf8fab6 |
Close
Hashes for rina_pp_pyb-0.9.16-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0880398267b821314c81dc29514f9481b35ec5e97b151b6e9b37c03f76b3516 |
|
MD5 | cea2cf2957b5c3922e105c6a898d492d |
|
BLAKE2b-256 | bd71ce37cb04bbee45c9d9051501f7a9d25c73a5dbeb8114a2b958780a9c35fa |
Close
Hashes for rina_pp_pyb-0.9.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d89a25483dc2aa23e496b676889d4a6f798f6d985544264ffe2c340090da2e3 |
|
MD5 | a2360cd02d7d87bd313a7088164e300b |
|
BLAKE2b-256 | 569bc044c151e37a8b22ac067a6de31fb1fb21f834772b9d2f2e483f97fa8597 |
Close
Hashes for rina_pp_pyb-0.9.16-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21598cc77510c02e506f67af5f79b996527eab2d1a5e7f287d91eb483e01af75 |
|
MD5 | 5ac669bd6fdffa622b62637b0feef0b5 |
|
BLAKE2b-256 | 8da7cb575fc88c44c3167cd02b4836be57d9863ccaf1c4769278acb9c183d7df |
Close
Hashes for rina_pp_pyb-0.9.16-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 145f89068cc01deb41e32862653bc9c9204a313316a143144800bdf6f0c5a3fe |
|
MD5 | 49263f528a335e6ade7781d2a3042052 |
|
BLAKE2b-256 | 3199ec1f0b3e2938528d52524c31e667aabeb4bcf9c20ff157cf645220044190 |
Close
Hashes for rina_pp_pyb-0.9.16-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfe02581dd98475e3782914e0d0a89dc7ec98e66dcdb7f10a883ce2e8c0eb366 |
|
MD5 | b4337d7cd5085ec1641606c8a11fae53 |
|
BLAKE2b-256 | 299631bc436a27858b490c94984e1140fbee1840c7ee07215635de0a005374be |
Close
Hashes for rina_pp_pyb-0.9.16-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51e1b3e2fe7d4ee192ae6f13b1a94edab066792219189cef69f6972903f0183a |
|
MD5 | c85689c88d2a27b4bde4bbfee4c53432 |
|
BLAKE2b-256 | 4c40daec11509b3de2c2c751189b519bd308fda56c068ad9310006483362c5a2 |
Close
Hashes for rina_pp_pyb-0.9.16-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6e5edd805e8ad76d7f59485232ac803c6bb73a6b2348773d6eb77f11c509c12 |
|
MD5 | 0cd2762eb0b47df82a0d214a6193821f |
|
BLAKE2b-256 | abd34415177685b3f6083c25b055801baf2d5ad224e2453900afb38156cfaa74 |
Close
Hashes for rina_pp_pyb-0.9.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ba91614e09e3257fda241959d78f83e5fe72c1a56b179161da320f01f0878eb |
|
MD5 | 627972e3809bd277a89f0589533a2eb5 |
|
BLAKE2b-256 | 9f966d62964a139042416070a5d79991a05011fbd4848f8397d17604373ad472 |
Close
Hashes for rina_pp_pyb-0.9.16-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1591dcaaa5212542d5e0c1ed28375080aad660855523d24d52fef1b4e75fd179 |
|
MD5 | 0d93d26ddc812121e6c3ca359b0e6242 |
|
BLAKE2b-256 | c56f987fa5c73f68070c9d5ec2136d05a46d5b91a0be53921c4f7df990484ec6 |
Close
Hashes for rina_pp_pyb-0.9.16-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4778a7b623fc7f1b149d73b3151cd1b2ea32304cd60846ee98722a573f27e637 |
|
MD5 | d71ce89b1bd5df57b4bd0c08dc16ae8f |
|
BLAKE2b-256 | 93dc74be201bb50a6a4d662f2114dd8ca42ecdd40727ae6fd4f119684e469438 |
Close
Hashes for rina_pp_pyb-0.9.16-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4758713630642aaf356a5329957bceabd3b50cf069be500a287e5cda8fc4a169 |
|
MD5 | f92c6c0890eff4744ea394ddb1bdd8bc |
|
BLAKE2b-256 | fa15f303cf1af8d1db748798f2fede91b51dbd07606cf041ad485973e625785e |
Close
Hashes for rina_pp_pyb-0.9.16-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0340ba637f7fc9830b48fd0bb339efef469273384a7ef81a3fcfa0371109db6a |
|
MD5 | a6448113457e0dc3cf225e35026e3449 |
|
BLAKE2b-256 | f84b2221ce1707be311e98e05005bf4aefe3f033bc0390360be62ab60f596ea9 |
Close
Hashes for rina_pp_pyb-0.9.16-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5704d50ad74b3b34c8898df10e0f4d319828c3a5fd1976bdaf38bec3c12e3e33 |
|
MD5 | e8130189555d3ca26d4d93f6c3bc20c0 |
|
BLAKE2b-256 | aa50630937ae45c17fa8ceb0ed43aae27c1d51e567e5a12d17f63550a4dbf7e1 |
Close
Hashes for rina_pp_pyb-0.9.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47d8841107932cb995c173c50c53a0f23a67964eb91b033c2dd229c20f64a0ee |
|
MD5 | c08765a56a81826aa209ea85e7c96543 |
|
BLAKE2b-256 | 210fdee69c7ecf6654c519909262bbf43592c7792236c7e1aca22647aeed9712 |
Close
Hashes for rina_pp_pyb-0.9.16-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a81206c28c08396c9a94639cbf28fffe70a31615563e0f1abf561221bb111929 |
|
MD5 | e968749896d7a7983b8fa191ae59ef04 |
|
BLAKE2b-256 | 6d6a7415c376e38deb39307e1052c29dfc17a90d6c9287728fd42ba1c100661b |
Close
Hashes for rina_pp_pyb-0.9.16-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a05f2b78ea529a2052029250960ee8997db096bbdf46ea4324aedde620bbcca |
|
MD5 | a1828d9b19d545837b662e878a82f8a5 |
|
BLAKE2b-256 | f1ddc842ab11b9d184c12f290e76293f5d2081693f82391cab0032f27f2e5b78 |
Close
Hashes for rina_pp_pyb-0.9.16-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80c6bf823a54eb3e4da2bf73bde6abd2f2786b90d1d9dad00cbcc1fc75738bee |
|
MD5 | 1927e35a6477b39e2f9e8fc86cb75552 |
|
BLAKE2b-256 | 73fb3e184f53c49142e7035da890fe9fb9f1eafd48ee78d08df0a4d1d81275c1 |
Close
Hashes for rina_pp_pyb-0.9.16-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b49b646f8081fa4f594cf520133e14c103e251d038687bd27e0fc6556b9b436c |
|
MD5 | 67af14c7bfbfb790cd9cd833b2f6fa69 |
|
BLAKE2b-256 | ccd4b0b7744041e53b83488a9abe24b72be0081c287f5d7fc4ba6299e767d5f2 |
Close
Hashes for rina_pp_pyb-0.9.16-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a25ff22692df58f729292936f9028839b838efd9ac45ff2f277aa5e388216221 |
|
MD5 | 304039f5222e9f7da5cf8ea18db4bb3d |
|
BLAKE2b-256 | bf8adf1ab149c70f0aabac38bb3daf5deede39ce71b52021cfe4afebc9870ac5 |
Close
Hashes for rina_pp_pyb-0.9.16-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa1bf62b955265655642f7bc3d8e2d24fd5cf789504377df4ac4226090473476 |
|
MD5 | ddb2446c423ff4250bce9907a1fab98f |
|
BLAKE2b-256 | 2cc9fb64f5e19979ddbd1f8e3348e2f742c984047a97e6265cd4ee3ba595f2f5 |
Close
Hashes for rina_pp_pyb-0.9.16-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b81890f6c97b1bd83eae0035c1424e38be03277379f6ade179f92b7cfd10af9 |
|
MD5 | cf6f3e6eb56df2ee97ff7ee9d91abde3 |
|
BLAKE2b-256 | 2613c2ed6e9d28950ea4767cddeda405fa4b41e19adea8ba9f36fd1e65ed0313 |
Close
Hashes for rina_pp_pyb-0.9.16-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b409a634f9e07a98445a4b1e97beafa4a6ec97071a768e42b65d70199a2595c4 |
|
MD5 | 04712b4abfb296a649931f33f7e0c84a |
|
BLAKE2b-256 | 3a8eabbf4e2009aac69f534720f7837671aa747f21f0c8a74a3b9e2dff608b1a |
Close
Hashes for rina_pp_pyb-0.9.16-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f81a207edda93909f516ca1fa18d353a9cd56dcc6b61b6e67b2395f899e1d35 |
|
MD5 | 7290ba2a3c17a35a0ea19a8b6495ca54 |
|
BLAKE2b-256 | cc8d9054c9e31d94bc15ff7554b2701e90237e330660130331a7411a8ed77218 |