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-0.9.7.tar.gz
(17.9 kB
view hashes)
Built Distributions
Close
Hashes for akatsuki_pp_py-0.9.7-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f7ee27faf043b8913d73316aa3f2ae8d5bac0d08bc9ea9432b953c9c5fc1c73 |
|
MD5 | 26d6135aa119d4d8a48739c4e620a6b3 |
|
BLAKE2b-256 | d3adeb889145f4c7536083fd60f35b5f4fbd5952d0fc68e2c404fd5dd7ef0ccf |
Close
Hashes for akatsuki_pp_py-0.9.7-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1edf08aa6f0fa7d5f13bc7dd0d087fb65ff45f451653df776e86b0c788951b1f |
|
MD5 | 46054771173e5079db7d7a1bb2749d88 |
|
BLAKE2b-256 | dbb50587f537c9db3d12143e3c8baf482458341ddaac4b9c9cce42b0c109269c |
Close
Hashes for akatsuki_pp_py-0.9.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78470503303ed99238012a23a6d85c99b35974b84312456196633c84c9d7e247 |
|
MD5 | 06dfd21bbd6683074697c1373f5a2165 |
|
BLAKE2b-256 | 56b4c89acac8c7beee62b776bb8b19e321724d6608b41bfacb3515ee358a09d1 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 342d9bf9c38847dd7de3eb702ed56c375aaee7a66e2480329c97dc1150085054 |
|
MD5 | 9f048ddf082ca4807728973b24e0edb2 |
|
BLAKE2b-256 | ebedc9f8ec2957959b94ea890fdeb8bd58a2a387a870bdc5d0984024c1a1d8f6 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed6da0bba4243bbec9b4c858cb5d2f71f9beb97b40da002f4bbc64e85130035b |
|
MD5 | eeaaf33200b99b89987c75fe636e48e2 |
|
BLAKE2b-256 | fc13153b3dd08f41ae051ab6f1deecce17356dca0f9216bf268973462b3bcf33 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad2599a5a1bd30799477ae56ab3f22907e22e6d6971a3a358e3bdcb0ff5829aa |
|
MD5 | 6e31cb8cfe4aa0df27d5a14492b9406d |
|
BLAKE2b-256 | 9dfe7ec2dde6aa302136e4a1ecd0616820a3ab8400f8b231d7bb6d955a1eda15 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80ef98b7a83704a3dc45f3dbc6a958ca6bb183cdd1d9a25498bf09a24cb1164 |
|
MD5 | 307f861d8225e38d837078e119ced271 |
|
BLAKE2b-256 | 1a1565f6e57803929b9bc1acb28c9a158b2e3da275bfdbfa5d44764a164ccdc4 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f397cf2a6763de7838b00acaf695d9be26b49ab19133870df2d510b331624d |
|
MD5 | c0f34780b9b219c11e06527895537876 |
|
BLAKE2b-256 | 31a158f8012eb051a2426d9d51e4d2765115e50c03d30a41a04e320c84f5af7c |
Close
Hashes for akatsuki_pp_py-0.9.7-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47722f09d70451dbec085f566057a774cb91bde0861e7cd0e5979ee4f1cc1c92 |
|
MD5 | 3f99d6c8c26c3ba5e7fef6b83944afd0 |
|
BLAKE2b-256 | 0a2045cd1de3a9bb20bb6cefe91d756b7065cf6c1b041eeaeee65e16dac8e9bd |
Close
Hashes for akatsuki_pp_py-0.9.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f53519bf9884a9327dec347caebf2d959c297bfad6ef0582186ba0996c64f21 |
|
MD5 | adeb1d5511cc64b2e0c66f0bcf37266f |
|
BLAKE2b-256 | 5d830b3b68050fcf70e7e9367966f7b4409a1dc9d2f415265a59daa67fc99d2f |
Close
Hashes for akatsuki_pp_py-0.9.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f79de359a6eaf1632871cbf6488d1fd9f9dee9cc72808e042ecd1fb9f60a80e3 |
|
MD5 | 9bdc6ffe998387a615bf2f07673fd948 |
|
BLAKE2b-256 | b499d6766050d1bfb20e870819e09017f7ecd35140dd727080c927f01c3d135c |
Close
Hashes for akatsuki_pp_py-0.9.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2f23e1e88f557efa04d0a156906dc79e0e9ce979c8f84cec213faf7220b42f7 |
|
MD5 | bb40b4fc7f361e901688a3fa6d990f0a |
|
BLAKE2b-256 | 3c29fa9c1f25e07cbdb89972d995d05d9b8fa50ab919bfb77794a035403d7bf3 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 816c1fae4c555bac3a3055993125a587c00ec8771f55bddec9bf993acc72cd07 |
|
MD5 | 8238e38ab9d95566b4c3ec28df6e66a2 |
|
BLAKE2b-256 | f35d5094e3939cf3404a99cfc63d5540253d7860eca6667855f0ddc84c760b7a |
Close
Hashes for akatsuki_pp_py-0.9.7-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a017c6699f76e4496020d4abcb36f16a70a626fb248ee791d79face8c7275bf7 |
|
MD5 | cd8639163a62c28738c672af93916873 |
|
BLAKE2b-256 | 381e6942ba34aedf557105113e05d2d73d31fe98be192f49fc8543ffc407bb5d |
Close
Hashes for akatsuki_pp_py-0.9.7-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59f46190d1d728e9827b8aa4566446b09555bae9109e5af7a21ab47de0befb70 |
|
MD5 | dc7ab6568ec7d70707054e1559834f6e |
|
BLAKE2b-256 | 9f4dd74ca71c53413e84e96d5173e599f672fa56b69a8936b7ed9d7c8f3aef11 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04003319c803883b1c5652cde6f04025087abb5045b39755b34e38f8149dcd6a |
|
MD5 | ce3a8e949e3fb9890504a81b34ee9f49 |
|
BLAKE2b-256 | 161c10030d23b3097d8fcb42348415a953bf73ad956c9a31e43ef755afd9a907 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973c632ed6a4f1e2a72d0415c02ec83500ee4845f15823d2d177d6c237e7b8fb |
|
MD5 | 0b1f871fca202bdb155b132d05706d55 |
|
BLAKE2b-256 | c98dfdb1e54c52c438bb32bfe21136ee131a8c08c86554ac77f8d003b7122eac |
Close
Hashes for akatsuki_pp_py-0.9.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 423e6ae5ec77c0bfc817a042b603f96b4dded36a8c90804f1b7cf19badd36334 |
|
MD5 | c099687a6b578f2f5786eee3b0ff8821 |
|
BLAKE2b-256 | 0a77c0c33f22d5598b72d1eccad2e551c957aabe870264351d073612a7b0f52a |
Close
Hashes for akatsuki_pp_py-0.9.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 939ae37ece3578d25c6f59e38d6cab40019fc05e237d49625a4957e658d5fb7c |
|
MD5 | 92e02c8ba77d5a974f6e515295b5ce59 |
|
BLAKE2b-256 | 0cadbe65fc8b2a50b50b7d2e0733e0e53011de6c4bc70e4822d9a20ecb9b734f |
Close
Hashes for akatsuki_pp_py-0.9.7-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b95f125474cb3addd5da899a090ce7254926d2e3eea5d2e7540080ed9f2cbf53 |
|
MD5 | 5deb983cc11a3f259aaa22c164229d7b |
|
BLAKE2b-256 | 06230afc12dc868f9d4be8e3a885055e164b5ba8dab3eabedac86c71c1134c09 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a6d11e12be9e30a3b2ac0babdc37cb559832fe8b9140438b6474f723f018d97 |
|
MD5 | 4da5b760a83dfbec3cd710fc9527ed32 |
|
BLAKE2b-256 | 7fe79ce67e357d9751b37596cf8151378a562d1b11d5ebdd66673505f48d7999 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b7968cfe6c4e900f61b2da8fda9baed772755b1d7af0096ab8f74c58c35983e |
|
MD5 | 7c07146c8b466be74caf3ff7237fa5e0 |
|
BLAKE2b-256 | 7d186173e4e8ee958e8d8e5208cd4a8d554acdd4964af0d02b8d5a2fd93b2edb |
Close
Hashes for akatsuki_pp_py-0.9.7-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e15ee0a755f1c16ce91ed50e496fb5b323256b47489854182cfc485d7c375b4c |
|
MD5 | 71ab8734f3cc6c090da38924533b844d |
|
BLAKE2b-256 | 70e12b3ed2cd3aa40a137fa3720ac9f773d822f773f150e32003cce9b56f7353 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ff1e436cd90f754f376dd141f758016d05c7717340e7c17b1382aa9f7bb245c |
|
MD5 | f7d31d1b60a190dcbfb40cdd45571da0 |
|
BLAKE2b-256 | 842909796438ea0b0af53852728e301fd509b6084d3e9cf8f40997f8adb7d1d9 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4874b5348e6e2c40c006bc28fad595546bf20ea6f62764d8dd0c2f0a1918e10 |
|
MD5 | 46e914f383b5b2eda5907472cecdcad0 |
|
BLAKE2b-256 | 16c658c80b0cb0f556e0fef21396e63b60542a13622d82e4f8ef9c9e52abc56c |
Close
Hashes for akatsuki_pp_py-0.9.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a7f8e15d02dede0af09b14b037dbc8b9bdeff4607ff1420e99eb90b824808fe |
|
MD5 | dbd6ea60d7aed043490596fc1c60aab5 |
|
BLAKE2b-256 | 0de9fbcd0f65f4fd5f8327572e96707601a7165751a1c6b83f515c6b07ee6474 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1688c97cce4f6fabe80291978d24c93bdaed432c6d0b7000236fc2cbbaa21e96 |
|
MD5 | 6b3d484e04815e6c73f866dcef29dba3 |
|
BLAKE2b-256 | 649b9e3c8f610b54d8470b0c6d8e540f3a21cf008e645b48d62c28e05b5d8e9a |
Close
Hashes for akatsuki_pp_py-0.9.7-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82364523a77af8bd8b864daf3478076058449ab15e31727058181e2346db217f |
|
MD5 | 9a1d8579b31960a62c4ac8156d5954fc |
|
BLAKE2b-256 | c828c16ab2feb3892bdcb050b88e021e8f0c72d52cf6feea71da63249118a57c |
Close
Hashes for akatsuki_pp_py-0.9.7-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff6a802bde37f69003a0206d719488f3a343cffd7711acfc873932ba06e09330 |
|
MD5 | 4d10ad1f12c5b9fe09adf15f7de336aa |
|
BLAKE2b-256 | da4cec584f06549d88e7ada35b82c8593a438de92aef66720223c4c515895c3c |
Close
Hashes for akatsuki_pp_py-0.9.7-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 593fcaf92c12d96233925f0cf6c706b52537788211ec33c62e3bf4f3c02352a1 |
|
MD5 | d900bd9466131ae862376b7c46d30ad7 |
|
BLAKE2b-256 | 3813642c07067da4d44f199cbc4943ec2965835f0feda8c292f50c2dd3db44e5 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83652a15d99395e08efc80243f65675cf82ebf3bf2ceecef55e4d7d84226734e |
|
MD5 | 803d68efe70f87827faa48e67a36007c |
|
BLAKE2b-256 | 6092718b567548acc76dfa7f6df442756b612e95ad7b493d923c6f94334df66f |
Close
Hashes for akatsuki_pp_py-0.9.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cb15af7d7b87d0ac1104afad1e2b5941340775498c5eac38f9cd75eb0cbf4fb |
|
MD5 | 7b579c8851263f7a791ed016b27f1e9e |
|
BLAKE2b-256 | 7521ea3948618a2bb0d24e284493c5c6a3acff5d5b6647314c0f30e09f4cb3c8 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4e595dbf6de0d551c35459c1dbb7711926160c51525f1933714f62bc5b6a688 |
|
MD5 | 6a98500eab20dc7f4735d7e43d1ab8b7 |
|
BLAKE2b-256 | c7a2f8e4707173a6506c8aa87d38d6aa586c742328db2c7e148cf5946a265a47 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6345be4ee667499d4f35d37f91d48d2846d2db629860047a9768bddb7ddc94e |
|
MD5 | 0277f7b7160a6683c558fb7bb3286876 |
|
BLAKE2b-256 | fe21e5b6b1d33a04e1566c4609a36c940d95e15c9f270ab9877afe4a7c513071 |
Close
Hashes for akatsuki_pp_py-0.9.7-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24863b6c2d995729ef142bd5180dc730ffc6fbf75e1e07588a2816c206a72690 |
|
MD5 | 6df82633c0f8d61611cc129bebb8e26e |
|
BLAKE2b-256 | 83518c2f1ab195938ee527786daa10fd0df982c73c6b37c97e3e748d8f497ea4 |