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.11.tar.gz
(17.3 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.11-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02cd95fb603fd001d976a296933dbcdaf80533ce3ffd24ddba317ddcb563ce5b |
|
MD5 | e520184c4fa1a4aa3f72c59ea80ce564 |
|
BLAKE2b-256 | fc866181cd9b431cfa605700943844eb9bacb6deadbff992f973751cff4c3793 |
Close
Hashes for rina_pp_pyb-0.9.11-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a4c00c7dc5cb251863e5025b072e80176f48d8b86cb88eff80f32285bd315c8 |
|
MD5 | 9911dc1e8194ad3cc93fd8dcdd8a63c6 |
|
BLAKE2b-256 | d472e6bdede0395d540e0c37de5c8dcaac18d2398caff06fea424f371e706ab0 |
Close
Hashes for rina_pp_pyb-0.9.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29156dea9430cfb2b5b0bc675049ddc8a81c75e2796e0b5228b35a0af257d8db |
|
MD5 | 95bcdc2e42988ed56a7ab97cc4a97d1f |
|
BLAKE2b-256 | c0eed15abaa06755527c135680b882477d4b816ee1ffe0bafba463c417595319 |
Close
Hashes for rina_pp_pyb-0.9.11-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81d84b5dfeee134d662350dff40804ffdf66da471b8a7f8b06977c82c57b09ce |
|
MD5 | 07f10dc0fca932c2324d47ea754bb6da |
|
BLAKE2b-256 | 7741b6943dca3b819ae80006299a57564f4e1092a1f557a68be07815eda8fa7a |
Close
Hashes for rina_pp_pyb-0.9.11-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6882377a4c620fbd887f5682cbf53371e8d6d343129be93d0cd130d89f1f0451 |
|
MD5 | 2db901a57829d9171670a63f8522a51e |
|
BLAKE2b-256 | 6bc5d34dfddc4ea0bdc2382bbbd12d22b6416f7ca8a3e6b398e10e91e1012bc6 |
Close
Hashes for rina_pp_pyb-0.9.11-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ece093dda9806853f1c582ac46d6d5b2c1afa61b388c568b5d031e505b787153 |
|
MD5 | 632c042dfb3c1ccba46e16d32247b1b8 |
|
BLAKE2b-256 | 3e5d4d7e0d866bd0e2f534d659aa5c09c8f8635f75509ce03cce781d5a6a4484 |
Close
Hashes for rina_pp_pyb-0.9.11-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1df4d8308a822497f5667bd975943169a754d8ab3a0d874607aec5a70d328198 |
|
MD5 | bf685bf0f77241f5f50eafcbab9fbb16 |
|
BLAKE2b-256 | 9e3c49134ae0c926104075e89c998ac5eb3a3b8409eec7e99bf7f625f4802c10 |
Close
Hashes for rina_pp_pyb-0.9.11-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7cb8008556deaaa7a53ceeb80710d441cd1e009802af6e5f138b8a8b8f81d61 |
|
MD5 | 10fd1e72572a108acbdcd9b3cb39619e |
|
BLAKE2b-256 | 4cad254204692d6ce9698a63d978d1c098ef2da4143050679e98f683bbc94372 |
Close
Hashes for rina_pp_pyb-0.9.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00b0ddedb918cdf3e5d60476781d97cb25b3c740ad2f08129468a80114353798 |
|
MD5 | 1ad144e7288f686190c6d110b8624a81 |
|
BLAKE2b-256 | 97db5352e1feafc5b2bf554592e56c7f510b5ff3537e6a986f04ac53d4055ace |
Close
Hashes for rina_pp_pyb-0.9.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d8ce3a145d7a0b2ebcd123d624da5a98abb1a245d46e09361e7178b347d120e |
|
MD5 | 8408fb9d577155ccee3c7b0bb5f701b2 |
|
BLAKE2b-256 | b189415d46c16bbe013b83c43a31d647c2bcfe60de879073dd50faef6d17f688 |
Close
Hashes for rina_pp_pyb-0.9.11-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d8a9be322b1eb55ed1ef3adc5cc50bee310013eae66f88d5ea68636fd768af4 |
|
MD5 | 1ff9bfd0d77f6e43e3ff4f67abdc0d91 |
|
BLAKE2b-256 | 9a2747e42e6f3ac436d202a9dd43e557457015177fe2e0e00a12d20e5ab1523d |
Close
Hashes for rina_pp_pyb-0.9.11-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aea17afb56203b70059693881f6af6e0d33dacbdd96f1b6d5f667223b23747c3 |
|
MD5 | 5927936e7948416933112ae26e29eccc |
|
BLAKE2b-256 | 8c98eb5bee92a973f8926e266924d75e7631048070c2d4ffb509e0b3c304d621 |
Close
Hashes for rina_pp_pyb-0.9.11-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e38505c1e837800af2549c36746c16eaadd57b6d4c9cd080bf09ec951746881 |
|
MD5 | 3ae20aec20ad8d302c85a9dbaee3ef18 |
|
BLAKE2b-256 | 53f4f2bc7b3a7f8bbde20f10d829d2d1af424f32871d3b9b84f5133ef15f4698 |
Close
Hashes for rina_pp_pyb-0.9.11-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab08e650558976c7b427eaec471acd6f364cba5a88ba64f1621bdd8db8c63d96 |
|
MD5 | 35b6198c5eb426db040c7143a62fd8ee |
|
BLAKE2b-256 | 4118603883e7d6302c34b1fa126d2729aed9340e28a7ca3a615a0239b644bfb6 |
Close
Hashes for rina_pp_pyb-0.9.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df3b43966e7dea152397a6f09e259dbe0d05ca6f5c22efb44148a2974f6df539 |
|
MD5 | ad88c09086b7451a42523ebda1a53177 |
|
BLAKE2b-256 | b35b398a243c2e260e6b94d3c9ade6efb0f08206897aaadd15e01796f57993ed |
Close
Hashes for rina_pp_pyb-0.9.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc446b9b9dd38aa00868b0a0d5ced700bb8370c89402e923f8a85ffc31c74d55 |
|
MD5 | 1964a3e71ffaf460c5b866c47a426fc6 |
|
BLAKE2b-256 | e767215d53b62a53768bb27c42d06919979b9890fa964db2626c43bdc1efd65d |
Close
Hashes for rina_pp_pyb-0.9.11-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce276706706d838d9b36ca275065cd9d83c160e29df97d6419b27d7dd18bad80 |
|
MD5 | f3dac9b86289c6080b2ce78094da77d9 |
|
BLAKE2b-256 | 158c3f10871f688f217219158602c399024879c17b9c6edd06d78be988734ef7 |
Close
Hashes for rina_pp_pyb-0.9.11-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bde665af2fab60532f14ca81fd40a229e40b3b4e5839146dade8891d5791b79c |
|
MD5 | b6915dc7496b749ef91d92a60fa81d62 |
|
BLAKE2b-256 | 474f26301bdd942bc89ac00615e8ac17f619e07205b2b657469e931019dba451 |
Close
Hashes for rina_pp_pyb-0.9.11-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aa26bb7958a97c91591389d6f9fa8b429a545d80f795bdb577c8b9dd2ca7358 |
|
MD5 | 77bfe8944fd8624e93c88a4dee683784 |
|
BLAKE2b-256 | 071eec2319553b53835fc22af84af176ae423353cfdd891415ca42c7d3cf36ea |
Close
Hashes for rina_pp_pyb-0.9.11-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08ff3d68df4517e0b46395c328aa084bcd8da4e24071f5f5615fe7bbcc73c131 |
|
MD5 | 16721bc06869ca3e4a8a7ff21be8c9b1 |
|
BLAKE2b-256 | 3699ce896f0c1fa3f4c9c5d2a463abcfa09fd7ad273bd5cd8710aae94d52e013 |
Close
Hashes for rina_pp_pyb-0.9.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b936773252def7b1efe81d40f156a1e640725b09b61a508fa5c98dd4b295a1 |
|
MD5 | bc6a5345d0a034c121f9178438bccee7 |
|
BLAKE2b-256 | f415d1550fa18521318987c7d66c056fa9ca47f3bc7d3d0829580455f943b1a3 |
Close
Hashes for rina_pp_pyb-0.9.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 709aac2e61c3dc85031ccf85849bfeb1dd4ca4e47a2a2f8a8bcd5213cc1c3c06 |
|
MD5 | ce14f0c7ff6790cf65c488c206e0ee0e |
|
BLAKE2b-256 | f3dd1974342f8680ec54373f9bfd7ad0bd9fd2caf8a31a99662da02126f9c3aa |
Close
Hashes for rina_pp_pyb-0.9.11-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5938c2fb02c2cac418a9085e72fce6883772697d120c7e571adb58f7d44c85d |
|
MD5 | e4a2998d231cf25b3efda81ed025a188 |
|
BLAKE2b-256 | 8a179b6e432e252c77b5a28c6cf8542d60febded02880e526378f1355a33cdc9 |
Close
Hashes for rina_pp_pyb-0.9.11-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b77676bf968c0c4a5052e9f5c552cc64fcb661c4fb43220cc26f7c3be9a2fc |
|
MD5 | 74254e9a40fcbafa5e20f5314bc993dd |
|
BLAKE2b-256 | 82491db2d0b0d6ed3976f447ab3898d4340149b57e379705e7cfadc38e89f9a4 |
Close
Hashes for rina_pp_pyb-0.9.11-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9d664e75803d628d6f28d7cd8f2861c0b3e71697cdedb6fb9a1855051cd8f73 |
|
MD5 | d56429147bf20a42cd6c1049a2390f8e |
|
BLAKE2b-256 | 5d47f045222671326f50001f3e49b7607e9cfe7172dea28b18b2c48056a31a75 |
Close
Hashes for rina_pp_pyb-0.9.11-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1583c132b20685c3dd8a2e2b2be901f9ca3bbe8364d8904273c3eba6c83dfdda |
|
MD5 | 748facfc15dcb56333c78731b1d1eec2 |
|
BLAKE2b-256 | 01aab5ab84affa28fa148fe055d48cb5c06fb1fd98a35aaa5176e97df0a56373 |
Close
Hashes for rina_pp_pyb-0.9.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9017ef46d68ff26b4306fc026b7347f87c07fd23ee62f2d7a498e0b2950a3f6 |
|
MD5 | e3db7d16dabe75f7888a115a4938fefc |
|
BLAKE2b-256 | 68154154648ebb9575a27fdca596e7b8776ee9ef378197fdc8f0c64167a1dacc |
Close
Hashes for rina_pp_pyb-0.9.11-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36e33f285fea468e16eb461e78a6f3db78a2f8c2545fc5fdc89da3ef0f3cfabe |
|
MD5 | d689ec874d3bc4fad6187337ac38aa32 |
|
BLAKE2b-256 | a2a92524bbe28568b81ef99176a4339e0e7a6acfa8b4be9ec10ab8ab6d1db353 |
Close
Hashes for rina_pp_pyb-0.9.11-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e45158a8a8e34b57d3808120cbdb8a61ec601e0d0cbf303c1f2cbe1be029c58 |
|
MD5 | 919da4e744073776c4b0766f5e6c5f8c |
|
BLAKE2b-256 | c652d710a52f141cb0f0b5ee5a641b39a6ff1b3130663d86f05c8483a2df6b78 |
Close
Hashes for rina_pp_pyb-0.9.11-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa6965a003cfa90fabb7fcd2f37ea321de751d507606d4a28aae11aa1b3b2deb |
|
MD5 | bb7e67f616cf16bf4fc7b6cb432a49ed |
|
BLAKE2b-256 | 550309a0251f3d14a7f2b3e36f45e1a89055f23d4150ec9999f8b11329f1ce72 |