osu! difficulty and pp calculation for all modes
Project description
akatsuki-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 akatsuki-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 akatsuki_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 akatsuki-pp-py
or
$ pip install git+https://github.com/osuAkatsuki/akatsuki-pp-py
Learn More
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
akatsuki_pp_py-1.0.1.tar.gz
(17.9 kB
view hashes)
Built Distributions
Close
Hashes for akatsuki_pp_py-1.0.1-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 210e0a35034c0a87843f530f669071eb99d7283d52a07c39e4ef46138b9adc42 |
|
MD5 | 640ee81c57ff12aa0fe35a9dade858e5 |
|
BLAKE2b-256 | b2b3ea88fa9f1204f584e3a78412c455f7274d874365d7b13b32424f9609b88a |
Close
Hashes for akatsuki_pp_py-1.0.1-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 402a1bbd45c914418920959f99ce883feba71f5c106f3729c66845f650fad146 |
|
MD5 | 2ddc93c0aafc498c1c84e547079ebc97 |
|
BLAKE2b-256 | 64ef50ecfc34e5d3e1aa80c6787fc3c1cbc03693bb2da080667083c1951c0644 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2edcb6f40a931d5688e015e34159a1a2b074a1ece65778ff1a2b5bbb87999b26 |
|
MD5 | fa27f44db3960499f4f50b16f9caa384 |
|
BLAKE2b-256 | 4a5d6f67a93d3f8e9b5added82d3b5c8d0a1aca858f0133505640fb15dd8b263 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aff4f915d68bff4d226585369315e5fdfcfee5fa9ddbc26831a33f26c1330393 |
|
MD5 | c7c180a835be4e2d9657076351180611 |
|
BLAKE2b-256 | 9fd0f975dc5a92261893d9fe782abb395bfbc936e19be09b0ccb18f263b745c0 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea15af883971f31c312593356d7a2e9accbfe4bd9925ffaa37573c26178c5ce8 |
|
MD5 | 9f2a677497931e351a1404acea8aa588 |
|
BLAKE2b-256 | a2a6e2243779295ec78926558979f1c7bf4b2b8128492ea43aaea54d37d0e325 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fef1e1a06eab5b819976a7043bcb279d545bbbb15c7fd391fc27dffeebf34303 |
|
MD5 | 3b55e50fd6e289a99cdb36720b53ab34 |
|
BLAKE2b-256 | aee054c7e6ffe21722c753648162fb2dc2d0599130de7db23169b84186236971 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 830ef57d9667aa26c52fac14e98d68c0d0f50a552f558fd19ea1d54a68a090e7 |
|
MD5 | 7940e941222a2dd02dc59891b062e994 |
|
BLAKE2b-256 | 51ab1e54f8ef2f2c5ea6ae9b11993267e1630557f5b5eeea6cc1e36448b30e46 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb234afa171571c86c769a4b37dcaad60484c876a2b531bc5e22c52f10a54eb4 |
|
MD5 | 4104ff0314017555b92756987c895fc7 |
|
BLAKE2b-256 | a78e41a1d32e3997e5c79f452822e48711836b545612e53ef07224bba8828cc0 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f47766a098a99354b4107f13c0dbdec9c5d51c762adad08c88b5491c0732e683 |
|
MD5 | d7345c2e812cccca839f89b22f8bad8f |
|
BLAKE2b-256 | e5b63e006ca75fcdfc2b34f2a6bd9dc63efdc1978bb2763f132d363a97fac094 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e1b02b5ea7414786c7e505c93c0e730e3fc63a8d8c79aa408a06f06384fc1df |
|
MD5 | 817ea43c302982cf37b953b997970f66 |
|
BLAKE2b-256 | ed6ff7abffea03faea78bdbb00b3d9878929acf6d390f59879cb0bbad4ddd7f9 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df9f2998a6628c488ee8fcfb211249a0507f4d89214cb9fc3c894f38df24d32e |
|
MD5 | e2252541168d172789427a68956e0648 |
|
BLAKE2b-256 | deaabb1064f11500027561855a1db81fcf8f0ed6b6aad25854fb979c776e4b6d |
Close
Hashes for akatsuki_pp_py-1.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7266dc84e878aec860448e3fd740fc2ba20091349706c73f99416bd61ad96e5 |
|
MD5 | 2deea7691f66d32fca7e1c22729537ca |
|
BLAKE2b-256 | e8c52fc84e8b96bf7b5e378f3717f01e5cde814885c8167a82528aeeb1ca2213 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1e1d6bbbcc623f198a9795cfa9ad02429f23aab8b842faa784ea553efeb6e89 |
|
MD5 | 7f24de82947be1b3873224828f04e5b1 |
|
BLAKE2b-256 | d09aef9ca5619f63386c815c398cd29c79aa6b4bc24a85be7a3c825118f3d27b |
Close
Hashes for akatsuki_pp_py-1.0.1-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95d6aac4d31808fca963a959cc21c5a3af7f4105a547e2ec943f82fa7fb8d0ca |
|
MD5 | 1b21fc13907cbd87e330cc86b54bc6c2 |
|
BLAKE2b-256 | e6913a192332d2bfc01086095da66dfa38e604701037cb766142f5c476f42567 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 142e1fac7a6348ed544f5ba9ccd44252c2593ef02fd6e91bd7631f97fe7eae12 |
|
MD5 | 5d130852450b33795ba04b3dc8080728 |
|
BLAKE2b-256 | cf46f4eb777dc774b9f22a84c18cdca81b7e97673a2a5e21abd530378517d384 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba090bc5eb50fbc08363433b0eea86c0ae5cb331c312f843260025a2b5f1c129 |
|
MD5 | 2ac0332b62703efc3e2cc670b89226c1 |
|
BLAKE2b-256 | e6cdf9ac07363756c93777bc57c845ca335bc82d69fb3f3578306166410aaa60 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ac1fc2aa9fca26b24b3690f96d5524a525a6277096f3e514488c979c0200e7 |
|
MD5 | 2f84ecbe9d8b75be6626bb18bc3b99f6 |
|
BLAKE2b-256 | 7e5c9476705eee6945b6affae7bc1fd6bbb8e44339e808fd0a6be2b53458df64 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f66a2326bf1295764ee5bc9ac74757f218c6e91aec5e8834e309b6e748b1179 |
|
MD5 | d019bf85b6d6065304c9f455bf258417 |
|
BLAKE2b-256 | bd8b1ed497a894fada4d1a18afbb8f369477356543934bcd6b16d40f705c5cb2 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed8bcdccae91ea2d2eab16cad4d8309c68ebff44b9b209ce80f9a3586a2f505 |
|
MD5 | 8c90c8a0f284de608df15ae398769324 |
|
BLAKE2b-256 | 6b71ba7ab17664ec4ff5d3f937d2076a02fc65ea3370af9f9ea1fa63899d2666 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d50a5eea1bf9f8e2a388885ea6280e2be8c298384783686bf0069c12a49ce1c |
|
MD5 | 3bc3a9fec74302a8db04a267a3fb4533 |
|
BLAKE2b-256 | f083b14f1ecef2e00dd04c86582a150f81411967df0db350788f7249677a5851 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab39282868b21b14f42c908aaf44f0af06ae2d43fce9b0594c988f757971b1df |
|
MD5 | c96f7f92149e415f1f050b2350cb87d4 |
|
BLAKE2b-256 | a43fd0778366cb77a5ddd2b5fc29d0b7e65cd44e144d3fa5a3b5eda3b7453d1f |
Close
Hashes for akatsuki_pp_py-1.0.1-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e3bd53fb1636ccefd36ee28a4526cdf502e4844ce5f4695c7f21020a140331a |
|
MD5 | 4cde779c63ae5c10c6363a58e4994a0e |
|
BLAKE2b-256 | e69622a4c6ea80a906c4762ac48127a702bad5ce773a5bee2b9ffd44d750b0ef |
Close
Hashes for akatsuki_pp_py-1.0.1-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52560ddabad8f29c5f9917a968d452e140668880a9172901a6c6cfbbb0809ac2 |
|
MD5 | 7a602a423945efe97a5c870e310810ff |
|
BLAKE2b-256 | bec2acaac7b7f4d48f1e71b4914b1ff94a3d8dad90ee979561a93c7c5fae1ee0 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a201d99eac819d6b348336c1df5032964cd4111382f499ae7626e5ac3b8bef5 |
|
MD5 | 04bb196b277cf5b19f1fd82e3802881f |
|
BLAKE2b-256 | 818ec74210d0d2f19f410ff6a477742d44c633bfdc282930fcb8039609aa8e22 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e9107eec4a415dc5532c1e85d9ff10a195633fc963f6fcce6bf7cff72b7a31 |
|
MD5 | d7a91be63bf5e22c765fb6eee049c514 |
|
BLAKE2b-256 | 680599e0a7923c655c12540a7f3e03d75c708490de7843273c6bb312589639e2 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 108089f95dc18150b08f7f409bbfc7d5369c2ce35bc28533126cc169d178ce69 |
|
MD5 | 8f9feabc97a23bb4b474bb7f5fcf1412 |
|
BLAKE2b-256 | 4196e30e62e23e943e53290c556ca30521d6cb81d69549b92bb24fad6f0e7f87 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3d13f91646b4fe75d1b8feba40c4162933bd73e907208fa3b5aaedfdbb62595 |
|
MD5 | 9ee30c051bd175d0cf3f6e978f6c08b9 |
|
BLAKE2b-256 | 3474f11ffcc37a588eb2dc4e2776bfea06db4f9bb4face627a3a04ae967d49f0 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3e8327a995c89f9ae76cf50a43b26a5857066df45de5c8e861cde77963e3c44 |
|
MD5 | 123728ba4fd19e3e9a8ace38c23e4ac3 |
|
BLAKE2b-256 | 271af6c34991ddd37c7c643046f9353fb20a291076d55fd32cf4261df29e5b7b |
Close
Hashes for akatsuki_pp_py-1.0.1-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c0ff3a157ed6a01837f433f025a00f9006ef13c1269da73d88ebf66e05221bf |
|
MD5 | fc068daefae30f7182201b8365bf8290 |
|
BLAKE2b-256 | bc6455f45feaf1e5ba0cb33e20a500682e15591baf08f6cfa4189405f1321d37 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1805e7ea9d7b9fb8fd57507e47b3ef69698446cee3e50910ac4d8db05b2d3135 |
|
MD5 | 06c831fbf40a2b4a392b0aecc860db05 |
|
BLAKE2b-256 | a63a9f32717957d1874dfa408c09588c6e3dc293d96af88e74c3f08ae8619831 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db25d4fc03e3059a6dbc7bd80267e16b1fbc1c94c3e294554b9c1df62d00f2c3 |
|
MD5 | 9010cce421d84171f138d3d40bb32e43 |
|
BLAKE2b-256 | 752762ec4ed3be3bfcd0dafa743e1e7d1fc8bbfec544f830460097b29503ce94 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9012cf696924bceb397578d0b7b63e6502402757f571e9e53b934897b4ccfc1b |
|
MD5 | 1b57adbdfde9ba39a0c2dbef587c4655 |
|
BLAKE2b-256 | 8eb0d9b2d372214af48941c6e55aacac29e24b04a9258ad0be1f14ba107dcf6c |
Close
Hashes for akatsuki_pp_py-1.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12807cdab470e32e1c1ea63027576c7797570012b972ea38c3c281a01e45b288 |
|
MD5 | 8304e66698d2ac012baaa5dee4de6d9e |
|
BLAKE2b-256 | f96d3ddf8a78e42e259aa4d8ba74a2c8b3215e71d77840fedbd112c3b4dae0d6 |
Close
Hashes for akatsuki_pp_py-1.0.1-cp37-cp37m-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d574c3cd171e3ec8890ce8031da760fee702091f9accc7ee59b8276106a5357e |
|
MD5 | e54579b38ab38f930d966904e761f2e0 |
|
BLAKE2b-256 | b6939a0b6e25d1d4fb66da6a872cd62c14a4f666e8676ed65865b71f4eb684be |
Close
Hashes for akatsuki_pp_py-1.0.1-cp37-cp37m-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9cdf6cd49bbb5a33d8f3c97d9d51c3fcac852154183fe4e72086e872fb1f599 |
|
MD5 | 02f50f2be7ec5e475b4679ae320d1dac |
|
BLAKE2b-256 | 404bcd91103c197f8da0dd9c2514131b5f93572820d6459aa2fb1b0856c3e953 |