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.9.tar.gz
(17.3 kB
view hashes)
Built Distributions
rina_pp_pyb-0.9.9-cp39-none-win32.whl
(329.7 kB
view hashes)
rina_pp_pyb-0.9.9-cp38-none-win32.whl
(330.0 kB
view hashes)
rina_pp_pyb-0.9.9-cp37-none-win32.whl
(330.0 kB
view hashes)
Close
Hashes for rina_pp_pyb-0.9.9-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f22b134897c8b030c26c1d12b3cbac20388d202c25985c1b6d7230ad41825de |
|
MD5 | 3aa632773003a50dd3db98602ccbfa9b |
|
BLAKE2b-256 | 50de2f869a378a2fbd7e13f285ce586ecea39ac71a173fc39468337f24fa9d97 |
Close
Hashes for rina_pp_pyb-0.9.9-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bcec35ad4eccef6422e7d937c1da51f408c2c52372c343e8798d2d2433f9f3b |
|
MD5 | 91d3e49e88c1094fe8efdea6ed20511c |
|
BLAKE2b-256 | ecca58ccb9c6385eed805d7a68cd68b576a852d7d3c0fb1dce0e31443cc3d8c6 |
Close
Hashes for rina_pp_pyb-0.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9db6709d2794f75a6efb43e32e908c0e2933e86b5a717f52596e18b96e8a202 |
|
MD5 | 016054d5c3f94cd05350480e1ae42195 |
|
BLAKE2b-256 | aef4b89d39dd42bb5fb98998480f476732d136901597d8348f838fe602a495ea |
Close
Hashes for rina_pp_pyb-0.9.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef4087a3626ee86ed73e29525b60e3d0fe475bd7444a3ea343ba295f55e8f4c7 |
|
MD5 | 2e76873418b3af748aecce8275387c45 |
|
BLAKE2b-256 | a54a73cce08cb7eed733aab4979855bb06baa9e37175ad168f08e4610de442be |
Close
Hashes for rina_pp_pyb-0.9.9-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f47184fabfda3f42d681f6180fa9e4109b4e5df5cd42bea8ef074dbbf031bcb8 |
|
MD5 | 1f3ab123f017b83b42b448c63e84d25d |
|
BLAKE2b-256 | 5d8f1bbfa601ab942ffd1c53c8e685b7bbb83265039c8c4fbc5f6be47dd87834 |
Close
Hashes for rina_pp_pyb-0.9.9-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fcacf27d1bcb6bf441663e465ff690bd06d30518d8c0fbc1e76e48b521cfd29 |
|
MD5 | e7d92a570e411e2f27c831dfae748977 |
|
BLAKE2b-256 | b0a1f310d089893c5641a3b0403a27e0b76594a4323cc45ddaf54a434a14dc63 |
Close
Hashes for rina_pp_pyb-0.9.9-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8d21f001d135637996fb67a7b74a62d30029c4f6d51c2c33e104f8e445f2a1f |
|
MD5 | 95410a01333cb13e4ac79e097da1f718 |
|
BLAKE2b-256 | 34891ed6372451b3e3498f272becd558bf02864053737c316cb1bd3b1e44a453 |
Close
Hashes for rina_pp_pyb-0.9.9-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f0a419db9731c5ef2b42e6620836fb702d52beddd5897a3d78c06bc2564cf7b |
|
MD5 | 819ca4f18e494c2ec72adf5990d26cfc |
|
BLAKE2b-256 | 5478bd12e670550dea25751a5506ff451f16d9219fc4f8cd808a16c1567ca0e7 |
Close
Hashes for rina_pp_pyb-0.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8873b34a9b4a8a07f26f9f7926b0782caad29a1c29aa0ac12e9876358e4ec1a |
|
MD5 | 3533cf077e2a10a47c96eee11b7f513e |
|
BLAKE2b-256 | d38219db292317ec8d93edf31adc2d9386caea4841a72990d90188d353debfdc |
Close
Hashes for rina_pp_pyb-0.9.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00eef3945e5b82dad97536862d8085e5ddbed7b7ddb1ccc2ae159f52d4a76a9f |
|
MD5 | 415c843e54c0f3f5ba19ab2e53d49c4d |
|
BLAKE2b-256 | a3a06ad2971d9e47c228c7a6e6c5fd7bd4ab996f7ae7e2f7cc33792f6b4f3488 |
Close
Hashes for rina_pp_pyb-0.9.9-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c2744f691383a6528e8401d7fb848c65de40d91212b31283df8fb3a8e9254a3 |
|
MD5 | aa377cd5c0fd829a510d3c7a0ac79541 |
|
BLAKE2b-256 | b28dc81e265825da135f44803fb79b95cd70f2479096a41043285997b3c06c54 |
Close
Hashes for rina_pp_pyb-0.9.9-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8073248bf59c7fa0f590605009abeaf6d931afc596aafdd5e7bc53674f07c793 |
|
MD5 | 7bdcf8a4e494917bf3abfb43cf8ba61d |
|
BLAKE2b-256 | 3cac04f0c93964d390a8dc8c7979c4a7bebd1a848385e85d765cd1f015f6dee1 |
Close
Hashes for rina_pp_pyb-0.9.9-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6fe539dfac83535d4fb284ca28c0eeb06056514478543cf376b7f135443d8f3 |
|
MD5 | bff4c42302bf298ee39c8d3b3cf5cf92 |
|
BLAKE2b-256 | e05ab19ef8944ae73f7c7fd6e8bdbcfc09b6d4cc3785942a75fd96498f75b28c |
Close
Hashes for rina_pp_pyb-0.9.9-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b620cad495efda48ca205e99b6ef86578c9dca01004a9ac98be1c18ad1cb42bf |
|
MD5 | d1ab3a1df155c264d7bc64abe4d8a1b7 |
|
BLAKE2b-256 | 0c0b1aab26c95addc990096436a9eef110f5aad461fc01c9b935041d07893d72 |
Close
Hashes for rina_pp_pyb-0.9.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91d7976fe10bd086f32c02a3a07066c44bcc15fbb76450752c2a8981b56eba87 |
|
MD5 | c20fd49ef4b1815e4b5ef9a4a71de60a |
|
BLAKE2b-256 | 5c2758cd469cbde3567db1a7de4105323a15ea9ba8212c43c5b7a7a96e62349a |
Close
Hashes for rina_pp_pyb-0.9.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27e43cc1e54a7b343d72b180a6b5d6553d76a029a585e00b2d99e915435f6198 |
|
MD5 | 79ea1ca3c8ed2049b635f7703f4f3cf0 |
|
BLAKE2b-256 | 3a3ef4582f1451930d21e2ad93a65681fdb5e952a01e1f0069ab161a4e17fadd |
Close
Hashes for rina_pp_pyb-0.9.9-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 329f24eb0808baecf8f35fd60652db4a976fc71cf696624027c429415266a374 |
|
MD5 | d754af542a55d1f6a235cb6fc2632e58 |
|
BLAKE2b-256 | 63288ef567d874c962ff187b1bca6ccaeb1387c5100274d07e13a90c6343039e |
Close
Hashes for rina_pp_pyb-0.9.9-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d20e9367b80f6b1a325a11f7c492dbacd126d964c83718a1021a4a09f309a666 |
|
MD5 | 56ff0ee4b40dfcbc5f323d6a86394b8a |
|
BLAKE2b-256 | d1b1d449ea1b932b43cdc0253227049a140ad14e8ebb663a57e7318c41753b63 |
Close
Hashes for rina_pp_pyb-0.9.9-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f146925ebadaeaf0e48fa693e8a2d72ab08311dde15fec008902d2605b8f942 |
|
MD5 | 07ade5113449e536a0f7f5eac3506f72 |
|
BLAKE2b-256 | ee3960594558610e30cb9659b5665ec2d5a6aae2e255dcc7dbd071cb2693dce6 |
Close
Hashes for rina_pp_pyb-0.9.9-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 972530d068d5c8939963a1de895b4f46a9e29eac3b3aabd0ef05853cc7b38f3e |
|
MD5 | e7c9b077fc5c33860b5039b68e9f95e1 |
|
BLAKE2b-256 | daaac06fec0acc4db833516ae660c3781ecde087c7bcb611547769ad79d1a7ae |
Close
Hashes for rina_pp_pyb-0.9.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f704f22426c0e13a98ef09df721792de60d0c795d93828e7dec42b68484f1e |
|
MD5 | 5c86c3f451e80b6482a1e2bfc7ebf2ce |
|
BLAKE2b-256 | 8152f646d09b4298845134de0b2c99a87ec732d9d2e6ca949b3495b6b27728fa |
Close
Hashes for rina_pp_pyb-0.9.9-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7414c930c7d1c507f0eb5a93e9466726f6e17cd6695d40664d70d5c15bde4d1 |
|
MD5 | cb1217a64fc57723e37b1424878faed1 |
|
BLAKE2b-256 | 543af41336bc0e6262b6377eeb3054fb064dadf7873144741204db92e4dc428f |
Close
Hashes for rina_pp_pyb-0.9.9-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2a05cc8096b360afbf4b9c332def619df62fa6f3b2d662d41cf8745f8d8161d |
|
MD5 | 8d9de0d8fede2f7296169acf5dfcc6db |
|
BLAKE2b-256 | 35ac9bb0b4e7c98b3ede2464659d317e0e86e6f47434a1680f582088563db284 |
Close
Hashes for rina_pp_pyb-0.9.9-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17695dbf78f067a55aa1191aec3fd059d1dd9cd143d5ee65bb4a52fc2340ead1 |
|
MD5 | 494f7b5655b2204fde41b86616cff15f |
|
BLAKE2b-256 | 2c6a68a1f5e9325a742236ef2f07f7e2ea0f5211f846d89610b5a943dd481b15 |
Close
Hashes for rina_pp_pyb-0.9.9-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 563b7d26e88fe25aff355b6beb8ca92b0b3ff11a7e402e175b9c091c2fa8d944 |
|
MD5 | 7a44be764a45a4077c12c3b7ce900e05 |
|
BLAKE2b-256 | 1895e0bd7e1d4fc8006e7c314f9ca44c116426b77a4188098c7530dcb977f03b |
Close
Hashes for rina_pp_pyb-0.9.9-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f610c3d60374f89b7c1a9e02d9ca79634a0b88c7a5d595fb8630653c05e749d |
|
MD5 | 2c8403c67d2a226951bab6378eecf058 |
|
BLAKE2b-256 | ed0adc25887de46c386918273baee09e4be3c9be3b608c0c05aa315640f5eb56 |
Close
Hashes for rina_pp_pyb-0.9.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08cde9cdffddf1905e0ac0d3b41a4a36bdad3755c139de4206a2681fa7fd80b5 |
|
MD5 | 3191ee1bea9ac351045cbb2dd72f352f |
|
BLAKE2b-256 | d32043f9bf1ee1dbc92bdc4db7bcffb9c4eeb8b569f3ed3c8b910f0f6f75f0de |
Close
Hashes for rina_pp_pyb-0.9.9-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b7d8353f1157b64c6ee5cf0f5b3111e8449ce64e433faef484a3441426ffe75 |
|
MD5 | 75adc8cf5083746191ffaaecc7c6cd6b |
|
BLAKE2b-256 | 1a8630f4f72378b792776a1bd1c7d7bebb240c390b65d13e76c492524c5f0666 |
Close
Hashes for rina_pp_pyb-0.9.9-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7309262b77946208555ab13d04faf515a65a980ae5e06d4b0120542a74d1a707 |
|
MD5 | c2295f0fefbdcff7e28797059efa3756 |
|
BLAKE2b-256 | 35de83cf1bb8b45ce61eadce8bf89b735c457803b10d4333fef60ac47bef2705 |
Close
Hashes for rina_pp_pyb-0.9.9-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8a6579ef3b460fa53f257c7dbbfa85cff1a9926f802929f23296f4c09171d03 |
|
MD5 | 1d00141d7969f3328e3e6d588ba3644f |
|
BLAKE2b-256 | 94c3143ae92d73a01eefa0f70af6c60c436cd0b24580a7fc4136e5ac1af7cf2d |