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.21.tar.gz
(25.7 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.21-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be121f5133e74825259322b93a539cee286e27b996343498698154be79358e47 |
|
MD5 | 19234f430f6763391908f1966866b8f5 |
|
BLAKE2b-256 | 47b474ca6764c02b629437dc936366251e01de6d7adfd4593fec1c11eb185ff4 |
Close
Hashes for rina_pp_pyb-0.9.21-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a79c19002e42914442b43f13643057c234974217f823c58d74a98f986de958e0 |
|
MD5 | 61782be09e344db0cff33e55e91a68dd |
|
BLAKE2b-256 | b969d9c3ebf95028e7159ff07824fcddb297f55d18287aef5ad6e8d221495c54 |
Close
Hashes for rina_pp_pyb-0.9.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4e7cc0de9674ff05628bfb8ebdba0f2a17b025c8f8b94473a78ed07ef205d4b |
|
MD5 | 5516c4f42fffa62847729178a45572b2 |
|
BLAKE2b-256 | e3dffc5516936cc31f0fdf070d990d2d820994954f7996cff1e41739512ad530 |
Close
Hashes for rina_pp_pyb-0.9.21-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e0c80f75b5f929d5b7c8f4a32b426838ec0fbbc09f453e67916023bce33ef1 |
|
MD5 | 4ac2c413655915bc800b4a4259a96558 |
|
BLAKE2b-256 | 9a158c0a0afde8c7dfa6d7d31cfc980c60f57ac9acbb65270fa6d98bf5f92398 |
Close
Hashes for rina_pp_pyb-0.9.21-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dfe3d3f56499e7ee16503a699e9d3a007ae6c90b5ff2ec3cdd22c030a15643e |
|
MD5 | d57b1382a55f58d3706ea5c1c0799004 |
|
BLAKE2b-256 | f5a0ff009f4418dcb84cafaa600d0ad98244f779f827f2964973b90297214a1a |
Close
Hashes for rina_pp_pyb-0.9.21-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 032c85a120460fa9a9adc5442035d3dd04da88fdc740e27706b1f9d520cdc2ae |
|
MD5 | eecd6bdd35cf32489a66d385d4616a95 |
|
BLAKE2b-256 | 3935c6405c0dfe4056836ff60b0df1885a996c2370985f7f7e4c59d5a3834702 |
Close
Hashes for rina_pp_pyb-0.9.21-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a451fd28a646e4537c0b0a5559a9ac0f312f713f24483b27c6544889e1ab240 |
|
MD5 | 2cc9e5a35c733c1ca1419c6006c48401 |
|
BLAKE2b-256 | 6d36463e7cf801ad4f4e401e06ccca4fa741f1dcb143859a33f7e6498709969e |
Close
Hashes for rina_pp_pyb-0.9.21-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d39d286797ff9d695f63f23d165dbc9a130d7d49aa7f86125ab02e1bf83abf19 |
|
MD5 | 7f0e28060c85f82e9ec2b46581c76c3e |
|
BLAKE2b-256 | 306a0adaf0a221cda01c78f83dd5235421fbc0ec8fd8820c2a38c1cee53ef9d4 |
Close
Hashes for rina_pp_pyb-0.9.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 067c6c2d2d0d478bc8b9331b7af874d44fdd2ae1c110e466c555a7c6e0f5d713 |
|
MD5 | fa84eb5052f3b84126fa7e98722ff45b |
|
BLAKE2b-256 | 976deb764234cc9c24a804ff3f4b8fae1700b999a65902bd2b5e4459c04fa98d |
Close
Hashes for rina_pp_pyb-0.9.21-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76d610c67851e9a48af9c8a1d4da200d8e0c9d3e5ec39aa9739b649044abf9df |
|
MD5 | 0ad43777c38237e88ba677c2e05f6948 |
|
BLAKE2b-256 | cded5bef346fdb7f60da75a892ee648dbb76ce2e3bf74678aef28664814876b8 |
Close
Hashes for rina_pp_pyb-0.9.21-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9018837575abbe0c4a4c0c81a1ff01ce48fb0b5ee76850e5ba2188b18fa7fce8 |
|
MD5 | 351a6e6e39586b897095b0983dfb45cf |
|
BLAKE2b-256 | d4abd08c2847820104bf981bb83a49d5f5f0a525eb5d980920283ff63bfe8e5b |
Close
Hashes for rina_pp_pyb-0.9.21-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbc864550c39d69ed64207e17c90cd3d69dc6af083a988374ab99491bd7648be |
|
MD5 | ff5e07583442edf2e461c8461f78465e |
|
BLAKE2b-256 | df14b96a2dcc3a6908aec21731b0ab2ad969c74b6061e7196510e82d3bb682b9 |
Close
Hashes for rina_pp_pyb-0.9.21-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b544cc9b229ee47f2ccaa3dc8189e5952ed1025f86e1de71b76f88d2b2c8940 |
|
MD5 | cc834cb06e5c6ce68cfe5af5df7da721 |
|
BLAKE2b-256 | 0fb2a1995224444ae27a68e3314d276c0c6cd15315fcc1b0d2a5f60ac3edb2aa |
Close
Hashes for rina_pp_pyb-0.9.21-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8033907c18a9c11096edc01af98ff0508ed6e4314181f23e26756ae7c513869d |
|
MD5 | 500be8e00cbeee80022b633b069c237d |
|
BLAKE2b-256 | 3181e34ec0d37ec1b7a997b9eeb45838089711de6ee47779011b9fb98f0eab76 |
Close
Hashes for rina_pp_pyb-0.9.21-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1105068acc6b251f1b4908d64e315a0b909755073bbd6ad53ca1181281ced2c4 |
|
MD5 | 938bddde474bfae40eb60fe62a213a26 |
|
BLAKE2b-256 | 501e5d2aaace2ca833d1569e6072a4c83ff93db6dd34c4459cff818b7274294f |
Close
Hashes for rina_pp_pyb-0.9.21-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aa6b86b1beaf9ffb61ffa5d77140644a54a619aa998566927dc1689d43ea688 |
|
MD5 | 9cbca366c5b458dadc42a9dc4292691f |
|
BLAKE2b-256 | dbdff1116cf02920b1d12caad120abfbd693619f7d453231d67f80e6f57f4942 |
Close
Hashes for rina_pp_pyb-0.9.21-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc63e12f52a1eea840999f68807d42eef475d85553bfe0dbc3d5a88aea40e99d |
|
MD5 | cd700381f4e1d0b104b9d8b42183f8c7 |
|
BLAKE2b-256 | ea9c934e09b40167d97b9d2de7c9035413e3511f01bd4d77e43681ace1979a9f |
Close
Hashes for rina_pp_pyb-0.9.21-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d1fd4c3c308d573887393f05f55163e9d4e7565c5c639943ab5cb05248815a7 |
|
MD5 | 12d7661260a07043e6fd23eccaacd2f0 |
|
BLAKE2b-256 | a9a6fec91f3b4c558d6846a87fcf10edc3a7cdaab6bb939024c36936dcbd5a6b |
Close
Hashes for rina_pp_pyb-0.9.21-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b24b3b74c9b3132c886f64a2a8e7435d5f6ea65951ecaa002ddda7781c269ed4 |
|
MD5 | 02e4ab67a140a0ff80e830f4c8dce818 |
|
BLAKE2b-256 | 9c3699d1d18a76a62a4201ab03c5186a8e82480cedfdb67ec710e4d2e8bbebac |
Close
Hashes for rina_pp_pyb-0.9.21-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f2a9aefd2dd4d4f62ae243c7930eba618e8982a047aa2bbb52f9ca8dba67ea |
|
MD5 | 0bdef8b6ca64a0749dee2214e52c606a |
|
BLAKE2b-256 | 6ef1de7bd90aa6fc6c40162ac908d2bbbfd6433504f461bf4bf60764c7f48894 |
Close
Hashes for rina_pp_pyb-0.9.21-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4a83e33edcc3e54e5c104aa04c19b6819e74ac0ee5c29995cff150cfc0af252 |
|
MD5 | 87b5001b2f73fa799a27ed6005b426c4 |
|
BLAKE2b-256 | e6934c4ebc65dccbdfb85c611ba2ed3bd8b8d678a8d83414a7d062298c726b6b |
Close
Hashes for rina_pp_pyb-0.9.21-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cedd1f4e87fbdad801439dfd9c3fe5b86a6e325715e276af0408e3c387696d7c |
|
MD5 | dbb89150dbde10a2a5babeed579e245a |
|
BLAKE2b-256 | cfa95386e1caaf8db1c26bd484bc325bf6588374863fde5c89ebcbfe56eb58da |
Close
Hashes for rina_pp_pyb-0.9.21-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85e249f2a42436a240a73e9ac037eee59eb57cf253907640af849c97117ac88e |
|
MD5 | c5d7ec2c09dd87167364516bd5a1876f |
|
BLAKE2b-256 | 65ee80a6e0ca8fdbe441c1eaf5f5d52f4c0788011f6ab4d79c6672e4991e68d6 |
Close
Hashes for rina_pp_pyb-0.9.21-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7fbf61f9fc25d323aa7bd06686ace8417d10de40ad0a54d9915b478bfe6159 |
|
MD5 | 19da926b50e9cd99f397984a314983cd |
|
BLAKE2b-256 | 07313deba84ee6b3349397e18bd4e300f8548749ed43f2abc09621b95f245564 |
Close
Hashes for rina_pp_pyb-0.9.21-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77f5384194f1feba55dff9c53cc0f9df522c0e3998812d5f81d60b94923fdc51 |
|
MD5 | 6336c356b2f247c0f9ee905f6c8a2cbf |
|
BLAKE2b-256 | a6a814a79011e7185c5bebf24660dda553ac3361d23b08e6e343597806ad36ed |
Close
Hashes for rina_pp_pyb-0.9.21-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81c36a4d4fda221689068d0de099f0451b89d69740502c5a6a59ed3a17315312 |
|
MD5 | b68c70f1dfe6dde24dab2501a744b7ed |
|
BLAKE2b-256 | 38f3725525b0acdd2d534c2418e2b89ada45e04c0dde077353e5a4a79f2580e4 |
Close
Hashes for rina_pp_pyb-0.9.21-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c5859bcf033a2ba7ec5174f541ffc9ceb90a8cce80b9aa37f9fd1f6ea0dd5bb |
|
MD5 | b675c509950961d7d328312591c5f4c1 |
|
BLAKE2b-256 | b2b2d835ca264b65a6b6b16a0b0ea3f688c6379197e284d273e69b031bdf96d3 |
Close
Hashes for rina_pp_pyb-0.9.21-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e2abefa516456fbc1bf2fac22162fbd345644388cdc35352a484f323dcf4a15 |
|
MD5 | 46c4a035f82bccd91b07f56d05b9ca0e |
|
BLAKE2b-256 | 601b5bf3f5f55ff19d7d5805127e29685cce1ce467832baa9047f16d969dad94 |
Close
Hashes for rina_pp_pyb-0.9.21-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcf9cefce8d4ca9cb1d70b2ec8bf64906d0092ed88b74641df82d49c72d6fa58 |
|
MD5 | 382ef836624fb0c621a3a3d351fe59b7 |
|
BLAKE2b-256 | ff563b1bacb18482fcd71b3f9f9dcb47543ffa1d560e6c8a620e54f1a46bb43a |
Close
Hashes for rina_pp_pyb-0.9.21-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34bde61ad7791218d782e2fd0e07f77cd452679f6130e443ab36ec0d8fa38931 |
|
MD5 | ac43fbe4debb21ff71b3f3b61b89d53f |
|
BLAKE2b-256 | 833986409e2bc509717fe87e2b39ba24c8e2204acbc939aa9623b5c448a95a85 |