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.12.tar.gz
(17.3 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.12-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61abb3abce1f0357d683a235b35791969f7e57e2b3f30cb70c1a5af47f294c35 |
|
MD5 | 0adf8590c256e944c48e4ff74484bd5e |
|
BLAKE2b-256 | bbb255180f59e6ddd3ccf95432fea875c4399d6387984e91422e7396a976a9b8 |
Close
Hashes for rina_pp_pyb-0.9.12-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71d6572d169f6aefd348339949401e2cb5d2531c6969ba83c33519970e534bc1 |
|
MD5 | 57aedcea941bbc9b5be873d6e02070da |
|
BLAKE2b-256 | e4aea66801ea08fede40955a2c13b6bebc203b1f178cdb3d2d08728e7491f7bf |
Close
Hashes for rina_pp_pyb-0.9.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33939a89bbebba59a77590c3a640665c8b2584fad078b9e403dd1bca65252a55 |
|
MD5 | 62f836ec238a4514b8335803befb4d4d |
|
BLAKE2b-256 | d9bb2a723e69e774fb54b3fcb1db05c0fa3f3e2a4f16013b0612125d72e3b5fc |
Close
Hashes for rina_pp_pyb-0.9.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e763772d5ac48601af11f68ccf6fcb5ba985409e71a6d67d2896cdb29f1b3b6 |
|
MD5 | 0f099a31b4db2f64f9ee980deccdac94 |
|
BLAKE2b-256 | ab3dd6ee0f39140357a5cdfe27822e6760be1336f1156edd2d4a9a8862f6f654 |
Close
Hashes for rina_pp_pyb-0.9.12-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e8ed6bcedcee69eca33c05f50b3238a92e23e5f29e326123f1dd847b05a2ab2 |
|
MD5 | 25bb1d27581736d99dc58bfcbcea4059 |
|
BLAKE2b-256 | e31bfd897decdce716eea0e37d82bbe729773fc2a90dce59c2386194faaae477 |
Close
Hashes for rina_pp_pyb-0.9.12-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60f2d0417964367264bf7442e419d91510d455c6d1bae7fbf65b854026f7bbe4 |
|
MD5 | 289c850c4c39198b9f0b71f1189189db |
|
BLAKE2b-256 | b7cbe9f16b9d3997e6dc7a79505a42957712a62c72c0b3c1d9cd5400714cb4c6 |
Close
Hashes for rina_pp_pyb-0.9.12-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6061c56eaa6181ce6fdf0667c836c8151714049eaf09e91959f17d00d9f85024 |
|
MD5 | 157e9bebf6e5710ded3bf93f023d302e |
|
BLAKE2b-256 | 76c3738125d2dbd15163f0ee666b00b152f2614eeab0213527264bdb3b626291 |
Close
Hashes for rina_pp_pyb-0.9.12-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31345b83d6683919598485bce47f8c96f25f9655ecf8f6a8e09742fa9bb4e089 |
|
MD5 | 72cc98c36d36ef7e87467afe8ab44183 |
|
BLAKE2b-256 | 7ac64ebcc50c9fd592bba5e369c159c4454ad9cbdd45d26183d3626efd127109 |
Close
Hashes for rina_pp_pyb-0.9.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 393cce32e421866e3725824c586d0ee75e84e06181f02e45c455b1b4aa5d3b23 |
|
MD5 | 1a5a6caad530af28ca6f42d18e478b09 |
|
BLAKE2b-256 | 27ddc3ee207d56adee38800e81026a25630bc9b1eaabfce52860eba6b6df95a9 |
Close
Hashes for rina_pp_pyb-0.9.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84c54e7bc0e0ca52080cc3e9ed586e7c9901a3cba8ccbb6b1d24a093a2849917 |
|
MD5 | 961c7671e8f1ba6d6bb1047be64484a5 |
|
BLAKE2b-256 | 5b285459e55938408682df0065d4ea91e3f13cb83c388519d7a6617c38b520a4 |
Close
Hashes for rina_pp_pyb-0.9.12-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f875a163df516e533a19c9166487ade320ab82d2feac00811d1470c24a66879 |
|
MD5 | d7459142e281fbf5226cbc2f236498e2 |
|
BLAKE2b-256 | cd7baaba57ad35a93893684277a29115b9c06316129d0bdf30950a7cc11f05bf |
Close
Hashes for rina_pp_pyb-0.9.12-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8e3cb71165e3e6189779b5d35d617c0fab4d70e24f3ac67561d48989405714c |
|
MD5 | c4dee76ac042ec468222bca935c8d74b |
|
BLAKE2b-256 | 46382f47473641fbcda6f5dc8132f23223cb16904e82b8956817fa47866a71a7 |
Close
Hashes for rina_pp_pyb-0.9.12-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a6d79adc58de4921644c2834a108c9a741bc983b342636bf8ce618e159a6872 |
|
MD5 | 47883dfd62102c673bf44cfbf7cfeaea |
|
BLAKE2b-256 | d3f166c18e8919281617e7037423d9f54719e0f9d7c947148aa666ba4251af90 |
Close
Hashes for rina_pp_pyb-0.9.12-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff42f95fcfae34811d64c50f64830e6b7709ea45a496ec6e9c7d3296ab554ba |
|
MD5 | 3b7e4953ff2d8f6ce5fe42613d2d62bf |
|
BLAKE2b-256 | 8ad921406c4e74dd055ee3755d6666b4ad6364d315aebbee27822c9aaba65226 |
Close
Hashes for rina_pp_pyb-0.9.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a659aedc2006d65a3a0b2ffd4df4fc32a3825cc73011e790a8b1f5d5813a17c1 |
|
MD5 | efd67ecd50f311600972d6004acbf06f |
|
BLAKE2b-256 | 2bb4fd119472632cf63d276efc3c6d900abea2bcfcf52b371054fbdad9d4ea64 |
Close
Hashes for rina_pp_pyb-0.9.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99b9f2d6caa006b8af50963fe2c8b0c6551f6d1c82798bd909f2871627f23266 |
|
MD5 | d38edab437237fbef5bf01b14b8fdeff |
|
BLAKE2b-256 | 9b2ba047824cbb6a75b33debe6d1094d70df44f364902a2c6238cb49d20b8d82 |
Close
Hashes for rina_pp_pyb-0.9.12-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41f4d9dea07601de252ea1de5d58dfe714a183feab6dad848d967fda544ec142 |
|
MD5 | 971548b46453aaebca07eeac3390274f |
|
BLAKE2b-256 | ef240dce6345fd1adb51bafc681decd0386980bf1e1edc61723ae89828c97763 |
Close
Hashes for rina_pp_pyb-0.9.12-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a4efafc44f90f140e7941bb7b7ad837c86627fa40883a899c5140a31042a065 |
|
MD5 | 04cd6a615139f7f85c12c6c67dc1aaf5 |
|
BLAKE2b-256 | a0680af1eb43919a02dc60f09085aa264d9644374971660278d6a7d9e9ebb60e |
Close
Hashes for rina_pp_pyb-0.9.12-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2cdd0090f365fd13e4a259ca2393836d9c959c42ffb2ec687ef4abcbbf1d840 |
|
MD5 | 692e79cdeb9af4ad3f73ce7eaa156c6d |
|
BLAKE2b-256 | d3f236861e29b2bf39d494c21ec1db6e49380e15b14f45c5fa2690d9ffae7cb5 |
Close
Hashes for rina_pp_pyb-0.9.12-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67614fad9aab3537ac42f164074183775bd6fcaafc06de3e79fcfe4977e9d47e |
|
MD5 | 345270d1b5608886854305cbe1a17e5f |
|
BLAKE2b-256 | 9f9cbb87b4727bb37457c1571d31b6cbcf9496c2f7a5df3ea7a7b8c957fc68fd |
Close
Hashes for rina_pp_pyb-0.9.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c53fb39b2ddcb8f2aae7d4448664d6808297b04e5d71fd6be3dde44a9ab4dceb |
|
MD5 | 21ce1aa82dd763ba2e5ae9f276332e24 |
|
BLAKE2b-256 | ab0ce7084d53bbd231e33f88129d57ce4b6747eca8d7b428f1aa5750deba9158 |
Close
Hashes for rina_pp_pyb-0.9.12-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45fe5ab90ff0fdcabb480424596d065e63fbc9fd313f83f0741b9575d993b59b |
|
MD5 | bba145bb2e8ed93f492b4ac1aefeaef0 |
|
BLAKE2b-256 | ea566abb24ae0f4e6788a08a1e0d1bb4dd5de68f73b3189bffa3019c1886accb |
Close
Hashes for rina_pp_pyb-0.9.12-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3203dc0b7e065b798c48fe0bd710994923c0dfd4baf841d50da614fd3674284b |
|
MD5 | 749d8e3fd2b94663b9edda3cd9cb542e |
|
BLAKE2b-256 | 914bed7e24d118cdf39a9321577028f6767a3569a769fa56c9c3121a0d4ec8b4 |
Close
Hashes for rina_pp_pyb-0.9.12-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7efb1f26a4856dd1af8a4f8eb0d5531bd490162d91c4202a1c9d6aa905fba7a4 |
|
MD5 | cf41ab32d094b6f2211491e66f95f4d7 |
|
BLAKE2b-256 | 0e5327aa6ef03ace9a3bb85bd7901518c2ef85deaa5c495b748b97276d31c34e |
Close
Hashes for rina_pp_pyb-0.9.12-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6be256a36cb86fcb3c98a9a094de99ee67336d31a5de5f9808b3c4fdf5dded6 |
|
MD5 | 9496e8fda7f1d7e4a096a6440f2b9bd6 |
|
BLAKE2b-256 | 0c233404f52668d9341bb8e343529338e1b817925344f0f4b6a9c689e6f4b7ae |
Close
Hashes for rina_pp_pyb-0.9.12-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 152a0790a692383d6c861482ac27efad0100e958def1a338c97d8aaab79e9e22 |
|
MD5 | fd1bb6b1708dccb724fa1e352b8a28c2 |
|
BLAKE2b-256 | d3847e7e2fd5c19e5901070dec629a70a3d4ba08bed29b5cb15932433b42921a |
Close
Hashes for rina_pp_pyb-0.9.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4081f8d440ec005b27efb7b4df02433a1a4cff3fa02628970f45a0b77ad393c0 |
|
MD5 | 8483e28bc64f37f0e4befe4d23eda590 |
|
BLAKE2b-256 | 177cee869903b6114943f952be68fd135cd503e0e1e8dd497f48b8440ab6bfdb |
Close
Hashes for rina_pp_pyb-0.9.12-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7904655c042f7d9c4880a301b4e7f699148255fa30a97af2e7970d9b25c9392 |
|
MD5 | 6b0521b735ae31de858cfda465d30885 |
|
BLAKE2b-256 | 235c0bf838773269caabd329d664bb28f499ba53b1255f75a955cb7fda5b12f7 |
Close
Hashes for rina_pp_pyb-0.9.12-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c71f53206bf1b0dbdd2f43466f98445c05e1aa0e33cc78332e114189a4f9969 |
|
MD5 | de4968e5328bd6e4707b89011d9a5ec3 |
|
BLAKE2b-256 | 70228b3b98b41c74bb36853a75cab179360d7ce43cb3bb735b74606d513cdd96 |
Close
Hashes for rina_pp_pyb-0.9.12-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1da80bcf94dd84d712a0bbb04933443f14cd940c9d614a5f12b5a3702ed9fc27 |
|
MD5 | 6f4795de311ebed20c175c3d342e9d54 |
|
BLAKE2b-256 | c005b9e86c34bace4c0698ecb92f89da289c2eb9c41b3991c0c1a1985f9bd35d |