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.0.tar.gz
(17.9 kB
view hashes)
Built Distributions
Close
Hashes for akatsuki_pp_py-1.0.0-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8de8570e5feddf8eae0f20e5809624d4468fd7398e4989fc6a71869856ef93b8 |
|
MD5 | f331e03f5d9e450ecd9c542d47bb71f7 |
|
BLAKE2b-256 | 23f9d41aaf11ae9a4f57df9c9df8634e0a7c7bf974e4bee6a030b9db2a0fa19c |
Close
Hashes for akatsuki_pp_py-1.0.0-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 024ecfeb96d5668592a029370c9bf87f686ba8da63c8f1bc2f6676b4fe0c5b3d |
|
MD5 | c2c291d2a2393b3afd99f8d56b1c6019 |
|
BLAKE2b-256 | 3a57b9819818e61a67949b4e021aee2d3a5255c08639ca84288ccda5c67d803f |
Close
Hashes for akatsuki_pp_py-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f47c3615b727b797b1bbbd1b79c5a4310b28aae4d6865ac7e82c7e1d93fd51 |
|
MD5 | 0a2912bfce81d85afc7134e0d9326f99 |
|
BLAKE2b-256 | ed2d1a970df2797a45064fe454d9d52f45fa81f762a2f7bbc5f7443eeeeaa8f4 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cf8d5e120f54f97df82bf16df67da8d231afcf278d3ac57fe25892c0943e5f6 |
|
MD5 | 57f9d1e69120fdad617ddad3b5fdc8a7 |
|
BLAKE2b-256 | 3c5b834128eb94cee2ac7378b85aa0e0b48cf15d0c883aa11c5e51cb1ea3ef1c |
Close
Hashes for akatsuki_pp_py-1.0.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34937cf08426df31de13839970e71a01d283f511301449763d9e0a5e140348c |
|
MD5 | 1f99f5964be47ef80946a99fc4d4f344 |
|
BLAKE2b-256 | c9a2d521b216d4270aa84d1835d4d38beab57d09e578c735efb946f0f6664560 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 984ba46d37e0816dd048876f0fff5833f1200b3c0fef4d59464ba2366e4048cc |
|
MD5 | da51c0d371acbddd716a305196867355 |
|
BLAKE2b-256 | 2bd10b2b0b5354b73c81124975b0f93af54dda8c09b32d9a83e18b21c4514ead |
Close
Hashes for akatsuki_pp_py-1.0.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac4ea01c8ee1107fc8732fbafa5ad81f091ee5532674e2277959b77ea2e0dd59 |
|
MD5 | 12f136b04ac489085eeb172393d7c7b3 |
|
BLAKE2b-256 | db889bc9d4e5f243854fb62ae8c5c08256657eeeeb2ea9d1d98b23461ee57065 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66fee503206303a89493a30418cfed616067c8501f96f28c449d8fd872d6a371 |
|
MD5 | c8bf78dbb0d88833dcea331657383765 |
|
BLAKE2b-256 | 1f0e1d00c55ff314de342785feed60b940fa5a067fa10ab76a224bbaeb3d6ce0 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e563a26a520cb1e37a609d1ac219ceea290d15289ead1831f20df53e27168e44 |
|
MD5 | 4f5bf8a5b3214cd1830e08fcfea8ae1f |
|
BLAKE2b-256 | 29f3d4b76ae9f5e915fe3999e9cc79a846456b7776a16de4b01f52e9c0b02991 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30831cec0232e938f37115123aafd0247118401738cc18b9dc617ddbbfe195b4 |
|
MD5 | 6f0fa0ba5c8a18860dec7051b18661bb |
|
BLAKE2b-256 | 0144105158f125f9582e1514fd9c302f2121b53abbde2c42d89e4758ea8cc688 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c48afd090e8ca9fb758f4b81e1b4244f6b98a6fe23ffe8dc18739ba9dedc1afd |
|
MD5 | 03355e87a44e8478b001186bf6255655 |
|
BLAKE2b-256 | b79143bfcff99cffc4886ab5eea47a83b1ab6942f810041313a99e5c8d8dbf1a |
Close
Hashes for akatsuki_pp_py-1.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de9eab0858d1f7f0f94074b61093c65f4888f7feac72892a981fbdd341451556 |
|
MD5 | 02c6b0ffd6a354d40fe7aae232486b1e |
|
BLAKE2b-256 | 7a50bc7e5064b8009cd157a8dde36d85c08d2f592a78929f6843596207cb9a39 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fbb1037671a05e85b17c02828df32efb7f1da9b709c4e3d99298934f72d3567 |
|
MD5 | 8cc769b4fd480ae752212ae70ce19d4f |
|
BLAKE2b-256 | 47a3087a15519934ceccf0e98ab2d3f7766551286807ee0b33faa1314dbb45b9 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3008ce2bc5f80c5691a392b91473f48a82b11811a16820e37ffd3f3bc683111 |
|
MD5 | 2bc41c9bd863fda9e97690edd13d92c9 |
|
BLAKE2b-256 | bd7aeb699e776e14e72e44493ef3fd56f8e485cd994bd6553edecdb6ded376e5 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9685c083c66c6697f7aa8c0d108b7009e1f024d2fd13214d663caaacca98a776 |
|
MD5 | 0cfc7f0877043e2bd580c3f42ce8f8df |
|
BLAKE2b-256 | f74d4aec17d50521fc5ee81ea997ce58baa200b087cec12638139443703a3b73 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e32f5a8fce575c4ab59eb6985f61b58050311d13b3fb0af370b9afa050ba956d |
|
MD5 | 51c93f7245574fb0237b5453db45e448 |
|
BLAKE2b-256 | 8aeb05049d8de06055e46721082790ffe3d649234febdd502aec9fa2d8b76b8b |
Close
Hashes for akatsuki_pp_py-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6241660678c34ace82699340176c07f19388c75125b33cd34bed7f715a737f1e |
|
MD5 | ab9606d602398f860b1cf7dad533ca2f |
|
BLAKE2b-256 | 242f16bde584ad54d6fdf9c286ecc72b76bbc779e9bb46da52282ecd331e26c1 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb42b509742ffc610d53781f3d4c920ca505c03a21f3f6057f3bd995cc71dea4 |
|
MD5 | 65319b3e740ebf55ba123dfb80ef78ef |
|
BLAKE2b-256 | ded8bc609477126cfd01c189f7d228c354d5652065d92a5a20d24c86f6f1a219 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afa0832150be10afa7fa5ee381595cd0862ba788efb31e9435e8e4bcfbdb2bc4 |
|
MD5 | f76bef5486f8df4464cc6d4d3236c5ba |
|
BLAKE2b-256 | 25f6716346d0e055a049c8ff11c1e356ce337c42e9a4e7b89685ffaf4bfc10a2 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6220738267bc9aede9ee6909713d185f59e9da013f7e71853657e13149c4f5d |
|
MD5 | 61e62a0a48bcf4f9cc1555ed72633703 |
|
BLAKE2b-256 | c984fa8e4c33e1400f4be80db2a59ffd66ed6f78b796eb8cce9e84d307dd105a |
Close
Hashes for akatsuki_pp_py-1.0.0-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50fb898d88313ade8d1eb759a7692a9e98a516c75279afc7f96e06da2527bf5d |
|
MD5 | e0f1aa5fb8a7d82d626b5978660c9859 |
|
BLAKE2b-256 | 89cc1aba96facea320c44c170ff1f453bcd8f7ab1af1eef93226bf1b8facc2d4 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00cfe7cf277016d791f09d0bba010a044ad9e457946ee3a7a78c905d52b7d39b |
|
MD5 | de954ed594e31ae6a89b35d5ebb005ba |
|
BLAKE2b-256 | 550f3756d7f82b6443b33cbd7722655e32bd0f53c8e250756e9d27fa96063da2 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fb8c78f81cc78adb3bd4820498b3d5bdba8a4cd086f771e15330ac95d2f9c11 |
|
MD5 | 92a3d354a20efa69a30545f95ac48c24 |
|
BLAKE2b-256 | 2e165a7f372a086b4cec383860ce7a7cc9da791fb9a0b1044b85ed0b061c0464 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa9a34f90aa399d390f5b62b912fc3eceec92a2eac185186cfd8b73b4cdd4b9 |
|
MD5 | d843f2684a4c50d75e06fa431bebae27 |
|
BLAKE2b-256 | aade00517446b432fb1f6a526b8ee4dad3190adb6163d76b1a29a05bbc30b56b |
Close
Hashes for akatsuki_pp_py-1.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2a41b2cc5b81358af23350cccca22259dd0961865de65358949dead8e2d856 |
|
MD5 | 7cd4ed7a9072cbd2f2f65afab00366b4 |
|
BLAKE2b-256 | 3b9cb7a8a97d51265c12e48124f40d665850db2d0a9960ae1ab680707cfde6df |
Close
Hashes for akatsuki_pp_py-1.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fc4f85da08e95ca6f7e26c17021a9663efd9e5aff8873cdb36a54e9c8f2b457 |
|
MD5 | 525129d576c7deaaf4078aa21ef9feae |
|
BLAKE2b-256 | f47c482ebd37b8597f63f8b2dbd0eb6c21ead2595ab7d56be6df1654ad02facc |
Close
Hashes for akatsuki_pp_py-1.0.0-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f7d7e32ac98b7bf5baf4eb86cb294f7d0996ecdd0ebe115e56e2f57092e0e9a |
|
MD5 | 024f23fe91617cf0722caf8e76da40b0 |
|
BLAKE2b-256 | 1ddd01d596a96871bb46964acb334e4cf856ec137b6199aa552106f9f7327e03 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afbc7b74239c61848587e98808cc424a9c0e25eb2b674d32715c6cfc95b70bd2 |
|
MD5 | 27fdf543f93631b84ba772fd4f8f027b |
|
BLAKE2b-256 | 4a364c2c5c254beb3a2174b1def2a5051befc848d6425dc4d1462d21b529e6ff |
Close
Hashes for akatsuki_pp_py-1.0.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4016f72a2e129e72f859614de75773b613d1f780a909751b368d283a3c1196aa |
|
MD5 | cfbdc1942540114f6c763489d0939e01 |
|
BLAKE2b-256 | 050380329484d42994428f1efb3b6bff5118974f76db09269864399991af518e |
Close
Hashes for akatsuki_pp_py-1.0.0-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2e384b6389035493ac3a52ebabe5e44e1366d2ec17ad7207980b2273c07df88 |
|
MD5 | 8fe99e32cd72c58c1e92f4893d0db076 |
|
BLAKE2b-256 | 9caf19c0a3b7aac34f2ff86a3ff2fd005ae8c6326d405c0f25e70477fc33dec1 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11ae1654fc8f3ab8f8495e9a29709674e2e013aa8334b20e28d66cea246aacc7 |
|
MD5 | cd997eb56e61ed373da866c5570a176d |
|
BLAKE2b-256 | 4a3ddcc3af5d3de4f53f5a26e3f043dc087ea182e99c8878a51cd2a09aa9be19 |
Close
Hashes for akatsuki_pp_py-1.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3afbae2de3caf9800ca1f200dbd3e01d1a33b4c5d83341dd9efaf99b1f76dfc8 |
|
MD5 | e5f43625d76c4f839999c85a05efae78 |
|
BLAKE2b-256 | 74966ad8a693f371212705c0b67a64c430459bf02cd81049958cc74f4657a11a |
Close
Hashes for akatsuki_pp_py-1.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79e5c9f1a703be8cb0930332f0e500c3d48e5f30be2cc6f8015897c7b99596b8 |
|
MD5 | 219290e79e559a7ebd70909f62900d63 |
|
BLAKE2b-256 | 93ebd975f9337d541cbe9a59f7be3133844c193ecff05ca6c4f4c87e48983d4b |
Close
Hashes for akatsuki_pp_py-1.0.0-cp37-cp37m-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3970a28bc8a27ec940e820d2afcf70f464c75cbe08039fb1d1a4a4089ac79206 |
|
MD5 | 88c86e5cca3b56331dd061016f85b606 |
|
BLAKE2b-256 | 671bd87029fa458828167e2995ba2ddf51f2fad893a7cd5e2874c8557758cb2c |
Close
Hashes for akatsuki_pp_py-1.0.0-cp37-cp37m-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b2fa099c9899ccd4e40485d71c0a24c2b098c448ac2e6cf1a10baf8c06653a1 |
|
MD5 | f5d585c5c720276fbe306441102fe2e8 |
|
BLAKE2b-256 | 3e71b6816ea1f994b74eb8093af074d0b7977140d3ccce0f839df2e812562ef1 |