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.15.tar.gz
(17.3 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.15-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a067c8143ec1efe39e5f2113f20e17b08052902ae1423d900e4b0325a8549d29 |
|
MD5 | 811c320a2ea3b3ac875de94bfbcfe2c4 |
|
BLAKE2b-256 | 8241e103ea71ad5914e9861814ef8f315fc5c16412c792b38ce0aa14453b7d5a |
Close
Hashes for rina_pp_pyb-0.9.15-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ababc9ad392433208707103faf260e3606287da14590daf18012548e7ac53794 |
|
MD5 | f6e781f952dfc5bb57050be1c88f3177 |
|
BLAKE2b-256 | 67f9091fe61f97c5e3a2bee30c93af12330a93f61e575fa0e30efe74f6166020 |
Close
Hashes for rina_pp_pyb-0.9.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b26ea42d3ddea6960d07d3ef4d0649ae8cb83f73037accaeb951ef393990d6d |
|
MD5 | 38e2f233feaed412f1d0fb70ecfe80cb |
|
BLAKE2b-256 | 4845cef35cfa160ff3627f4c0bf9886d19e5dd86306413f55c724a192fce878c |
Close
Hashes for rina_pp_pyb-0.9.15-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 922a4a296bb559a71504757d8497bf80cb1244f4e2a31043257f9b54ebb4df90 |
|
MD5 | 817ec9388433fa31d36fa472ffd25e10 |
|
BLAKE2b-256 | 94133e1223d32cab84ce58381f3d87010aab744c25c466c368cac44dc8e4ee40 |
Close
Hashes for rina_pp_pyb-0.9.15-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5738dff8448ea0a1014c9c7d37da0913eaf51da2224c57287b57e8fb5d3c227 |
|
MD5 | 1a937691194b871783230d52669eee89 |
|
BLAKE2b-256 | 063d07c6606a77ef94a01ec97244190e4f0a2ab4cac89a07931d91f749f9ceb7 |
Close
Hashes for rina_pp_pyb-0.9.15-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 077ccfc697f658c1dd4bf44d1d76bb006c10bf3e71cf2cda8d2dea7ca66b0ec6 |
|
MD5 | 03f23a6301a0d86f73156a0d814cbd3b |
|
BLAKE2b-256 | d8eedf1962e117449092bd2534677101330c3aaf3f2b0f605b96aad193fcbf67 |
Close
Hashes for rina_pp_pyb-0.9.15-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f14f184a0b6d52bfcaec19184e9b24ee55e39bafc86eae54c97f379608caf052 |
|
MD5 | f0cba2faa2ea551ede9fe432c6cfeb13 |
|
BLAKE2b-256 | 457ee753d311b4c761f3cc83e121ed1526cad4b1613c330592a1b7c35dbc64ad |
Close
Hashes for rina_pp_pyb-0.9.15-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d9aecdbc6722349f6b266fde0367acb221fa5ec6dc50a035f62367f06fec0f0 |
|
MD5 | 518de1056240efddeae2941292a3e9da |
|
BLAKE2b-256 | 858f6ecf32a3b9b282cc670715c5223900bb39717fc4c4d69a6280ce1c983cdc |
Close
Hashes for rina_pp_pyb-0.9.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0fff27f66a06defd8c5a1e008308aab196d22bace3f3db63606ad24894a01d8 |
|
MD5 | 5d578bd24ff238c0a9fa1991274a1534 |
|
BLAKE2b-256 | 59b0559b3b5809db29d24027e139e1dd638f33d8067e6cf67b8a0dc1e23d9d28 |
Close
Hashes for rina_pp_pyb-0.9.15-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6dd6a323d9969f414401202029a982e0b26a0f42ef506d1d8dcec44c4e03171 |
|
MD5 | eab165b62e8fb6ba766aeb95f0833829 |
|
BLAKE2b-256 | a89897b8cab38d59c54ae83fe07a12ab3d287a533b6fcbdfc16d49b24aa12827 |
Close
Hashes for rina_pp_pyb-0.9.15-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67a63a4039e352a10f946a5832d94d954a2e58014244365b082f740f6dbc41d1 |
|
MD5 | 60fc58ba0f57dc6ae81850153e833785 |
|
BLAKE2b-256 | c9166f15b64af5f68a47100d4df204ee16647c6dbb19c520df1315b95f0d9cb8 |
Close
Hashes for rina_pp_pyb-0.9.15-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 987aebf64cbb7f7dc06747aef792f79d63491d6d65d11a18594e178be5f7664e |
|
MD5 | a0c743c18e80d429eb8a759d4be2ecf0 |
|
BLAKE2b-256 | 9b64bf480db134119af4f1e005757da5715e4e7ad513d932f025c8ca1bd01439 |
Close
Hashes for rina_pp_pyb-0.9.15-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93e011bdb39e0b66f250b9a828987cf423e4fc96cf99ca33a2470ab3ca8ff1a2 |
|
MD5 | efc0e50686a351c56d85308a10e55b56 |
|
BLAKE2b-256 | a44af638afa5d7dc8f803646ce9164c0c5f363b059da758d29cc1dba6fd95533 |
Close
Hashes for rina_pp_pyb-0.9.15-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38347d9c691dda3032ada4e1ab0c49323adbdd575c31f3c03a714c6bce31bc9c |
|
MD5 | 0a2225d7078766658bd85b600a26e799 |
|
BLAKE2b-256 | e8409322cd4c4576e2f9c30fcc112a354a76977af28dd3bbc1d33d4b32665fff |
Close
Hashes for rina_pp_pyb-0.9.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ee9b89434f90b26670f86a61143ed764f1d3c0a619de894fa47e0e92010c0eb |
|
MD5 | 94734780738129c776cc4806265b3e0a |
|
BLAKE2b-256 | 51c62aadf0c42009e9ca6b72ecbb824e8a576c536a9c4bfee646811779407284 |
Close
Hashes for rina_pp_pyb-0.9.15-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2d31ff8bfcdfdadbf1874b18bdf16b14d9a45ad1f47cdc3e2117ce8821c2e36 |
|
MD5 | 9a535cc8c2327e29e4dcbd4377c167db |
|
BLAKE2b-256 | d30f95cfa3f340e87a810bb6a7576c40de214f294770c9b98dccdef4f6fb9e9c |
Close
Hashes for rina_pp_pyb-0.9.15-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d550aa4f0ad481cbba5bb298623a8d050f9e38dec47f4e8dd59030f0727fca13 |
|
MD5 | 387fc048755bd0369552dc6b41452fa3 |
|
BLAKE2b-256 | a1f6f46573e38baf3377926b4d8695b823af140aea812524c466e9a132ecc049 |
Close
Hashes for rina_pp_pyb-0.9.15-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62d6c260e46a742b9dd51b3dc4f7995f712d96853160bd478588e89ecbad123d |
|
MD5 | 47564e4ef08335c26f2632ac47c976e7 |
|
BLAKE2b-256 | a3e8754f0eeee96e4515d48ac86deda89d91916decf7909ad5906c9a9a4229c5 |
Close
Hashes for rina_pp_pyb-0.9.15-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a513bc44cba240b295ec5c42ae0b5c436c0f0ed9f6580f5fbe5b0aeadbc582f1 |
|
MD5 | 875083722e3ce080b07e1bfb0cc59ecd |
|
BLAKE2b-256 | 249e72aa2f6c823ad83384c26edcbe9644bdb7004c1bcc5a8a4f667594d26410 |
Close
Hashes for rina_pp_pyb-0.9.15-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a273187653653512b8ab3274308a9f2f90b548e2ed095537c7de4ec8da275e39 |
|
MD5 | bd518969748a6f4b2856197ee49ffaa9 |
|
BLAKE2b-256 | 661bc1a3a0660d086d28c0967ce8e4eb93fe56be4b61d6a1709b7b6c9f59021b |
Close
Hashes for rina_pp_pyb-0.9.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d128ceb0225cfeab1874b842197cfda57a438218d445bd5b10aa15e0a31fc36 |
|
MD5 | f9418538d7e9b3ff88e70ffbd5ef5f66 |
|
BLAKE2b-256 | dc291196549c7d2b8e74f128ae27d7a4adf1cfbd04c5f47dbb945a77055df589 |
Close
Hashes for rina_pp_pyb-0.9.15-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d58b367933d775ddf76994c5362e6d4d68618bc2b0a4f0aae7da8185d8de9e2a |
|
MD5 | f95c51db477a31bf3f928b6aed5c1b24 |
|
BLAKE2b-256 | 84e3e55c372e32fd1fc1a8ed367a82ed1958bb5af40dbeff27e9b71719ca1e8b |
Close
Hashes for rina_pp_pyb-0.9.15-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f92eab4dbd3e01634bfdf47e01fc7401fb37f9bb2578f6a345719a33912b4f40 |
|
MD5 | 6061de93f9f32f214bacd764c617075d |
|
BLAKE2b-256 | 3b716f10f152031eeab7d13ced195c54b4c714185c22b7b665496c7c2ed9b784 |
Close
Hashes for rina_pp_pyb-0.9.15-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b081ee898dd01319ba6274f21ad8d2676d53b56a7315e7462e0d8bd1eeba2904 |
|
MD5 | 2608698ff3376841e4ff79371620b35a |
|
BLAKE2b-256 | 60a16e50b8c3db230239d72c665c4f946999848e8e25f9eb99da271beb42dcc0 |
Close
Hashes for rina_pp_pyb-0.9.15-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a224e6e0d1b9368909cab95ae86ad844ceb05f4111461651681c77039d51eea4 |
|
MD5 | 3d8ae1ffcd929514710a7355ef63f04b |
|
BLAKE2b-256 | 636000650fb124318a948326e638d2f5ee016ba4e6104db8f8e6668d275c6c4f |
Close
Hashes for rina_pp_pyb-0.9.15-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bc4e6a093a1188d0e1a04f012005696ad6d05e90f2ea5813b71441186cb77ee |
|
MD5 | 5fdeb153db63c507cde2a1fc443bfb08 |
|
BLAKE2b-256 | 3c0c65539b4eee5a673420c31d4b05c5bf697f35a9bd2fb2813364c29b45a462 |
Close
Hashes for rina_pp_pyb-0.9.15-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 322689fb664990faac87efacfd598a8c47993091ecf4fae4341917b4bad522c5 |
|
MD5 | 2f009a8e180b54de2e0ea86a56352577 |
|
BLAKE2b-256 | 95d7c8ad156b947de97efd0e45b2e3cd879ca6af1736640055dde7ebfcc8163b |
Close
Hashes for rina_pp_pyb-0.9.15-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d4a952cc97676355128aae8a7079c36f62ac5c6b728736b0fc09e122250450c |
|
MD5 | 02b913c6b05a7b7f903b4547107daf65 |
|
BLAKE2b-256 | 440b11dc5f502bc77ef528b953ca59214b9396801544b01c0dc32319daa1465a |
Close
Hashes for rina_pp_pyb-0.9.15-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47db3747fe2f1d9b2ea6797195fad4b2bfc3e2166dd18824437d89a2617ce5db |
|
MD5 | cf5cf98dbe13c601780635cb32a5336e |
|
BLAKE2b-256 | cc7d11926fa278c3edcfc6910791a4f746fc1f479df719af1f46fa1f423b396a |
Close
Hashes for rina_pp_pyb-0.9.15-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1e45daaae6e12a35b6409cff4a0d1220124dbba8d5969a67e8a15ce8de89a7d |
|
MD5 | 8a8be5245654163fafaf4cdacf9b0ed7 |
|
BLAKE2b-256 | 3cac3e49c96b95c7917e0bf8080bb50d0a7a229250dbf9ec6bc8fc46299fd532 |