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.5.tar.gz
(17.6 kB
view hashes)
Built Distributions
Close
Hashes for akatsuki_pp_py-0.9.5-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c71e42a3a28787f1c9b9cd955af317b1a79f52e3c6eb3b60cb216430af31594a |
|
MD5 | 59f0d9d9b618d5c2e3c3a4218387135b |
|
BLAKE2b-256 | f60b2969630336b95cabd62a9b2a043829ad500d818957ffc01135260cfb6f98 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 181f317a3eabc83406e60281de76de7e61a1eb58757dfccf561fffa3e582ee09 |
|
MD5 | 820aa92d08e4352dd85d0da5ab17e533 |
|
BLAKE2b-256 | 2be017605a29d079350f0fc27f938c61b85e32c306c579515e236c4c878fce7e |
Close
Hashes for akatsuki_pp_py-0.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca6f1ea1ec89beeca6215f6d5a848da225ff5d1edef9cdfd60387126d32379fd |
|
MD5 | 35ec68a6f83ce3c41b081ae22c098a7c |
|
BLAKE2b-256 | 0df291c302134d3b2f0709c2d58a7848db892a8b905ea2577070a45e06b5b94c |
Close
Hashes for akatsuki_pp_py-0.9.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d2da9463dd5074177624c75f7275c53ccc127e2ba4f47b49ddf38b623de8d2e |
|
MD5 | 81e7b3ead3e12b4b25fb6bd743ada2f2 |
|
BLAKE2b-256 | 0c35f74a6118e0ded8f315136810f13715997e825384a47c76d1aa45eb3204a3 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86101805c25886cd486827750a9bd2dc2f0df528227d7c0ae1e5468e38a08b11 |
|
MD5 | 9b37b51ea688fcba11ef552402e0ae2d |
|
BLAKE2b-256 | e4b2e9290e8c4cf963edfb9b25fa6c774412c7ce385db28c97f89e2e589d6df7 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de29d75ad416fab953d5dcd3116bca4aaef113e4907975fe057894bc251bf93a |
|
MD5 | 4196a87cb6c30046e4c7fb3374d0410c |
|
BLAKE2b-256 | 0fd3a41c78780afc5b3ab04550e0b7ffba82455e93111ed8d7c6483a7291fe3c |
Close
Hashes for akatsuki_pp_py-0.9.5-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 931f4dc916d1dc4bf93501f6e7b222024e48a53c282e02e8352a333c8cc5ff91 |
|
MD5 | 6589db8cd2dadeab91b4510f613efda1 |
|
BLAKE2b-256 | 14dddb9586fc61189d250c4ec1764be4d283da011a050bb9157dba1340e175c6 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34638c49bffabe97fef3bf554ea5caf3a1fb4f5b4bbb3326202c4e9b61b8a542 |
|
MD5 | 6bfe9c80888fb923642e9e8c92681ebd |
|
BLAKE2b-256 | 9960000ba0f08104a65ca1eab630abe01ff148d1d0e1b6053e9ff13a7f15b379 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | becfa2ad21051297c2d2b1329186e3243943a3b55c0f92d28a48a4bf20b08c02 |
|
MD5 | e4ef1cf17a63ba7c09644664b528278f |
|
BLAKE2b-256 | 3c29884334602ca5253835b37bdcc747de4df84bd26d6f4ad09f34dc1ec83a40 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cdfbe8b1899138c9622e06373b89ea4f542a9211c1bf7a3e706e9c78b6e062c |
|
MD5 | 5b6e4636186095c5612d1d859508cc1f |
|
BLAKE2b-256 | 8c49cbf293657c13429a5d4d5b554afb1f29b27d193aa41547bf785f6a6b9fce |
Close
Hashes for akatsuki_pp_py-0.9.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af4a687d9c3ff56fd9f9b7904507b534e58b0a9cf292c05a8c8c579ac88aa04f |
|
MD5 | 811d3bb68eca69c5b9ae9b0c6170d675 |
|
BLAKE2b-256 | 39c9007237048a396a6b790304951b6d61dafc51922671cfa326c6b5d7f25d40 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42897cc3a969fc6cda62cdb70047ae142e6e8ccc6c80e7dde7198a4d1ebab66c |
|
MD5 | afe900648178fd83453196a1c0bb2dcc |
|
BLAKE2b-256 | 92a660a5844f7bd0b905f6a3fc81f052b66156eb95839e5d68e75e7e57906cb2 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e6f2ec4afcccabc6cbc82accefffc29f24ce7c0ebb8af9b20158f27d103ccc2 |
|
MD5 | 2d6f81a4d08a2984923a6183f7543212 |
|
BLAKE2b-256 | 3a7bf39d8c89871874e0a33014d3b3992b1d1eb49a99ac8cd675e167fd08e553 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a377743a76a033fefbb4bd8b207a9cc52ca5848c46b3e65b75a34023f04767de |
|
MD5 | d10b5a15e5d222fa284df18cfb0951f8 |
|
BLAKE2b-256 | 37e56285e26d63d20b92d81e521b99a6cd4d7b0ecad2b37a607ba8d37ae1b8a1 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ee1a994e70d12dccb9a985bfb91325807065c8736f139ce1dfc251d955cfe33 |
|
MD5 | 523c6c98bdbdc14ff8fc1c30a09892fb |
|
BLAKE2b-256 | d6b08214c96896c92b2d8d9d578de4c5c71407422eed1944dfd27e1c0118694f |
Close
Hashes for akatsuki_pp_py-0.9.5-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 783480561226bdbcee8eb91480ff8a59aea8e5dbf5eb83b5751eac3fc9897fd8 |
|
MD5 | affd2bce4af20e67fcecc7c5c0c2bb4a |
|
BLAKE2b-256 | ec7f764b421ad398d3aff0d5d4e6b99d48091d66109e6fcc6d275b02179268e1 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0fa42a853384def2d277a15ec47b8afbea43f56e8cf3dfb69d8bcb9d1261f2e |
|
MD5 | 3aaa028a1ba708d5bc696de782a0a76d |
|
BLAKE2b-256 | e926269d9987427204b32a2016b942df2d79bacfada7cbf0ed4ff3c4fd9b2b30 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13ce54c038fa78dce40fe02d5414d6a26ac9e8ad5c3016ffc1bfd33d3fb9835 |
|
MD5 | c1eb777ed695857c245c23a4399b1af8 |
|
BLAKE2b-256 | 7d4a4770ddef090e4bbb3d2b083aeec238d7b962c2d9be8ed10261028bdb4933 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b4a1e54b60eda295077ecd2337f1864ef5352db90e84ca649baab6140393c1d |
|
MD5 | f7b2bf7eb45b3d9e91a1d40ea24be88e |
|
BLAKE2b-256 | dd5dc57f9dfe457a13703cf5a9f5a29369432342f67296532c3d7f2b946bb2f0 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c86dd032378c648bb8acae33a4803ecfe9f8aee9a2fecb2b3de07f9c4674a3a0 |
|
MD5 | 338b8f898a77e5d023f2c08b5f618a23 |
|
BLAKE2b-256 | 04a596ed7eb83edd46f0d10188222c10ada76689871e2ef2f49470b3c12788ad |
Close
Hashes for akatsuki_pp_py-0.9.5-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6522acefa1129f9b999201876412c1121492bc4cd5d8e478e6386bd27d4fffbe |
|
MD5 | 9680bdbafbc2eb0ff6c41421df894ebf |
|
BLAKE2b-256 | ac6ae853c7fb7962a813a04f5e737a15ea22a391438dd999941e7f8107151234 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14607691db7d8e356b48f5e854dd83e7c16c6543ef682a077eecd2b9e56652bd |
|
MD5 | 2f161839186e0bf0ecf41baa8e43fc60 |
|
BLAKE2b-256 | 0d4e53298446e938ced10fa3e04e7ce22d59bef7878ecb446d3a6824ef10d9a7 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c7b5b75924edb4da0d5db36efd04372020b06a1a1a4d0a9aa3ed7d8bf6c7414 |
|
MD5 | 0573b3c01da944718263b79730ab464b |
|
BLAKE2b-256 | 0bc7f45b107d295bcdd94af3d0221445ae29dd17e6613e41e9ff2ec756db9f31 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 931b762952ee474048eac37fc7e36b420e6357c426c2b60107f7439711d3c9a6 |
|
MD5 | bc71dd2c183ce004de3bfb5ffd206db2 |
|
BLAKE2b-256 | 99f1236671c9afb32ebf042c0f4bbef28041d0647d99a2d80abefe6e4456389b |
Close
Hashes for akatsuki_pp_py-0.9.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aa6a7bfb357545ecfc461914747f1075d2993bf4bcb29d0489e5fb0e43f49db |
|
MD5 | afa2d31bc724f450b8a200d2f1de593f |
|
BLAKE2b-256 | 8f330f7b0c2612c952ae08d0281b7ad5979ba3586760d0df3c771f2a83472a78 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | feddd245c858a566b48efcff6758964492ecd0a6fec342a6c302b1866e73ca9a |
|
MD5 | 4dfc60477741b8ba03f34131eb7271bb |
|
BLAKE2b-256 | 8bf93be8b45526dc6cc1da28c58c58dfc1967c37c69a5358d0148d9fd40e31b8 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1fae2665193faf481c4508041985a59a5caab7cef11dfa5fb3032bb7504e560 |
|
MD5 | 4491ac30180d8994842c1dc73d17e427 |
|
BLAKE2b-256 | d11406464cb5cfb95dff46aac0a134d9c361451198406c128096ea1d40ea4014 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6368be43066eb32f56a9a73fc8701aa3145ccd879a3ffb4b1ef22031720e67 |
|
MD5 | 138f66ab6bce289ef7b36c129a0c90bd |
|
BLAKE2b-256 | ad4ec0019c65d2105f86012a0aa8a314e9d64eba28a67467e3191bbaa22bf5de |
Close
Hashes for akatsuki_pp_py-0.9.5-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35841c00a72ec35565a014f4aaaa0ac62c5c492d22ce88aa95379e79cbad86a3 |
|
MD5 | e443c667be914e13918718fff279f91c |
|
BLAKE2b-256 | 1404d668155f96fae149159c5198953b8e70789cf815b8ea9f71bd8793b59ac3 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6615ef75493de0a0c10e771c77364b7374b2d5974b8617280264ee1ac3cef9a7 |
|
MD5 | 2b51ca43a0f2161688b611f0c8a6f4ea |
|
BLAKE2b-256 | 39e1b363d1b8bd9814355d76464b77b42e7d00d1b4fb8942e14225bf755bc8cb |
Close
Hashes for akatsuki_pp_py-0.9.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 881674d79fbdcd9cef7c7935ac1a8356fd14ea5bbf14e3fd1f0fbdae8f419f96 |
|
MD5 | ca9192caf87bb2a74c1b7b84ca0ac2a1 |
|
BLAKE2b-256 | 9f08633cc80b4946f216fcaf8c116162008915e0fc1b7fdcc7036617f0faa254 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e74c165185b23b6809838df29292fb02a2648832e3a647efbc777de24f62baff |
|
MD5 | 24b5260146fa57bbe2c4bdfcb3368da1 |
|
BLAKE2b-256 | 516a7244da20c03391c276e35b80c1e62bdbd3a837677544b6476f9f92f94680 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc9a4b25d87a0b6945687cb3ae60ee10ef90bad04f0580a11ea716c94004cc0 |
|
MD5 | bcee7a5dc223f85e3f8abd6b5c9865a7 |
|
BLAKE2b-256 | 6ed1cb6e6750469b05bc2a39ae77a3aeb938b634bdbd6acc02aeb6142c58a56b |
Close
Hashes for akatsuki_pp_py-0.9.5-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8019210301884f0a02200f1b5cec048b305cf22e3cdd88caeae6356565ba5ecb |
|
MD5 | 2330e7e57d9202e2af7d2dc493cf6d5d |
|
BLAKE2b-256 | 586d2cc4b86c58ca85505ef98f683f66375466e65ce49d5884f688094801db37 |
Close
Hashes for akatsuki_pp_py-0.9.5-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32f7ede478a3de8b5c1ea031af93adb68d86f26ac296dccae9c4e2508871bfe8 |
|
MD5 | dcf1d331dbf6c3b19b2baa13fcfad053 |
|
BLAKE2b-256 | d27a5f4f5c8e0aaf984f925fa7b2f0296fbbd65a34e69c6e4066ea8e94aa88a3 |