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.14.tar.gz
(17.3 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.14-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f618ea2bfb76c097d59e50b233e7eab87eb191ff8cb07ce776d0b9be1709ed3 |
|
MD5 | ea3aab7613cfccee2e9784d5cdea02a5 |
|
BLAKE2b-256 | 2f772dc23e8c7d17f8708dc768a249b1b0c8cbb299dac6e5586efe65ab564f48 |
Close
Hashes for rina_pp_pyb-0.9.14-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fb429a14142e8cff7547829d8530569c4c5b75cebadd743b22d3ec582bee663 |
|
MD5 | a6e0b40c4ce12f451e41867bbc0ecbf6 |
|
BLAKE2b-256 | 8d3ce646a70e59bc183e6e9dc8721279b3f979bab21883614e20279f5dafb6d8 |
Close
Hashes for rina_pp_pyb-0.9.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1e5d8b48a8bdb7354f6e67752d65f6ab934c51ab14b5ef60154ae93746b592f |
|
MD5 | 9a38a551eb2801724e5d8eb92f795391 |
|
BLAKE2b-256 | 3f27372be065124dab173a42f01395205f65a98d1f76358dafae9db5dcae35d8 |
Close
Hashes for rina_pp_pyb-0.9.14-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f25d0052d734cd0365a716315bb23aacc0b9557f269b05ffb1d64d22665a7f7a |
|
MD5 | ba6a14a9b178e4cf3513ee2e126fb6a7 |
|
BLAKE2b-256 | b40f701d1de79e8f66a3dbe8b1ad2f3e83873294f427da8414fca18bc9fb5cdf |
Close
Hashes for rina_pp_pyb-0.9.14-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c5768ee346541193a36f0beac62e7d8613e789a59a4b698ca74f0ae1ef6a633 |
|
MD5 | dbb68e582c46b6370e721d92d29c394f |
|
BLAKE2b-256 | e70224a086a57c351b1e3aabc96165bc28d01dd74f9627b9667b32be41d529d6 |
Close
Hashes for rina_pp_pyb-0.9.14-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7fcb794ef137f26539d63b7fcd8b8b6d8d6255d91062664485d0153a5725f2 |
|
MD5 | 04c8d32d582c68f1f0ea5126648ee5ce |
|
BLAKE2b-256 | 8c8b6d2d38631038bad45192e7bea06e0c44f7993fae4f59d36cc983edd3ca11 |
Close
Hashes for rina_pp_pyb-0.9.14-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78e5f5a7da410c7750fd96f56bda9bccf8d57528d9f19e53c82f4435b9652102 |
|
MD5 | e272f7fec722e13e045c36db76422c8f |
|
BLAKE2b-256 | d3307156bbd151da633a2857619c350842536ce12ccdc18f42aa1ed37b807742 |
Close
Hashes for rina_pp_pyb-0.9.14-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e69d50f56d6ac3ae0029479d69c96eb08b5e0c1ba2ee55a64af95e8381ccaae6 |
|
MD5 | bf025b71a69a962a7528ba11289b5362 |
|
BLAKE2b-256 | 64a2276eb3e1ceb0046f623d191cecb231fc35a1acdf602126101183bcb78fea |
Close
Hashes for rina_pp_pyb-0.9.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c271046adb5d7f43300dd948484166e9ac8c2150bbc0e0bfc306ce28d3ac2c4 |
|
MD5 | 8eb1ce83c89608484c83cddd046e04a2 |
|
BLAKE2b-256 | f0df3da652413fdfb2a62a82c026250e6db7073123e7145867ef4dbc549fe45a |
Close
Hashes for rina_pp_pyb-0.9.14-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e143420c79ae088fef9ebc79c89ab6787563f6dd340199c9191c6342da59296 |
|
MD5 | edcf9af15ad3f2c7acf2f54d65bcb791 |
|
BLAKE2b-256 | 2e0363c5176a5bacd7c25026746d3c0c88860be5d2b7e6796a28c3b2bac5db4d |
Close
Hashes for rina_pp_pyb-0.9.14-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f3dcf42f3928296f9d66dcccbbcbb5b1cfcbbb9278ef3b54c0f35872462f0b4 |
|
MD5 | 998fa518788279d8eae378f4840dbba4 |
|
BLAKE2b-256 | fd5e9f8bb4e38352d0a6ab601eec5d464d1cde25c842e82c639ec793b9fa2cf7 |
Close
Hashes for rina_pp_pyb-0.9.14-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c0ba6c96be9f8399a225b6a982d36e009dacabd20f847bb5cfd0c7b2dc7a6d9 |
|
MD5 | e865087d4e0a49f76b500493fc704a3a |
|
BLAKE2b-256 | d6e715cef203352029afe5d20e46fe44b640a431c0c6ab7628db8b8ac9d092cc |
Close
Hashes for rina_pp_pyb-0.9.14-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc4d176cdaf4c881b47842815a1dc6174aed18d1d2683483f9561d9e7b999f8e |
|
MD5 | a8a24ab7e112e37691cf02cdb2401cf7 |
|
BLAKE2b-256 | dfbd696d30c5bad5957aa1b59770185003e10ec5826ff1ac4816c2752417b33d |
Close
Hashes for rina_pp_pyb-0.9.14-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 917284d3475f69939243be0d3cc9040a03bdd2f8f3f1e1f54a047967392b08d4 |
|
MD5 | 3db25cf5b272213d7c2993726d1e276f |
|
BLAKE2b-256 | 9335b99e78a6655c1da95fdb51e68f3a102850058d2948fb8713d9b947470d06 |
Close
Hashes for rina_pp_pyb-0.9.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c3fd5aad87998cd1996e2c61e6d5e3e5f8cff71ce0ea572addcbf178e31eda4 |
|
MD5 | a6d78200b9e5fe08470d9ecc1e851b0d |
|
BLAKE2b-256 | f9cae29449be2d2d57cd90fbff1ed9e140ddc460496359c192e02d443271f283 |
Close
Hashes for rina_pp_pyb-0.9.14-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24b0b8f30364d6d21ef987a0a8e4b6febd5afa5418f8691090f6882baa62d6b5 |
|
MD5 | 9197eefd07d6295cd21ab790336bbb20 |
|
BLAKE2b-256 | b04aefe35dd21626d5e1cf772584817915471258d3ac0bd702779b82818103c0 |
Close
Hashes for rina_pp_pyb-0.9.14-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cc4a0e02945817134cee05d886e5232016dd9ed3e0b7db2889b7a65f89d99f5 |
|
MD5 | ee3d292717fc1d04f36c925691f58c70 |
|
BLAKE2b-256 | 52f4ef53fffa49611bfe570900533236c0d8285a6f27e51cbe856b512e2aa764 |
Close
Hashes for rina_pp_pyb-0.9.14-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8defaba20a3462355faf29a82062f21e2ea6c52f3dc61006f9e3f75de973bcb9 |
|
MD5 | 81de54c291d384ba7c1a3dca09ff8918 |
|
BLAKE2b-256 | 18d92cb1ffc535ab9ec467f235a5c73153a1b2ec34f3af80ca4ce09ffacb2c4e |
Close
Hashes for rina_pp_pyb-0.9.14-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b91903151e9e6a057c060648c883ea9cb031e362217da6db04bf1caf95f8e71 |
|
MD5 | a36092eec066e2415e62a0eac6bb1d68 |
|
BLAKE2b-256 | 75459113da73eaec5ebe7a1432321001c121575d1a51ac46b946e6b3ed660d66 |
Close
Hashes for rina_pp_pyb-0.9.14-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9854a3d49915c405d507fef3e76e5364454024756e1d48ec436cf432c3b18964 |
|
MD5 | b18def5b73c229cae4b8c47c4c96c019 |
|
BLAKE2b-256 | 8e2188d9e611bf6c78dd2a78fcd8d2f4359964e472c7af8308b3c6f75d72758c |
Close
Hashes for rina_pp_pyb-0.9.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceb2bac626f688a53c10b6a11abf0a9c252e97de89ee0d42743f8d7cee349a90 |
|
MD5 | 3ec13b1e6f1240e7ad0824482ee3af8b |
|
BLAKE2b-256 | 06b02e73d989fa5ed305e55123d2505a05df40169058a8ccd405667e71b605ae |
Close
Hashes for rina_pp_pyb-0.9.14-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 625ae3a8deffe1987c34a508d8be5b87e994e6d998a95099c972e50a1ee3cdfa |
|
MD5 | ba52074166145c380ef69447b38b4ecf |
|
BLAKE2b-256 | 7c84a31652173407b8509b937f9d50bcfba5a3e15581119be12ebf5f27beff83 |
Close
Hashes for rina_pp_pyb-0.9.14-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79855d8c0abe0a0fd2660cb0513181ffb76ef91932434d83bc3577b11507bfac |
|
MD5 | 1ce4a323370ccc46d4cdb2b2a701cd78 |
|
BLAKE2b-256 | 85d2f7a8bfe5477955489dbc2808aeacc94a92c7780c419f2c20da96c473a808 |
Close
Hashes for rina_pp_pyb-0.9.14-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94e5acdf015aa5b1858bcb2c86a3596862b166a5d2ba1ae2e76bba09b3e4f32c |
|
MD5 | efb14230afd3adbb8869d135f69e58e2 |
|
BLAKE2b-256 | 635009a4ae2d18af705a23153bdf3f1ba8f51d9bfb423228ea63a11bafe3a792 |
Close
Hashes for rina_pp_pyb-0.9.14-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bda5ba2dc898e189133888af85781119d88b17a053bee8d07a8b1161f7bba5c0 |
|
MD5 | 48165fe282fa141dbb6db26cf8bdb7ea |
|
BLAKE2b-256 | 8cb61e96584a6d478f013ec230be28393fa67ff4eff1fc20afc462350407770a |
Close
Hashes for rina_pp_pyb-0.9.14-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29011a7772eddee451d950571c215441946bbde358520ffcdfcd2854ea0963b8 |
|
MD5 | 4a204642a04db06ce06188dcc07e6a44 |
|
BLAKE2b-256 | dad7a47a5f09e3b2f4e08fb428d2137b965b5f75891d6eb9c6d1182ffd839bf3 |
Close
Hashes for rina_pp_pyb-0.9.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8458b27c35f956d80adb72515166e3b8a37bbb524156fa27bb2e051dd29a3787 |
|
MD5 | fd289b8176f800844390b1313bb4bad1 |
|
BLAKE2b-256 | 5d413dc464d547d2face09c89b74a8070fc4e03e34115a19ea2b40aa009434e9 |
Close
Hashes for rina_pp_pyb-0.9.14-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd18adf171ec6887641aa6f33c3d8842b63465a0f6cbe2c58cbd3b18de58cb3 |
|
MD5 | 6e1a67db892c0e52e455c01bbfebda08 |
|
BLAKE2b-256 | 49a9f527775f26905fbb7c4b156e2fd890a336d6d2fc747412ac100712b93938 |
Close
Hashes for rina_pp_pyb-0.9.14-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce006d3d04656ca97f13636d823fc27aae4dee3af462ab094b7848e69256b926 |
|
MD5 | 9d00142b5280cfafd6121d1b54adbcec |
|
BLAKE2b-256 | 68bbc3adf0879dcc3aa26215c2f53faa88775d6d7cd63ff535dd928e3a9b4ba4 |
Close
Hashes for rina_pp_pyb-0.9.14-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5a28f15744192f027063beac62434c176713ab2595097731176e01fb576536c |
|
MD5 | 2bd825f17b45e615d5766e7a434cbf8a |
|
BLAKE2b-256 | fc61cea6b00a8c0ccd910f36529a5cdadac5ceac0fbf1f706ac06e3350464c21 |