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.20.tar.gz
(25.7 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.20-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da823a5a0ecd271a219994b98524e957fe95d4d033df5a8292f85f3c68020abf |
|
MD5 | 35787c077bb4bfaf5796f8320123ee7a |
|
BLAKE2b-256 | 376894a2fbd8f8df83b7f55a3e72adacb8287b52efffd84d5659067945b566e7 |
Close
Hashes for rina_pp_pyb-0.9.20-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30509a058325c81182b0b3fd9e736640cd1476976e24ee4e56736be86930540 |
|
MD5 | 9e8c98416405297234d34e2687bd2bf3 |
|
BLAKE2b-256 | 039f9a3f563d321ccb648de33f1f38c0230f0a437b44edb87923342211d13f1c |
Close
Hashes for rina_pp_pyb-0.9.20-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fdda492c454dddd85e4d37c272c58a89769d75a9d7066c26d68e8e489ad0b2e |
|
MD5 | 2730ee9da496def60edd12d3881aabee |
|
BLAKE2b-256 | 1f42d19e6d5f3e75787ce5d7d47ea818af381dd637c66a1ffc590e1789f7afd2 |
Close
Hashes for rina_pp_pyb-0.9.20-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84d5e24ad706fd85125b9d3b0b7da94a22208077625ed7a2806022436ab7bc42 |
|
MD5 | 7dc3e84ac4b1ebdc532d7c32628ba414 |
|
BLAKE2b-256 | 29a0a2de4007e9bc1ea3dab9285d1a0dd841728c976c648291cdf974ca036880 |
Close
Hashes for rina_pp_pyb-0.9.20-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37be9dae7ab773a2ebfab9ba62f95d1cf54b66a6d5126431bf2ddbb9a2132bd2 |
|
MD5 | 00a7c946a6905f3c4e806488e62388be |
|
BLAKE2b-256 | 92646517ab0b1184d7153319585ce2e16e9f1462d46d7d88506a56f2b49c4784 |
Close
Hashes for rina_pp_pyb-0.9.20-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5f133b5f8eadf50845bc8afd903ef13316e6e522b711ff229f1a8857e5028c0 |
|
MD5 | 647fb86cc740baa497bb3e358ac47a29 |
|
BLAKE2b-256 | 92f27575c8ca546b7637c4175bf47a7506caf370c248442445516ba8afe31454 |
Close
Hashes for rina_pp_pyb-0.9.20-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ced163b9f21becc4fc6d76d234bbe5f9d847586be22b9bf8880cd001f2ddcbac |
|
MD5 | 7fa9c25ac8f6b83ee25d3fedd4035d56 |
|
BLAKE2b-256 | 6007e361cc5f085bc67be7f2b5d4d1c02ba50a35ea2b460044545e2d963796dc |
Close
Hashes for rina_pp_pyb-0.9.20-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bf6c08358d0d07e6d5c51cee914f3a98f996d1d39face99603b5d09b80a5be6 |
|
MD5 | af9c1e22600b4f7c5352131f28f9fbec |
|
BLAKE2b-256 | 7218e9e5e3383743f1da32b5bd39cdb689fec679b949775c23462a93a12d44dd |
Close
Hashes for rina_pp_pyb-0.9.20-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8c018b3a3e2517056d279a8e4f7c7abf805f3f572aa606109135477317b48ca |
|
MD5 | 00da008baba79d3bbc62073decc50473 |
|
BLAKE2b-256 | ba5bcbfadb096f19e9caa03320975d8385dca175425dc467889e20e26f20e03e |
Close
Hashes for rina_pp_pyb-0.9.20-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c87f1c6ec08c73f9b714307ce8276c770ad0e66de6521e9d48ecf727ca047758 |
|
MD5 | 01811eeebd15cfd8315fed0b8d03c337 |
|
BLAKE2b-256 | 9a2f840809d416320f5e7654bb1ba4d1e53329dc00635b104ae334ad46f6b487 |
Close
Hashes for rina_pp_pyb-0.9.20-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d340423b607a9fc70124241deb9f3d87923db58676f0031e7f25768050945b2 |
|
MD5 | 945befa3e5fba2ef2761558d3b96caf8 |
|
BLAKE2b-256 | dbce7d1ef6679e18c4aa05ecaad207d518a3e527c418458291b936ff7df07603 |
Close
Hashes for rina_pp_pyb-0.9.20-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a12cfcef974be38eeecfa5824ae57fb4fcb399be232b5ae8281434daff02aadc |
|
MD5 | 522ebe7e2e4573fcf3e7ca563e6f3ed0 |
|
BLAKE2b-256 | d2dc91a5e67a8e746c1b5b931536b35edd8988fb4fc70396bb4f1f652a1adbac |
Close
Hashes for rina_pp_pyb-0.9.20-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9590386fdb0b367a2d05ffdc9c864fb270f049c9418cbbaa0b7e3508009d4494 |
|
MD5 | 24fe6522ac1a8717cbba7f095f1ce333 |
|
BLAKE2b-256 | 22f7755c4c0df5e3caecc6a50710772ab05732a457ab6095613f5c4cd9a888b4 |
Close
Hashes for rina_pp_pyb-0.9.20-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da6045cced60e5f9570bd74aca43b305ca0fdf0e2c5bdd322c14e195d7b3eb62 |
|
MD5 | 723ab8f408ea6f04fc81698402d0a436 |
|
BLAKE2b-256 | 820f7364bab6e96cce9f1ad795730fd8e99af5151b448bbcd6cc6765cd66cd46 |
Close
Hashes for rina_pp_pyb-0.9.20-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f41ca3353a724cc0661845f9087beb9090db0650145ea1d9bd3cfcbab9e2114 |
|
MD5 | b284ec958848f5886bfa7435f513096c |
|
BLAKE2b-256 | abc69e9fe100ecbb717cc9c365706f708a88f5ec91582c29a773b2db9a883b97 |
Close
Hashes for rina_pp_pyb-0.9.20-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e80fd6b1ab0be62cd42cc7d1f1e1572cc08b5356fe3f6ae1ea13ea6a53a9194d |
|
MD5 | 148aab97ddb3569e24ab201a441e11c9 |
|
BLAKE2b-256 | f7c89412d3e5c68c1269769907a31f653d2e63a9f3a50119a5fda22d1ce3833d |
Close
Hashes for rina_pp_pyb-0.9.20-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd0e886595f19a141f6b5fe0ed2fbc2b5738c34096ec455e9d73f912fa1ff81 |
|
MD5 | 46da2c805661d8fc6bbd99fc05886e04 |
|
BLAKE2b-256 | 9205c42c271ba78612e42bab02d7fbfb26c9f72aa3cd612c004b02ca043e8e00 |
Close
Hashes for rina_pp_pyb-0.9.20-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02029c9711e13795394d7fb75b39cfc36df76f3f5697c7a3cfd76669b6b4568d |
|
MD5 | 894476453e7348d8f69c682b6c03d03c |
|
BLAKE2b-256 | 7195e425e29dc8cd7ce1accb990f85368882aae83fa1a8a10a31f8e979c29d95 |
Close
Hashes for rina_pp_pyb-0.9.20-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f8180edd175484058affd4b2450a621d4f39290fb92f96776c77b3b1c42c8d |
|
MD5 | 12ce1336012c1ebb20eb4c379719def7 |
|
BLAKE2b-256 | eb09a9c242b5d2fd0da0236270bb26c0a0a6dde67f64aa0f5c5ac6adc6d39ec1 |
Close
Hashes for rina_pp_pyb-0.9.20-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 291e5a262038e6b14ba67be8b8fbc87b0ce83d8c87fd2d435dbf9b159b24ca2b |
|
MD5 | 9db24a2e16c3ca5522d29f3ca7ef1854 |
|
BLAKE2b-256 | 8418dc5a5cad02c364afdfb15b26bb428080bac78ef720fdefb4aed3309fa14d |
Close
Hashes for rina_pp_pyb-0.9.20-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd435a6d7413246184b57f11b76f3e91ffa3553c036f4d6d828c0eeb8737e29 |
|
MD5 | 912761af20056519339f1ff073ef444b |
|
BLAKE2b-256 | 3c1bbc26a405c1c987952b6189e465e31c00618f103b99dfc4d1b5e6f083c2ab |
Close
Hashes for rina_pp_pyb-0.9.20-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dd3fa79bc43cfa18616e5449b116b419fd842d1497f312b9335df7390a3a1bb |
|
MD5 | 940d793b1eb90e15854262d659a4bf3d |
|
BLAKE2b-256 | c98fd7d013fa07f3b441daadd69c13a67e245948893b048fe854f16274ab4ec1 |
Close
Hashes for rina_pp_pyb-0.9.20-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea091d8b11fa978996533420a229b6040565ffc8a293085a798583695c41ba98 |
|
MD5 | 364c3b21a564d80b4de183a1a75a3543 |
|
BLAKE2b-256 | a1ddd0e6336a0e5e68d6b43c9e7040429f04074cb35bf03830e696800cc4c904 |
Close
Hashes for rina_pp_pyb-0.9.20-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32c69ea9139cd05be2305ae41b2aed3f6dafdd97dcdf3bacb12f925e521e7c6a |
|
MD5 | 72b13fbc55cb55f3cfc52a392876e89e |
|
BLAKE2b-256 | 73ea6437982195073acec02791a4c74c6f8ec5283644c01cd47889bf597312e9 |
Close
Hashes for rina_pp_pyb-0.9.20-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27799b80c6526d8fd4b3aaaed2c1604144339010cfee462d7e582ceedd8dfcca |
|
MD5 | fd327d08bd1ed40bd3ad502a31b6ab00 |
|
BLAKE2b-256 | 844db0116814bdd6a498d9f279cd7d99851cf4bc59a83e59426e1076126cdf6c |
Close
Hashes for rina_pp_pyb-0.9.20-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d889b59b169dedba6c62658d4a0411ee8373b1993a558240e2a22a809474f71 |
|
MD5 | 7c25eaadc40b6d6fe0c6a68a3d102e50 |
|
BLAKE2b-256 | 44bcc39a576d238d9fba26ac183d96f1f074de61193eaa8b87a24dbefcedb5d4 |
Close
Hashes for rina_pp_pyb-0.9.20-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67255ce173fc585ef049790aa7af8a2c8cd8573b75ebf82b50aa2b59bddacbce |
|
MD5 | a86c1789e4e062a338cde0a71a14ee52 |
|
BLAKE2b-256 | e3339461be0d52ff90c635121a9821fb81b68f51c442d241787b9679c6bb8090 |
Close
Hashes for rina_pp_pyb-0.9.20-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8102792ddc2c7c09575ffd936a23fcb9f273cfffd3eb52f2b1d73686c8a67d35 |
|
MD5 | ae1c38c65fc9daa958a569a1f5106a1c |
|
BLAKE2b-256 | 18f077879af7c69bfc0376d0ff9f95e28c9364a2f4097dfb7c68e9ba23003d53 |
Close
Hashes for rina_pp_pyb-0.9.20-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42517338f6cbcea84894306f62044905a3e0224898720cc616f4df2c7def2dfc |
|
MD5 | bc191d9d238eca68402a7d9d604b4542 |
|
BLAKE2b-256 | b73c1579aafee17206f6b28cb8b8c14ade7409172c01fd35df22f78708b04849 |
Close
Hashes for rina_pp_pyb-0.9.20-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ee3940be4087256a5a323c49e294e0cc34d77edb7afd51111ebf25359dcb1c0 |
|
MD5 | 55c7d6d2c852e99ba722aa522b44c312 |
|
BLAKE2b-256 | 84ac99cc62ab0a66beaa3cf3cebca6ded1de8387302ee1908f9de346cab597da |