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.6.tar.gz
(17.8 kB
view hashes)
Built Distributions
Close
Hashes for akatsuki_pp_py-0.9.6-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9ded93b3237bd37499b3dda51183ba97600f822bf8ac46b42b6142aeb8a2551 |
|
MD5 | bb90daa4c34d2251a43de60b5a98e4d6 |
|
BLAKE2b-256 | b2cb9a613469b11d765ec5bb1da6f78896d17e55d5bb50c947b3f9e8693a9f5f |
Close
Hashes for akatsuki_pp_py-0.9.6-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | affc95f52622debccd87441e78370d1fc15df46a7a951339cbc85ab3568e90c3 |
|
MD5 | f8cc6c02fa00cfa1af821ab708d0b7b1 |
|
BLAKE2b-256 | 27071d8d366b474a6ecb432f83bf4ad7197ec71095bf8d162a114c397d716ddb |
Close
Hashes for akatsuki_pp_py-0.9.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e84385217add7ff636e921a8f8f89dd74d6d3de61764a24917a81aa5e4eea3a |
|
MD5 | 35f37b182a0f6f89be93e350fdbac073 |
|
BLAKE2b-256 | 7a5a6fe4e50af531dcdecd788b4293cb9cfd9daf391e383f54476360d7731b6b |
Close
Hashes for akatsuki_pp_py-0.9.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5a5e6d37926c18742842012dab05b48623baec5426f85becdf66162b28f5cf9 |
|
MD5 | c3929dc8bb65edc89bbc9fc5d3e3ea59 |
|
BLAKE2b-256 | 56450d05d6ce3b0ac401f12e6e0e78a8aeeb9ad558daa083ffd2272756b73814 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9949e85e99592494d7333037cc0f6a356769363b0d38b2e1a5d6c15fe759525c |
|
MD5 | 414872bfa4602ee9c6d7963af4323025 |
|
BLAKE2b-256 | 917d6ff4f88b58d93cb2f3aa4223f2e597b7ad043a647e4ccf1a0fa5da357498 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d48a4665f9d598380efe349ff04769f59dd66c2626bf9616350783755635947f |
|
MD5 | 2108b207f56bd277859d4385068fec4e |
|
BLAKE2b-256 | 26db71b9524c5f2e96c4209a132f99eb6f14094f7a93456f7cb0053af9b8d0eb |
Close
Hashes for akatsuki_pp_py-0.9.6-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8061c34a3e43bd26d7605a839bf0683671b2e93d37a86cf963ef914b8492a2c9 |
|
MD5 | 9fa446abace7aa9f94d2dd84db5f90ab |
|
BLAKE2b-256 | 10bc825b5966b74dc8c46a4baad480241f62b1d5e3be08e8b2bff506b6fa3d60 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6f82021142fb89270fcc6fb2d02c7b5336664c87a3f483c87da1520d7f3c84d |
|
MD5 | 8af7dd04f0c5e96bc066694bb103f162 |
|
BLAKE2b-256 | c765d654e71969a559a94950ba61be36830c20575a1f75857e6bf5a945fa8585 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38423dfe924f8b58ba976daf373a735ada966684940f1928f9d66d3045f99539 |
|
MD5 | 62238bb3ce7496786eb941ac6870fa6d |
|
BLAKE2b-256 | 11f8e4a746bcea073a972c3b241b58c7644d7eab7ffe99596a9dc07eba0a2702 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b10d6da0514d550321e5b4724f9cc00b0e27281b2375bed8c6a94e151458125 |
|
MD5 | 8417945e1bef45e096fa666b13d05dd6 |
|
BLAKE2b-256 | 7cceaca61404b499baaa1f30f2f5b9dda4b8347cad6fe41071222f0ff6c7e4c6 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 567d98aca524ca9d1ef728c5d8ede686c3c017406ba6174550d6e99a3ecb8898 |
|
MD5 | af75b2a92a940c278e6f164d36c7ae46 |
|
BLAKE2b-256 | e29bb93a157abec5f807c66aecb94dc6e823f329ae6c8aa2e905630fad7fdd65 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 374f4c9500a1b5a20b59013fa1151dc837ca1cc74ae75710c9819e4015c0530a |
|
MD5 | a8581ad87e81504aee41b6af5fd239c3 |
|
BLAKE2b-256 | eb391be7f93bd80d19a4326f45cff9728b5b45c5612ba0ff3f6070c4dc364f12 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b041995c984c70da85cb30316abd0604ae2c166f8fe42af490d8ab5ee4ea6c2 |
|
MD5 | bdcd936468b50fd871216182fd1ce9c8 |
|
BLAKE2b-256 | ea7e21a00008d1c2535f8fcd495553830e32aca516c1bd8828ca07ddf1b5b3d2 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5726f02ff3d971c77a5fd5372b3062d356dffbc066c7a3c785b70705b59e43 |
|
MD5 | c843c7dd1490359bddea9d8383652b1e |
|
BLAKE2b-256 | 769071905b178451b9b33cadd6fdda733e54d90aea09d9a9a4c8e4ad02b32835 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f13e89861755c457407dd58850aaf537deb27a1e270eb54ebf6fc8e17f0c0a03 |
|
MD5 | 7f2dd5bec6fc9afd29df8f9db3ce2220 |
|
BLAKE2b-256 | 49a915597b624d4f90e7bfd06641ceaa74d38c05520d6afc900baf9df0010769 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bb68e03121dc070b66f9a6ffb5139cb9271d071badc32add6dc40d787046652 |
|
MD5 | 88c3f8fb28831708c0c6d591c56810f8 |
|
BLAKE2b-256 | b2872c42d2bc22db64b7ae74343a93e8beb7b02fabab9b7e9fdfbce89492576c |
Close
Hashes for akatsuki_pp_py-0.9.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ab8e01688b410049c3bbc9cea52a5bae820240aa78a62f8807c809de42d8273 |
|
MD5 | 3d02a5ee5ed9f9861ec807f48148da82 |
|
BLAKE2b-256 | 58b8435ce089399f5b8ef0d31dfe1b2cb149be16de5514f820c7a5b0f29475f4 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6afcf2191b57d6e0bf6a40875c1d62291745fe59cce1f28a363c1ac0ed54425d |
|
MD5 | e1bd7a6659b7897aa9171137f39c67d1 |
|
BLAKE2b-256 | df6b8c764163fbc02ebdfa6b389a21c589715563cf6709dbef8721cb492b372e |
Close
Hashes for akatsuki_pp_py-0.9.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1580ca69cc5c45e6604adc37889d1274af32ae1207a9ea965e73de962c2bba2b |
|
MD5 | fbcd04fab46013fae12b6003575fee5b |
|
BLAKE2b-256 | 56c058e64ef232f957c86dd2ec35435f039853f37e7ddc2f930d8d19c267abee |
Close
Hashes for akatsuki_pp_py-0.9.6-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c91cf73045a7bcf12dd94e86c732bcac7200ee9f1e3a449e07b6931c2ff11f8 |
|
MD5 | fbae5e0840ad0f3b8e4cadcbd6f8b920 |
|
BLAKE2b-256 | 8bc9fd106ab04222c964891bd4c885606fe84f106e61734f4477264536d7f56d |
Close
Hashes for akatsuki_pp_py-0.9.6-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd7d9e60e62579961ab263f5700525886d9f0f69795f1599b361c120bcbb3ebe |
|
MD5 | 00e3ee44f76b88ca8d1016ac2d9939fe |
|
BLAKE2b-256 | 6b93c7426e311108a3d73d8d68896591adf62d66690e6876bca22ccbff28d3b5 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08a975c7a78757f211abf29133cf8fdf67e81ad887b887fea350bf83c4699e73 |
|
MD5 | 384d89aac741f0ca2bc5e303e69e66b1 |
|
BLAKE2b-256 | bc4230e13e20476b4ad08c65b7814e06b70c16962f6c1a776192ae54fe94e7b6 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03a022d956a37d941080f52a7f867c0ffad4e7e2bd8556d57d5107d58b48592e |
|
MD5 | 28bbdeb7ec855be41b4d62fc18e3e82d |
|
BLAKE2b-256 | 2029283c452e0d88dca49640a055e7c1a3784de0f8db025311ee9d72f0bb014f |
Close
Hashes for akatsuki_pp_py-0.9.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e311a98a1b246dcbf7c34993731b7eca56d44a52a9dda2175a6f153c73751bbe |
|
MD5 | 30bd771224cd39564a595f154461f23a |
|
BLAKE2b-256 | 325756915b8e0fd3420e3967246ccd588b45a3422083d4003a1cda6319cfe687 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b73d0b18bdb057b50cd95ae31771bd974bb262751fefe3d31ccbe415347f465d |
|
MD5 | a3746e6802dbb4907d94f74f459ee213 |
|
BLAKE2b-256 | 061a4f62ae8a6b5ed6a487163ab2d133f9674aca5f2f49028dc29d43ba8eb369 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 352ccb4a580f014a084a2c282bb09c80a1d97ad798e5be97614680ccfea59855 |
|
MD5 | 8bed568b73e6589ade03c580cbd1f449 |
|
BLAKE2b-256 | 222696a51359bee6b8f879e0a4494b2ee2bba0054f160c5899017aedeac7523b |
Close
Hashes for akatsuki_pp_py-0.9.6-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3497d7ec18b8ecfea59347ba14dadc6e3b200c1bdf5c6b142cdc2b087af7793 |
|
MD5 | c1c54ae3bb9792feff560d655302a0d7 |
|
BLAKE2b-256 | f8c654362ebf526568d484259853b97847435f8c6b7c90d7bfe49a8ee8a73d64 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6e72544acd38fd2937788bcec839251b5ada8f3544915317fcaafc326b667f4 |
|
MD5 | 30dc28455d2ade5fd162d5d0567afac6 |
|
BLAKE2b-256 | e525d3e16658ad6e4cf6f6a5b36e494d475e14d473f75613ecb066bff49d5342 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cae32bb3cc7ef3f3c52b2f9935d8df9191bf48fda59806907fc2d4dbe8ef892 |
|
MD5 | 862f68fa8f0a6da34e2652abb218865e |
|
BLAKE2b-256 | 4558c92acfdce9dd65571e96d5e65ed2cb2e01361ff3afb814ad30fcb526a12d |
Close
Hashes for akatsuki_pp_py-0.9.6-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d44b41834109d16ac58658f8d0939e0a80eb347eed1fda5edbc495ffe7de6ee |
|
MD5 | 2aa352c4cd954c328545a4e7fd3200b5 |
|
BLAKE2b-256 | 1f9e9c2e6cb2a37ff27ede69cee4b584dc435d8b28756abb772aef128d34c2b9 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0026cda63bbe6fdaca5e2ed50c14c81d0a8a2f2325fc17bab2518184cb5002a |
|
MD5 | 1216ab66165bed117de5d308cb3602ea |
|
BLAKE2b-256 | c50dbed94ee29d61506dcc893a79e22fb4da600f72dfa1e29b6c28f891ed6e03 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e5b8b855ed14811a6774a6676bcc79d874ef06e503f12bb3d5186c36bd9088f |
|
MD5 | 6dafdaa3ba23d61fceb91ce40a82b689 |
|
BLAKE2b-256 | fb20330a5cb8ead1d1582ed4355db984ab9f03439c78290d606a8c993b9aa2df |
Close
Hashes for akatsuki_pp_py-0.9.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e62fb744d1b2beb66b5efb915a3e6f3e88866124140c720d936ae3524b8adce |
|
MD5 | 58da31e9a06a6511a3f110471fa76672 |
|
BLAKE2b-256 | bba44c56f0f30e5fb9b944afd0a42960054c7ffc07994ac60ffa3eb273d3bb0c |
Close
Hashes for akatsuki_pp_py-0.9.6-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73e6d8259ac11f72df9ea0ff07280f956459b9fba3b1b2321bcf126663643259 |
|
MD5 | b29c88c4d649b8f989138e4b47686a12 |
|
BLAKE2b-256 | 5202d3a55b222db06c81c45e963528e71cdf694e83f66f82111d6409c5fb6d42 |
Close
Hashes for akatsuki_pp_py-0.9.6-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40377f63f2e64725b604d6bc96f305bec7c6108e637c0f0961012af9c5c23ddd |
|
MD5 | 32e6d37e9ba29783704e068c737a1b7b |
|
BLAKE2b-256 | 8187e4ee8f9a0baa9e3807668d4d03500d9bf30ef40f1a913682a680cf7c34c0 |