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.7.tar.gz
(17.3 kB
view hashes)
Built Distributions
rina_pp_pyb-0.9.7-cp39-none-win32.whl
(327.7 kB
view hashes)
rina_pp_pyb-0.9.7-cp38-none-win32.whl
(327.9 kB
view hashes)
rina_pp_pyb-0.9.7-cp37-none-win32.whl
(328.1 kB
view hashes)
Close
Hashes for rina_pp_pyb-0.9.7-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243251badf4482595c462e108d9456335dbf95f8c4fab869eb124cea199e4288 |
|
MD5 | f02db37520b8f45b830aa12e0b5e2406 |
|
BLAKE2b-256 | 4c7f6f34530aab304b614a0bb73ba168c1e21d0112135c6797b2d9d01e121f69 |
Close
Hashes for rina_pp_pyb-0.9.7-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a21cbdd11e1084e24dac7a71c19e0a9f64f7908a40000bff27640c6421d85bb4 |
|
MD5 | c8ea8c669da7cf5c5dd1a7512b6562a2 |
|
BLAKE2b-256 | 1bfd1473036f41ad4981e82e0e3e9c3ba33743fec29665c9046ca9dc857a3f08 |
Close
Hashes for rina_pp_pyb-0.9.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 141a4a1e1da01091d1679e95dbaa20d8cf56d0010acdf4aaa36e2a3169bbe1f2 |
|
MD5 | e695fdd4b57c4747902bca5e0ee0769c |
|
BLAKE2b-256 | 4a5aed59c2d234b5988c101eb8fb9076a81bddac9e345b7b12cf466cb44fba7a |
Close
Hashes for rina_pp_pyb-0.9.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f006f0406c05448c608b34d2bd7062fdf6beee5762f6c28f7a04a0ff87e3b497 |
|
MD5 | 187903d2cdec3e74119a13c9757c33ac |
|
BLAKE2b-256 | ae80a94f8f66d4df67f3dbc617fe00d1d56dd7f494cffd1d9b395e405c4d50ec |
Close
Hashes for rina_pp_pyb-0.9.7-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dea942300dfd1a2535d0ab1d7d54ee87d3eefd00dd946bfc343de440329240e4 |
|
MD5 | bd69decca5ff34ca8fcbebd8d16849a4 |
|
BLAKE2b-256 | 8398e1cb7b30a1cf1f8d046e24ad82e0bef508a7e57b485463642e5a897565df |
Close
Hashes for rina_pp_pyb-0.9.7-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59b56cdbc4c5ed2ff15118bc744c531f569def9c2e8e40736558bfd490d8c9f1 |
|
MD5 | 1fc73e40b4872c60b20d94bf526072b0 |
|
BLAKE2b-256 | 20b763aef795b77051004392b346a3f16fc9ec5f6f6590a18e109ac673014dcf |
Close
Hashes for rina_pp_pyb-0.9.7-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4874ea0c7cb756e15f387bb2e116d89c5da8a2b321f83b8d2180d41cd8a0f9ad |
|
MD5 | 96277e7a3e098516ea103d4a741b6301 |
|
BLAKE2b-256 | 40a0e3f5da7968e3b25a7e23250f19032ec1ef0c0fa5be8f954fc14f3c22b5c5 |
Close
Hashes for rina_pp_pyb-0.9.7-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 227523c2074a5172b0cd7b5b9e98e6d2f8b6eefd6516475467390df8477a1329 |
|
MD5 | b90ceb2999ac99bdb7ee22a2173927bf |
|
BLAKE2b-256 | b6ee8cf37dd2e97f1e0a495ac48fb410cd41b01e4e2908ac50fbee2fcb3b4274 |
Close
Hashes for rina_pp_pyb-0.9.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c808df1f2d02046f5eead94ccfe5b0709fd58c578a9c66e24ba14ac59f4107ef |
|
MD5 | 3620bc69caed995a5f99dc0cc339fc5a |
|
BLAKE2b-256 | 2c20d392924569e6ca78ad78b61db16fb8dc8ea330c582ae324b9665e9f7ae6c |
Close
Hashes for rina_pp_pyb-0.9.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a666b625b303694725dd2f0d0d3f8b835c2f0446311f9ac370313e35667d94e |
|
MD5 | 3b8d028d74dc6615159e2007be7d65d8 |
|
BLAKE2b-256 | ca7e81b63ff763eb804ad0018d20d1ba1089c641787e9c3c0e6b53b7911a2dab |
Close
Hashes for rina_pp_pyb-0.9.7-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3ec69df39902fe87b1797eda348f8332c3822d7efe7b0479f5c99488f02a7e9 |
|
MD5 | 3a84cc864118a63aab0b3edb3a267509 |
|
BLAKE2b-256 | e7d7779ac8795bb1487a8bf82d10c8e42bc0e763ce440e1e1154d1b5ceeb353e |
Close
Hashes for rina_pp_pyb-0.9.7-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59f003a0da4e68ba1ee7d3b340801a05ab8132b7b12182fcf5da3ea71abfa5fe |
|
MD5 | a6a0691bcde107006faf40a7ff83a3c8 |
|
BLAKE2b-256 | 302603d9d06d4f1b2f8eef2b43cc66db06baa7feebfe5856d982f0c8dfe0b3fb |
Close
Hashes for rina_pp_pyb-0.9.7-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 154c855ea6fc8e4d70044ff4334896f25083c6c46f3cfa3564f7a682d4db4efb |
|
MD5 | 7de8809a07db8b126cce390a24ef31a0 |
|
BLAKE2b-256 | 6ffdab098daf10ef38a8b71e4d6ab8eb1d5876e1486a0332eaaace0f17bab409 |
Close
Hashes for rina_pp_pyb-0.9.7-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f27bc369c88a17551cf2e9086331ac946901f8e89d0b2e6a48e820d5b286596a |
|
MD5 | 7f1c0906aa8f4198858751fbde883ff2 |
|
BLAKE2b-256 | f9a4bc1352b95f72280598c0429fe62482363ed0e0f4f7ef37027b1e9a2a59cc |
Close
Hashes for rina_pp_pyb-0.9.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33c896d0f20068c2e387422645cbae6004b1ddecc22e5c368963a76f79a70907 |
|
MD5 | 2d3c498b8bcbca965f5447150d6323d2 |
|
BLAKE2b-256 | 0ad5fd9401dd30fc88f0e40a348f1b583ca80eff177abd3f670163b2483823d0 |
Close
Hashes for rina_pp_pyb-0.9.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cfd639b70540273db3ec17e36f7b30058d286e3ed138951af26f08accc3dbe5 |
|
MD5 | 454a8cb9c0bf2a07f191e3de37356ff2 |
|
BLAKE2b-256 | 0642498febe1d12fb4d30c7d47926c3585f431ec0a6532d18db949dae2f99d5a |
Close
Hashes for rina_pp_pyb-0.9.7-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a58a6a53f401c41bf3b1c0d7f581dffeddfef67441f7210638d33e186dbe5bec |
|
MD5 | 0629718b28cf355e922f7adf4a59f4c6 |
|
BLAKE2b-256 | 579b3205c53058895ab503de4db138cb3b37c3ef5b50cc8ae71bda1639164690 |
Close
Hashes for rina_pp_pyb-0.9.7-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbb2a3f509b4e5a30bc1e9c47616590cce65fd94445744280bc2d4b4a997ea60 |
|
MD5 | febfeb0af3a1de6f74887574ce8d0ecd |
|
BLAKE2b-256 | 109ba0e39e8de4e35929bfcede1e7b4853aeddd76e7fef22e95a80ffa1e72ff0 |
Close
Hashes for rina_pp_pyb-0.9.7-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03cb7d9ba5520efc88a7b3be48dd959e76ea7257f3e3aa5bc4b8fcc64e8f4ea2 |
|
MD5 | 147db0b8a80b6a137b63f2740d2be85d |
|
BLAKE2b-256 | d4adb7acbaa27dd365ef3457ef1c5fc7c1f4dd706418a221dc2cbb473e4308da |
Close
Hashes for rina_pp_pyb-0.9.7-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de079bdf8f8b61d873847d4c7b37020840134b33e93a39637b0aab79e2634175 |
|
MD5 | 20830c529cf0847781e3ac01a802274a |
|
BLAKE2b-256 | 189236ef9bcd373383cf04daccddf17291899cd026b02d804bac872f936be6d5 |
Close
Hashes for rina_pp_pyb-0.9.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75fa41000b3375592d306c177ce7fc7e31ae6cd89b346645c80a9a842fce05a6 |
|
MD5 | 3997f147289b4e35c2a8f47f0353c33f |
|
BLAKE2b-256 | 30122ae1fa91a9f32a08594005980ba283caaad26e2d23db31295ea66d0af54f |
Close
Hashes for rina_pp_pyb-0.9.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bb4f40d7929b6dc18941137ee47ba892687ef8ca3f80d0011edf5a1c25e1542 |
|
MD5 | a291b62d8c04080d33e93e185974f73a |
|
BLAKE2b-256 | 74bd7a0d0eac4312dc18b5a438cf5d40086ecb42bf3d4303e8805db034ca84fb |
Close
Hashes for rina_pp_pyb-0.9.7-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b9d953d73fa58e37342d16aee4fc34e9b65d3ccd018d2e02f4a9a4ff2ebdeea |
|
MD5 | 0a471511714fa0b6131f9d560a69690f |
|
BLAKE2b-256 | cccdd2f703b8cddf202dd2bdf899a3a7004c7affaf9eb001a81b6d031d36988c |
Close
Hashes for rina_pp_pyb-0.9.7-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f5a7212c6c76f1e64fd9a2db27e6ce37fd9f4f1e8ea0afafa5ddea3282b8424 |
|
MD5 | 16f3dfa2465827ad789ee863332303c6 |
|
BLAKE2b-256 | dfba9dfbca80b7037a6c113fd8e7d830bfbf2d3950d544118418d07f36b80bbf |
Close
Hashes for rina_pp_pyb-0.9.7-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ff9cf01a372fc3cf98f80b544199254c2d7a419b76df450f7968f9861af27c2 |
|
MD5 | 4496919c05b2eda5e75c75703590b85f |
|
BLAKE2b-256 | f3f894bdd736dc38837e4c5b43f1798015cb4dd4fdcddb4d57514f35e7863eb0 |
Close
Hashes for rina_pp_pyb-0.9.7-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8826a4bf552321ee4a01c42b8f9123f44f6049ca68bf8b81195e04e07fb88db |
|
MD5 | fd65fac59033027d489f2ebb05f7ae97 |
|
BLAKE2b-256 | 16aa59e03e53f7c1f7218213a10bf1ae03cf18fca286efe9900f356b0c79b165 |
Close
Hashes for rina_pp_pyb-0.9.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f48996ebd8687c2d056c018c504be0cf75e55faffabc8ee3886ec0663387ef90 |
|
MD5 | 767df9f19fbc324ed107e71346675f86 |
|
BLAKE2b-256 | f806ef2af7353f3f74409666540331b737c624c3fa96d5215b9c9f54fc864f25 |
Close
Hashes for rina_pp_pyb-0.9.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97488e9d15fd140e29c35a8f896b8fdd75cbbcc0d9024c5628637b3de4efac45 |
|
MD5 | b02f7e7bbf904b579cb70966c1ebdbd1 |
|
BLAKE2b-256 | fd0b60cc3f0a3e8edcd830de7f56e6e4bcaea1c25950e53bf2261debfbb4fb9d |
Close
Hashes for rina_pp_pyb-0.9.7-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fd2ba0980cc9d5abfa5e61f9f7dc0620e1edaf00902a1d530ef6a9852a829fa |
|
MD5 | 3e470df53abf4768f1fd03f81ed79047 |
|
BLAKE2b-256 | 461e844c83e68e6fc9e39d407319e1ece12bb20f43c93a1b2876bb924688e1aa |
Close
Hashes for rina_pp_pyb-0.9.7-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e45c5bd4724a99489f70ce2b599436c2fe6ab7ae476030c7ef5ee016dfce1cbb |
|
MD5 | 71969ee2a12c8227616b6f4b5f9f9ef2 |
|
BLAKE2b-256 | f423b1a5ceb702e8f95deaf27c5fc8243551ddc9bf487898a599706ddab0e23b |