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.5.tar.gz
(17.3 kB
view hashes)
Built Distributions
rina_pp_pyb-0.9.5-cp39-none-win32.whl
(327.6 kB
view hashes)
rina_pp_pyb-0.9.5-cp38-none-win32.whl
(327.8 kB
view hashes)
rina_pp_pyb-0.9.5-cp37-none-win32.whl
(327.9 kB
view hashes)
Close
Hashes for rina_pp_pyb-0.9.5-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 126e81afac0748bfc52a821e271fc594aca7b195b9b7259194e38a558c58c340 |
|
MD5 | 30a9886a6002bd6024c1820a4a6c0f96 |
|
BLAKE2b-256 | cd57f9459ac09162710a839178f21a7a0e89a15dc839fa72d2f2c1e3d28afb2c |
Close
Hashes for rina_pp_pyb-0.9.5-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ead1961ca93e634fde544d754028bd9ce85beeff44dec5c2ca356d8713572dcf |
|
MD5 | 0737c41eaf3d68f30a6b8d6993db3de6 |
|
BLAKE2b-256 | 57df604072f5565204da17c3153ee3fe990bcbc45f9cb5bc9b7ad7082273fd06 |
Close
Hashes for rina_pp_pyb-0.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 681630a6f96109331f0b70228cbd62d081fd7cc46d9bb36c80df8613a7bfba65 |
|
MD5 | 9d75b4a69552548273883be3c272fd86 |
|
BLAKE2b-256 | 6769a4289ff8c7cb54aebb0e5d4b747fa1096178debc478460785991a359efa3 |
Close
Hashes for rina_pp_pyb-0.9.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e9e58e6b50d5d9c8b2dec4c17c7c50e42fc4efff1c410ac7a960b8e41fd66f4 |
|
MD5 | 03ab59c9c48394658b80bbfac5f01070 |
|
BLAKE2b-256 | c8c94556934a5b816fa92dab4370253b35288b61aa868014a71153d97bd86671 |
Close
Hashes for rina_pp_pyb-0.9.5-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 382e6fe41a1ea0f6820a6363ba8e697ad4857e99548faeaa1a59a25076884870 |
|
MD5 | dde5e68cceaceda6982cd85bb9dee773 |
|
BLAKE2b-256 | 17a167af5d2d2456685195783cff6deeb8ddc29c7f0d3a0bca24da9b781ec2e4 |
Close
Hashes for rina_pp_pyb-0.9.5-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52e6061fc7431a56e285ebeab81ce15114afdfb51a421c9e61db5b66faa2c5d5 |
|
MD5 | b45aa06e0d2bfe49a5f3f768584720d8 |
|
BLAKE2b-256 | 5937abab79274c87cad252bfe596eb4572eef40ab23f36a5a6c5149b1e6af14b |
Close
Hashes for rina_pp_pyb-0.9.5-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 655755e9b3aa56da8b77a27fedcb34267b0533c2922efdbc91151c63c133dee5 |
|
MD5 | 3a0e1d41dd8474eaa178547a516a6d30 |
|
BLAKE2b-256 | 811a21aff63c73527a6d3e49a316a1d52a3256ccfc34b85c3683ae2012f624c9 |
Close
Hashes for rina_pp_pyb-0.9.5-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf75db317ece6d25842a545beac26921e87f92ed1de7a601bbde494039d13884 |
|
MD5 | 2b60ee7c00a293a627064bfb91713558 |
|
BLAKE2b-256 | 41805e08d5de72ba73700ba78757d18409d5b78d4560b8d1aba30c084ddff996 |
Close
Hashes for rina_pp_pyb-0.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1d98d8576a2a6e85b579eb1c95caa6c9dfaabcd31ddc4756e84fbad2eea61ea |
|
MD5 | a05118209f28a4efeeb1bb28cc59cb0a |
|
BLAKE2b-256 | 5a5e185a007401dd4961dd099d1c02b2f09e7fcd0ba997af2ea370450fe85cec |
Close
Hashes for rina_pp_pyb-0.9.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef0e599ca0a8ee402dee196594398daad5361f2c5969a59f6939c5829453cf74 |
|
MD5 | df6f16c31e2d6d3cec4c76ed14e4e0ee |
|
BLAKE2b-256 | b5d5960679641a72f9b36056a86b968d6dd3c6ef22440154487f967a2c129d43 |
Close
Hashes for rina_pp_pyb-0.9.5-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6975d8cecbfc7b7bf6cab35cae2f7f75b078b18fa75a960134d35da2b466d483 |
|
MD5 | 06bdad76b35807396d8190332630c512 |
|
BLAKE2b-256 | 1728d6406aa160e3ca5b52eb7221773acdc3e86918031a479b00cfabcf1a63fc |
Close
Hashes for rina_pp_pyb-0.9.5-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e9a84dab364993e9f2fdb74c3e75519fe16aa2d1400d83e2a3fc0a8ad30f593 |
|
MD5 | 57e91240237749ed705174962d9ddfb9 |
|
BLAKE2b-256 | def3bb72087e9bbe90bcc003dfa5f1af73c7b8f4e0e3e24bf84ec77999ee09b0 |
Close
Hashes for rina_pp_pyb-0.9.5-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c3ff28275079c57a095b60a3e26216dfd813ff54634bba5508c7792640f0375 |
|
MD5 | 0ff5bf4b261d717dc28d301b9e53b934 |
|
BLAKE2b-256 | 5ab7410b26e8cf958ce199a9a9dd0bc50de23c59e7b992822d9a728d1b46f4ad |
Close
Hashes for rina_pp_pyb-0.9.5-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 040d55577898dc9f2b6fba8591d560aa0bb358208b423711d604644fa4d2e243 |
|
MD5 | c95909ef721e819e11021eab2771ea96 |
|
BLAKE2b-256 | 2cd644944dc02912dcf722bd288fe4463dff2e1fef71b8bebab8e369432c9920 |
Close
Hashes for rina_pp_pyb-0.9.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 348d42cb7246dc8d6efc932553f9392621dfe93e59a94cafb843c972148915c5 |
|
MD5 | 17ac12815a057165016c7b8429363c95 |
|
BLAKE2b-256 | b01dc6d737c0a067e96cf39c2d2fca89c851995a571b91fc9a8b220ecb11b1a3 |
Close
Hashes for rina_pp_pyb-0.9.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c82d95f56b56abbf3e090387a6d915b60c94a7d046af8652e271acfad221d937 |
|
MD5 | 4924be38de93a310279fb647f7252c58 |
|
BLAKE2b-256 | 2fe4b66f90ee3b839b5c57084072a34297d4858118cd1171ff62f63646313899 |
Close
Hashes for rina_pp_pyb-0.9.5-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecb2108f28b656f442573530242941da5342f4ea044433ea8e1944e05ad78b2d |
|
MD5 | 1d7bde3accc3450225f6b6f60aff2519 |
|
BLAKE2b-256 | 95eba08117f5fcd1ced2bcfdc66078d082fc21add613148874f3a88036e14409 |
Close
Hashes for rina_pp_pyb-0.9.5-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2eab2f989b31b8c4e97bc4d6cfc78b6bd826e3e6a4f424271dff07244211ea9 |
|
MD5 | 68eba93194125cc3c58025ca3c8bc2a3 |
|
BLAKE2b-256 | 29646abfc22a4d6afb344572b20beafb25f0287ac094ff586d227b0bea110f67 |
Close
Hashes for rina_pp_pyb-0.9.5-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d64cefca6cbe8fcd161db89848f457c71e6835626baa5f1233d504eedab919e |
|
MD5 | 53b671a4fef76e8c79c93aa5ca01ba9d |
|
BLAKE2b-256 | 3b4ae052d70101dba142c003e2e070ac92e13bcbd91ccfd2b80ae55d75d71a81 |
Close
Hashes for rina_pp_pyb-0.9.5-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 679632a93a659db94cb6e31ce53233b3005edce897a94f7c91d97b8f2cb196e7 |
|
MD5 | 89c29b4905ae2889db0e420ef32123a8 |
|
BLAKE2b-256 | 87297b0ee7a01f3118328d1a715d371681ac499628ef90dc81c2a0dee4e64340 |
Close
Hashes for rina_pp_pyb-0.9.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11b984c6b0fff1aa6d3d47272dad04e3dc86be9a4ee40c05f354f592f8f02d87 |
|
MD5 | 65d91f2aaa420f501a7e60bef51084f2 |
|
BLAKE2b-256 | ef5ef6058ac8f81f1379ad85f22ea2e0791fc95a5c1c62da6de17dbea9fdd841 |
Close
Hashes for rina_pp_pyb-0.9.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 724a562ff6449827c16d0f98c8f92a87cfd3e24a0b553a3a63345400783fd552 |
|
MD5 | a122fc84ed0a3b2a5f44350851e77daa |
|
BLAKE2b-256 | 4ad01038ede71acbc4b92489b8372f2260fb15557ded865bc3c8125f6a2ae83e |
Close
Hashes for rina_pp_pyb-0.9.5-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8220abbb2c62206a40f7db100d69ca7ae501aa94b9929a079e7b709a44e077b0 |
|
MD5 | 7c252ea8126ae3e9fd440e75e4515810 |
|
BLAKE2b-256 | 0db87c4efbc56fb75eb44651b456befc7ed25ae9ab62e4025fc032db9acfee55 |
Close
Hashes for rina_pp_pyb-0.9.5-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bf88da393e36cf3a3edc52b6d60d1d06af03286265939f251140237140f101c |
|
MD5 | 4268a0ae0b3b09d6662e448e024cc33a |
|
BLAKE2b-256 | c32065527fd90789daf54790fb887722c11d1905de676fb88c6cccbe4842799f |
Close
Hashes for rina_pp_pyb-0.9.5-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ce486f0713426860d4df2e23a4cff9ff5381acda563f404fc8d7c81c574f35 |
|
MD5 | d6fcfd60999f41956f1d92aa38715ab4 |
|
BLAKE2b-256 | abcf92079fd8fc0fcb5880df0a6730e2f5027d13c38da06c1a1840efb3be750a |
Close
Hashes for rina_pp_pyb-0.9.5-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f8c1ecad91576b0b8423de88f711070469c1a5083fafa2a7ffa696aa0bb54a8 |
|
MD5 | 58eb4c6b910725150ca523fdd429a23f |
|
BLAKE2b-256 | 1af521e94d12bf4bda4e8dcaa33b2f941c3f5c33bdbfecf2b634080b27e246ca |
Close
Hashes for rina_pp_pyb-0.9.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbe39cf3e11a5349f2364f11456628b4b2cf14b2ee4f93323ec8767d567001e0 |
|
MD5 | d6526cae5a9fc0ac00bd8d800f1f1f3f |
|
BLAKE2b-256 | 98f021230c14832ed3b7cbaff8d709a37b1cf42c66544f8da6ca6e066f1816e5 |
Close
Hashes for rina_pp_pyb-0.9.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77b65b93aac28e9e3f504157d14af074080627b995bc008019347edeb7d9c764 |
|
MD5 | f847783ce84fa75a2ae90c0d42486c97 |
|
BLAKE2b-256 | 24e0a818e6e0bea7e24ec80b46327af5c83d7157671026737d149c5188698ba4 |
Close
Hashes for rina_pp_pyb-0.9.5-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a1a59d0ff5738f7539ae0baed9f8efc07644b1af975bfcf99c4bb75cab1fb3 |
|
MD5 | 8e398e54f39d9ed44d9058d88e979f76 |
|
BLAKE2b-256 | 40eec446fa6da290ab110c5742d09b26629562ccea4bc669546a45f06805f3a8 |
Close
Hashes for rina_pp_pyb-0.9.5-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca27a47dad35b6dd1188ac2545f057f315070c27ada2db2ecf66dd768432e4b9 |
|
MD5 | d4d43c4647ce72cb19df9c035d033b36 |
|
BLAKE2b-256 | 2ecdb1135feea6ce070367dd07d4d516b2fdf5ba26648e2994a09a0e0745368b |