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
rosu_pp_py-0.9.1.tar.gz
(14.6 kB
view hashes)
Built Distributions
rosu_pp_py-0.9.1-cp310-none-win32.whl
(330.9 kB
view hashes)
rosu_pp_py-0.9.1-cp39-none-win32.whl
(330.9 kB
view hashes)
rosu_pp_py-0.9.1-cp38-none-win32.whl
(331.1 kB
view hashes)
rosu_pp_py-0.9.1-cp37-none-win32.whl
(331.2 kB
view hashes)
Close
Hashes for rosu_pp_py-0.9.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd57fe7f30063301bff25ecbef614d9147013f619d28d83de0c898f365e9c8e4 |
|
MD5 | 09170b49aba1d969a91242bcf3c01aa8 |
|
BLAKE2b-256 | b72a9e06dd4fc03315a0b64d7419d5e2fe7c6862fbf8885133b4dc482b801795 |
Close
Hashes for rosu_pp_py-0.9.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1c3747661ef57c789326a3f91a0e10012f481eec7c7fc3cae46a9f8522c3322 |
|
MD5 | fcda4ca8279a0470ffc482b47da88fc2 |
|
BLAKE2b-256 | 3bb1cc3e70a049f894308c5e471e3122f6c09ebd649fa467455f498086245a3e |
Close
Hashes for rosu_pp_py-0.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c137cfde0741b864428832bfd8e0697db7e914aac7b166e70d020bd194a22b7 |
|
MD5 | 6fb13da3b15cb8cbb641899c45c63a14 |
|
BLAKE2b-256 | d8a609380ad4661db95ea1c14e86ca71f4fdc518f32a2149ffd8842abb3b2e4e |
Close
Hashes for rosu_pp_py-0.9.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c80d2a28adc9cfd0aed1fa8952c5607b1a02ff520b513eaab19a7559e01acdf |
|
MD5 | 2c142cdff30924a7224ec0b6dfeb20d3 |
|
BLAKE2b-256 | d22c43e0eef2d40af6bc7a39194ca5e8eaeb96eef030df9b0d2af88376155d87 |
Close
Hashes for rosu_pp_py-0.9.1-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f74a6a36f3f20adeefbc9c60f18dd5da48e3f7eca8f9681c47308455d6b96b78 |
|
MD5 | a4aa5efe131ea881309c640f721e5a2d |
|
BLAKE2b-256 | 94b68f36773dbbc370ba79f8e87f594e3fa8b0157b47b317b3dfb54c0a1af9ee |
Close
Hashes for rosu_pp_py-0.9.1-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f437b66b0f11db1f2cf89b44284d237f9aabfbc644db00622bc6ba4e9635c92 |
|
MD5 | 103a7a9d910aebb6090c603d11716041 |
|
BLAKE2b-256 | 133d72d165a7085171304c2f57df11c2021110a0089e88c71781c36808b5bdec |
Close
Hashes for rosu_pp_py-0.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dabd207392416b73fcc8661e59438b5b5fe5d01dfee85692c4074e29cff7f52 |
|
MD5 | 6dc4465488f1d2dd7a8e30a63c9e633c |
|
BLAKE2b-256 | 4cb2648b42f365218e313a417dc408c74936692cbd8a7964e7918f1a07dc783d |
Close
Hashes for rosu_pp_py-0.9.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 903df22135d18ac10a125378107f0482a010b6c6642f30fb5805c0c0ebeda752 |
|
MD5 | a82401fc5e836cf2f5b422623973820c |
|
BLAKE2b-256 | 48584c896bb635e43dd04ec498de78aa6dcd0d146ca079ba29a409926d3a7bab |
Close
Hashes for rosu_pp_py-0.9.1-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 715a8629546d8acd3029d67c3e57ff63b536d3b7960c75540ca29636b2253130 |
|
MD5 | e6022c40d8d03aa06b43afd5f7227377 |
|
BLAKE2b-256 | 5bb78efdff850ce223995cf482da3ce6ae9cb5172a79ea1ae1e35b6f68fd586b |
Close
Hashes for rosu_pp_py-0.9.1-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00a2d88f17a950ccda49500c029ce01d0ba52af19c9a7860098621381327d2a0 |
|
MD5 | 7d6d5335d0abb467e2c664955f514756 |
|
BLAKE2b-256 | 1d4f1b0cb28583ab15aeea0b97cf58dda67b5ed919a260a9032751215df99d52 |
Close
Hashes for rosu_pp_py-0.9.1-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b5010c9e62f6653cc5dc835678655d8357d49098cb70b0e89e96c10cb8200e2 |
|
MD5 | 0b1d5c129ae92f26c53c4641c9ccd3c2 |
|
BLAKE2b-256 | b528acde60f017e6a5861ead7227a2555ff8cd3d582c16a760641ecf908abd21 |
Close
Hashes for rosu_pp_py-0.9.1-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d93bfdf8d4d63bb55e37fce99f09df0e6e376fabcd023ca5b256068fe1518474 |
|
MD5 | bde6b7339eb7d9dafa986661758a57cf |
|
BLAKE2b-256 | a0297a24594bacf991008daa9cce1f2deb6a521627cd395542a8496ec8eca755 |
Close
Hashes for rosu_pp_py-0.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 299e5d429a43bfee80ad0f6e60f37dcaa469dd4d91ef4125fb694d471c8dcbf2 |
|
MD5 | e779c5f4db9d6e05c9ec8b764eff2dfc |
|
BLAKE2b-256 | 23883c34f41ab48fe9bd5a5cd65b017e8c41e39ecb62f58e9503e6e2183f5355 |
Close
Hashes for rosu_pp_py-0.9.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7622028bb41f9281cc9b80d7bb732b017480872d388db3b668aebf69d6344a61 |
|
MD5 | f14adb8ff9b0368f6b29e7e5fdb89954 |
|
BLAKE2b-256 | 8a5b16c57785af1efd24dd91b86bb79500eab81960a3436f57aaac69e312c429 |
Close
Hashes for rosu_pp_py-0.9.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b02fa7f257f7fe6c40e9e9a16438ab3a80ce36cde1c65e0682777e7b8e026f28 |
|
MD5 | 212cbd49b7c23633948eebbb32db922d |
|
BLAKE2b-256 | d8b28ec4b4cd9a0c9845b372742e90af193c8cb8cb173421e83250ba6dee7220 |
Close
Hashes for rosu_pp_py-0.9.1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78013a7dac2d38ecef8a44de6b13725199120e66661089c5a3d2958eef07afad |
|
MD5 | 35d41c8060b60361cdc2eff46fdc4d16 |
|
BLAKE2b-256 | 118ae105905d7fedfafc63660ad0d87f66b72c680694c97dad663be42798eaa3 |
Close
Hashes for rosu_pp_py-0.9.1-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d72f563c6301fbbe0cb23ab5fff0640d05e4023e4472c35786d4c89e637cdd |
|
MD5 | 66488486f13b52f7d7ef85c5ecd95f93 |
|
BLAKE2b-256 | adf8f5df42d7079dde1040911464b3043511a0bd44f420f0d13dd1f71b018545 |
Close
Hashes for rosu_pp_py-0.9.1-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59e0a21d37f81c39c161da24e0e8db77f2897d935d3224098df0eb988af146ed |
|
MD5 | 32c9f85519dcb0a2c1c01ab4556158c7 |
|
BLAKE2b-256 | de451d3a878b62ae89964b65ccab1657b1af40be2815f1e9ba34b4fc07bdea2b |
Close
Hashes for rosu_pp_py-0.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c70ebe8a17f086b00e7801f2b0b49d50b53d30e6f13a0efccbfb46090e4c9b1d |
|
MD5 | aa5536ebc95c526409b85648e31de7c0 |
|
BLAKE2b-256 | f87aaffb6b5d87b4601481e38f2d7f5926b80bdf1a35383da9a9e631eb8a0197 |
Close
Hashes for rosu_pp_py-0.9.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7a547a4441baf1fe8b7c823848f44865672b81531d5c1049c98a30502ae01a7 |
|
MD5 | f6e43f009f1d9ef6b760bb28959b73cb |
|
BLAKE2b-256 | 9caf295e4ebaebd75547b36aa0fb568603078de8bdc26b7a3160d1b8af498c61 |
Close
Hashes for rosu_pp_py-0.9.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9e07859d8711f010fd2a4f91867f06387bb4f4c41577306a3fe231dcfb2c429 |
|
MD5 | 1fffeb70ad54249398c4df9368128b4f |
|
BLAKE2b-256 | 98627545f44006ad57fd64c60c4b71deaafa107498b548b40f605653145cae54 |
Close
Hashes for rosu_pp_py-0.9.1-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5fc27607db75d86a80cbd2227dceb055a2b7ec30c8a0fbee9cfce3f45c66b18 |
|
MD5 | 4e5bcddd651e84df9bd9f3dc3ee4cf9d |
|
BLAKE2b-256 | 1ef50a4204db187635dbba0c43e0167b10e989ff8fa88ad71ea57dd48567064e |
Close
Hashes for rosu_pp_py-0.9.1-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17463b1c6230779003d3751361bfe92072880def1fcbc4a02d6a88008b26f638 |
|
MD5 | c2876750e04393fc367468e95f1d8bc8 |
|
BLAKE2b-256 | 90a2a6a16875a31f103e612ce2cc346b673cb7ea39f0aa32cf9aa2d7e2941969 |
Close
Hashes for rosu_pp_py-0.9.1-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0d185c406b6ef7ce882ddaf584e32cf3d55375009ee43dc11f9f8cf0fe0438c |
|
MD5 | 72a006625ee26f0496a3cbc52080a950 |
|
BLAKE2b-256 | bf26e3620f5bdc441bcf318118094c0169ef6f41eacb5912dfb830ca23f50a89 |
Close
Hashes for rosu_pp_py-0.9.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33cb14fe2c41cfe094ab2bef0da6e233a6b21a7b28d219365dc8ea6e14b4502e |
|
MD5 | 2395696a544251ea70bc454bcc4cee56 |
|
BLAKE2b-256 | d19bca6512aad587e34dfb8320ee5841d20f8b19702222bbc0e2b6c791c7e910 |
Close
Hashes for rosu_pp_py-0.9.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3309c4760bc7fb62e070c80e556ca6fc7cc399442631e9de186a7eaa18bb5efe |
|
MD5 | 26e17dc3458efacff37eed43acf4c0c7 |
|
BLAKE2b-256 | a0d7f7afc8815d07d3c3e130be18c134f2234a64d64cea12773540434043301e |