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.24.tar.gz
(25.9 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.24-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5561944be04ca7eee758709351c6a7f3845609a4ef372925c33a73497bdcb774 |
|
MD5 | 27def0f3a8549b119244987ae0eb659d |
|
BLAKE2b-256 | 6b8169f7561c1a28dc171323e8ccf0bf2a02b7a4eb0de48453bf212d23d20b7a |
Close
Hashes for rina_pp_pyb-0.9.24-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 412972ce315c3b31b4062f22ebd46d0cd4f18eea3e8d8ee5eae82af4819696c2 |
|
MD5 | 0194c7a469ebc906dd244bd2741bbeea |
|
BLAKE2b-256 | 8303b89465e86e8c6ab787ee004435d55dd6b517eb6e579a449ff9a920799d30 |
Close
Hashes for rina_pp_pyb-0.9.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3e8e82cfd13cc9fe52e83ed5bf4634b6a1f0f507cb8f970815a17aa0a485860 |
|
MD5 | 44189c72c9bdf86f52be96da6693e880 |
|
BLAKE2b-256 | f3676bd212d2d715df59b3ad222468ec70601ed7a3646b0eadfb369301390bea |
Close
Hashes for rina_pp_pyb-0.9.24-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72aa5481ca6a021ee77ac9ae0e646c2d2018b5cfc36d067bbd8a71734f1f32b2 |
|
MD5 | 5a2e0739e144e2db465dd53020172882 |
|
BLAKE2b-256 | 88f9dbb0b6af3a4176b4f588f0e062598cca2486a738b19c39f96997649d6ef7 |
Close
Hashes for rina_pp_pyb-0.9.24-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90c0f08b9a3e12a37339eba854bcc1c597a1fcfab44ad76254cb496d9db4d8cb |
|
MD5 | 9d24127df23e191c8c7d9a49d2627553 |
|
BLAKE2b-256 | 364d163cff5dc8949c5b1e1f83b55cba06145784f78eae9274a4c31483276590 |
Close
Hashes for rina_pp_pyb-0.9.24-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cb406f376a46508b58a5cbab1a96ad1ac1a6cf7f6dbe8800bf56727acc5245d |
|
MD5 | 691b64eb85e37b63b54a6fbc4f185e73 |
|
BLAKE2b-256 | 6374adde5c549d87d641d48a0e1a527ef133fcf5a6427589c682ed603fdc4f5f |
Close
Hashes for rina_pp_pyb-0.9.24-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d84f0044c076703779a0fc38340882102ae1b1125563cb34c41b2f5c19eae9cc |
|
MD5 | 0b6c68ed31a0468f33f85e3181c94416 |
|
BLAKE2b-256 | 6143e4bf16f26d782117d9040cb4c881f66bad7966f06c1d7b74dc06166fec51 |
Close
Hashes for rina_pp_pyb-0.9.24-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c034285bc75ed892cbde77159e136419edd6a4c7f66a515184e70a4c2459681e |
|
MD5 | 6e268e685248801ea7bc74f248afe09e |
|
BLAKE2b-256 | 6315ff34d556b1b0606432e96c2344c417ffeef0c728532aa558bd2851b2aa81 |
Close
Hashes for rina_pp_pyb-0.9.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d79fdcdf6d02172dd597756fdd6e9ef197b45dfb1a905eebd6f874b86348a737 |
|
MD5 | 0d628ee97b26d7f46b1c888a03571578 |
|
BLAKE2b-256 | 61db3f5513b6cb85f6fb534db048340d8e933347730cc7bdafb4147f24ba1fb3 |
Close
Hashes for rina_pp_pyb-0.9.24-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4f321c03c407bcb1b3a4887b35e29d7c3e1037c9782a06b31de415d48345b1b |
|
MD5 | 0d3299c5e6650a07b1a40df748001741 |
|
BLAKE2b-256 | e06e5069a915f72c47c18d0980ab76a52a555590426ea7f722d0d5e0df75e5c5 |
Close
Hashes for rina_pp_pyb-0.9.24-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f349a29ce958af8d39e204d79513723d46991b292a9c5ff189b043662835b94a |
|
MD5 | 6fa4ce639bdcbff1777c406e56fd10ff |
|
BLAKE2b-256 | a3c164ce8989207e8a88efd7a6298693655df213a3937598f8854dae13fa93dd |
Close
Hashes for rina_pp_pyb-0.9.24-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0675ef4e13028d6125c1b8a451802ad15fc3516a76e8be15a07f03ee0738afa1 |
|
MD5 | 2f502d32d086f42b1e5e36d2bbb6d6c5 |
|
BLAKE2b-256 | a275aa6b528fecae49b1ddcfc22b6f0fdca9a8f4d2c31ed0904001d03fe660c5 |
Close
Hashes for rina_pp_pyb-0.9.24-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8308ac62ff5d9c561a8279086f6eb6ef4f6118528d4b034b68f0bc57229cf4c0 |
|
MD5 | 4570b1d56259a4d22c181066ae6998dd |
|
BLAKE2b-256 | 1738e172fd7fd3a15ee932b93d22d4780902ab47a2c50ee1e53cedca757ee709 |
Close
Hashes for rina_pp_pyb-0.9.24-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 840d8c0aedb08daf07500387159a66455ce4d9c73284bc72336f790f83854cbc |
|
MD5 | 03080546b12f59c455818babec9de118 |
|
BLAKE2b-256 | 99291b13bd65d8b359ca31ec14dffa24e14ecceaf4e3d97c54836d9c76b6a7be |
Close
Hashes for rina_pp_pyb-0.9.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41b558c274d0617a6a8a08c1c969fa3b038579f7377910e6de3e74eff1ec5f10 |
|
MD5 | a2a840c75f7d7401f965efa138c9217b |
|
BLAKE2b-256 | 820d47bba35498df43169ecc656602ddc131127dff4ba0aa2685a8bc6b0a3f70 |
Close
Hashes for rina_pp_pyb-0.9.24-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70211d2c724fbfde70d535c97b4da4b7b775b101b2d858ec0df34e4e79e8527a |
|
MD5 | 151d6f15cb475a2d30567378d4ac4478 |
|
BLAKE2b-256 | 6ab9f6c16ad4c5382e9ad2796938c60515b85c4ef574739c528c2b1ce23ae76b |
Close
Hashes for rina_pp_pyb-0.9.24-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2646b614096bbd46aca225bf26b4e3c2c1565e06f0fc2057be303bd09e1fb36d |
|
MD5 | 8dc3cf44ae1324b0cf879d257b2e16b1 |
|
BLAKE2b-256 | 9e895c914c5222a10a46efd6650ef1bf835d6a0cba8d51199a7285808ed1e084 |
Close
Hashes for rina_pp_pyb-0.9.24-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f76a20f858057568e9c48017374feb616b1d785892501d316248ef847352c8a0 |
|
MD5 | 69a8286754b752dcbbfee97aa27b1880 |
|
BLAKE2b-256 | dc4c92dc63701d4bd88cf6a21ae2853abed937679dcc21d549a3d8d10fc2bb70 |
Close
Hashes for rina_pp_pyb-0.9.24-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e90716d6d3c4ad892c5a1d89fd789d0ea511c96c90574f401e70a89d7b34eee |
|
MD5 | e49491fc99d2b9aa622c86f0290709d5 |
|
BLAKE2b-256 | c7dab013982c225a45717ee28698a947c88f248f9632eb391a096b2f5476c178 |
Close
Hashes for rina_pp_pyb-0.9.24-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04b6c3f345472f5dea790d33347111bc7d6fadb1137b4f3d5a3ac8b9f0cc5373 |
|
MD5 | 7d25dc939d10f8fd0400f5f0bef0538b |
|
BLAKE2b-256 | a52bfd991d6daccc125c0c7f1b28fa9d1d76bb9979488d6e40512d07f8e2e667 |
Close
Hashes for rina_pp_pyb-0.9.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51a226b6d9b238e5e6073f032d945d9d543754aec1f75f05cf60f4107cda6dfb |
|
MD5 | 55bfb0a6ae799b200c0f75b53b5f260f |
|
BLAKE2b-256 | 68d1197383e9cfc64c079f062cef25c3ec1582357d5c1e5c5544bf5689d0633e |
Close
Hashes for rina_pp_pyb-0.9.24-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ffbab73a6ddb9b6635faab7cd28077baf78a146fcea9d5b00a7fbb5b732416c |
|
MD5 | e8f5b61d66e8826bae796f257315f02f |
|
BLAKE2b-256 | 0452287f750b42e3cad06335fc4917b91fc7d583c780077c73f5fb726d3c2d14 |
Close
Hashes for rina_pp_pyb-0.9.24-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4a808b79253b8477205696c8b693b00d56bbca2c5a3f0068c9fa9d298f2e460 |
|
MD5 | 04d586ef8084de05c260d672c0aa421a |
|
BLAKE2b-256 | f9c2f1f2068060ff27df051eb556c1f540a82a60512fcd50a1aa23deeace3160 |
Close
Hashes for rina_pp_pyb-0.9.24-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 700edabdbef1dbb58bb1e3065beda977d23064f396faaf2fbdc1b5b11d94384c |
|
MD5 | 0b2bf63ac48cff6bef4d4affa9fb11f5 |
|
BLAKE2b-256 | 41c940ab69e07f56e5eef91ec0f8e8b0179ec31733fb8b37358b657914d26c3f |
Close
Hashes for rina_pp_pyb-0.9.24-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be905f26510e42d404684a3ac72b5286e32ec331674d3480abe99d7cd555a0c6 |
|
MD5 | 366d2fca32370b81daa1cacf8e08c650 |
|
BLAKE2b-256 | 2d001deda5fc92f8642d85b07c106b8ca1b65b4fe7e44d5ace0b63164284969b |
Close
Hashes for rina_pp_pyb-0.9.24-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f62cd823edede23b938bd89c163050d011e170216189db9382811d5e0e25843 |
|
MD5 | d2f36ab51850f96b5260556795407477 |
|
BLAKE2b-256 | 613285f002f2cb47d83a5ff92a8efae0f20e660121529bd29d22b9ec7a2f3710 |
Close
Hashes for rina_pp_pyb-0.9.24-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae9f0b57df6c610195170c1988808d08cde8a078103543bd16c63ccb3583c82 |
|
MD5 | 50e03da26288d10e65f02b39a8609d93 |
|
BLAKE2b-256 | 425ba86fc45926b90ccfbdf42cf45b608e593ca72a4d19af5ca04c4932999ca1 |
Close
Hashes for rina_pp_pyb-0.9.24-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed9803434166b54f264124db9958f8b34a1b8b8a4d378781087f3da586287cb |
|
MD5 | 8ca28fcd373a804af0dbc3bd4a190cf6 |
|
BLAKE2b-256 | a87abdaec3bb77995cecb4041a30b95343a005fcd90fd23c33a93579c4290a9c |
Close
Hashes for rina_pp_pyb-0.9.24-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfd63805d871c65964b13cf74d7b463d3e760cfeef5b6733cebc82c63bfa0270 |
|
MD5 | 961784f9597430b9c26ef0f3a5649bba |
|
BLAKE2b-256 | e122b1937d37b4a540db2f96e401fc911e751e0dd235b91f161c7d48e49232b6 |
Close
Hashes for rina_pp_pyb-0.9.24-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7055eb7a7ab8c6b9c475649e44cf9613d006f73fcb4b930eedf48d59974d192 |
|
MD5 | f27cb895de4956ddeae8a8d46b464702 |
|
BLAKE2b-256 | 7baf907a217cc50958ed519351707bda337208f03d1e455d6f326721659b1cdf |