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.9.tar.gz
(17.9 kB
view hashes)
Built Distributions
Close
Hashes for akatsuki_pp_py-0.9.9-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 592e032a90a9758397d33e37eb95f64d13319520c8c6ab1ea7ee4ff646f528d6 |
|
MD5 | 5b1feca13f99b4bf4d5328a26836632d |
|
BLAKE2b-256 | 2140c9202bf7d3f3b65afa33702073c9298bce723ad31fd0350e9738ce545a7e |
Close
Hashes for akatsuki_pp_py-0.9.9-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 717463420c9c7aaf63006f5644a73a12c58bf71d598f280e89a91c7cf5705118 |
|
MD5 | b4765906adb92873536e45242568fd4f |
|
BLAKE2b-256 | 078db985419d340a1ea95761b43bad0d82ae9a3b2af817715c7dbf48b28c0cd4 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0bba2cf0294ced6488fe1f545cd0a15be01721ba8b9f1b464576532caf2921 |
|
MD5 | 241a47956b28919046cf8784a91d15a6 |
|
BLAKE2b-256 | 8064680e6b0a76bf71766d789a94972516397bf769ced22e322ac2cb2e0eb94b |
Close
Hashes for akatsuki_pp_py-0.9.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba7130664fb6713c0bc8ed1af10cd875a90f52f852b1207c4c402e4b9bff3271 |
|
MD5 | 68cda8d8f35aad4ef571d5c8d08581fd |
|
BLAKE2b-256 | 55308c67d76acea0a5268b63ef5a2d95ca1b221d7e88476bd269481ea7bce2d8 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f80ad234c643a36a6199157a18b0db53219fe965c55d32ae408f95820e4becc0 |
|
MD5 | 6a56cbe29c8899ca64606a6d2aa72848 |
|
BLAKE2b-256 | ae216b8bc64fe664782e1809bd08ecb0bbe0dd1c9a8485291ffb6cc855177f77 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca5f1e51358f9d830d201e4910a3904ba3d978ef71da99a8ee128e83fb379fa8 |
|
MD5 | 3beb06e4d934446c4247c7963e47682b |
|
BLAKE2b-256 | fe16217d0cfeffd2ff55c288fdcd492659c28fce937b3803972772afdbfeb75d |
Close
Hashes for akatsuki_pp_py-0.9.9-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdac87298085ca6fda79f72f570ad41152ce07fea81c4180ebbe13317da74fb2 |
|
MD5 | 0a2362c323acf3a33b4d5813d6385679 |
|
BLAKE2b-256 | b9fcb512dc50d3511933ef81b68c5921f91c02769b6b11a5f39542807ba85cd6 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3458f5b83b5ad86ec5b89dd235afed0d914d59982cf751c98505b51389bb04d3 |
|
MD5 | 66364b094314fdd2bf3afa61665b3ecc |
|
BLAKE2b-256 | 9f3ade9fd5f3bfaead711b591b7e69d836fc7954e2c73b54fa6dab5607fadbc6 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f82fb2651b4e48b93f1ecda08c11a4d002a7b4edd99ea4d1e1f21f3a2ddce26 |
|
MD5 | b121d2e635036ad3bb12174bf95b33c4 |
|
BLAKE2b-256 | 37bcdab1e30843ad3385fc8b69f99b5be8d61142d42fa96ea033e1a228311405 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f65e03a1880d16e5d0f2bba7bc90a754bdcb1e6e72e704d8dbce6a2dbf8730c2 |
|
MD5 | a5bd9cbc563f5bf2c5ed87b3f08e27e7 |
|
BLAKE2b-256 | 6162afb7910739752a607709643a2320c3d0f86c6d8178b3beb58711e0534cd0 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fee62ab838ffb6e76cf5a5dee05637b8d140667e75c34267b1b5eb8a9f464764 |
|
MD5 | fab0599e6fde544c2673c53390d0ff52 |
|
BLAKE2b-256 | 040fdafb87ca168d24c5379b6c828335238f3ce1a6ce26ba7204d8dcdbb05b75 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d677e97dca8ad8a5182144714acd7573e52610a7256d4c0783c75521ced228c |
|
MD5 | 5d117a3ab2df477cd98975ec1644ded1 |
|
BLAKE2b-256 | 61121ebd45fff790e33e340d32ca9ef719e8174b358e151d80c57dc028813db4 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e4f93329bcf6f894035f8296081b7ebb39583a8018accc0ab6d7f7c3a3c2a9b |
|
MD5 | 82728a6a3840fbede9fdec9e287bd3cf |
|
BLAKE2b-256 | 830f4f9507ba30541ccaaa26c26ed9292d3eb20843eec1d960bb448048b232a6 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 339cade542a90087ab69766b6c705246bd32345d291ea2d21c85aec2ea07772f |
|
MD5 | 2de99fb38d6a18c0f72c15fe33c88d35 |
|
BLAKE2b-256 | 139297815f958084dc8803eca4d9a212877d0462bb1e0099a297c7e73ef0e3ed |
Close
Hashes for akatsuki_pp_py-0.9.9-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aed7f12357a102432f8ced4781423b9d7141ecb1405f090232092b9ff9e0cde |
|
MD5 | 85c1702c5961b6d3129d9c066aa3c8f7 |
|
BLAKE2b-256 | 447add4a74e08ad78d4e7f02f4474ef4820ad34a3cb767d1d6e0b676f6fa6104 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48937fd4ee580c906625f1e62b02c0443509a442e729f4d6bf13a6975d80994b |
|
MD5 | c6ff4f8663d68785b18c623bde8f12e6 |
|
BLAKE2b-256 | 3331a3dc39afd9944b4009e88e46f76e61e92088dd0ebf3e800a223b93db42f3 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f04474d746037de3b6437445bac6fd27cfa9b76c16fc07c484cc76609d4860d6 |
|
MD5 | 934cb3ce3f197baa356fa98ff9e6aca2 |
|
BLAKE2b-256 | fe9c8783c7946bcbce4b8fd976e064001c6778172493ea86c9696a18979c0e5b |
Close
Hashes for akatsuki_pp_py-0.9.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a61a8dfb8f76f06b561e11420078f2c03f54748f4de488afc607e1e191bb80 |
|
MD5 | 14e85367c7a67c47fc458ebae8a60737 |
|
BLAKE2b-256 | e898458cb6ea09f7b11435d2a73432794f313e5e3181a85d547880940182e9a4 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1029706a81c4208dc3ea840d02241c00791e529688a1e35d523024a898ca50f2 |
|
MD5 | 633a2bbad03cee9f4d0fe9b4e3b7dd93 |
|
BLAKE2b-256 | 264e749fd9e5a6b47f2f57f91c1101bca99cd1dd7fc4737b3e9a62c2755b2bb7 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25ddec126332cde5400ed4cc4cb317df4f0ed5c6b1181bf72c9386f371b0e911 |
|
MD5 | 60a9ca750ea8b41fef8be5d9cfaffd9f |
|
BLAKE2b-256 | 28d494b76ff72917735252e3ba2a616eaee2af8d571623ab4c5380f039422df6 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp39-cp39-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63b8616460f03add5f08773c66f150966c00d07bdba29a3eb839b58f5e98927e |
|
MD5 | ffb0ece896ebe643259f7516c492daf8 |
|
BLAKE2b-256 | 32ef071597a643727907d6b1b410d213351dcefcf2698ba783b33183763a3bb8 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9b85dbd674480ae990d46265a70457683c8e2e48a9ea9cf2f7f0e2cbf18264c |
|
MD5 | 4276bedfc3cd907486357d21483d519d |
|
BLAKE2b-256 | 2f3970f6e0ce751ce92cfc9ae2a0e4eda651e5f2fb071065baaa8c5dfb8d8f44 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0119b7acdad6240e56e7c306fceb19ba727696277ef650829cbe44a6d33b4c21 |
|
MD5 | 7b63121b9875a8b03a66abe3e25ef84e |
|
BLAKE2b-256 | 67413c9a9a79ac085fdef63d91ee75d7b1c4c97219def435d502423651106539 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bc48af72b8a12c3ed609f4ab7013ca109d11497ba6bdbaf0a157e229b4e8a0c |
|
MD5 | 34b3948a74abe66ad4e313bab5314366 |
|
BLAKE2b-256 | 8661d703d370ddb7e62c3def0fed6b8356248dca1d011dcafe0fb759bb42c6b9 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11a8c7e5ade68ca3572b1e7ca6c8c1da143c78ddcc9e94bb045ba37cbe7a6e85 |
|
MD5 | 1042d71e0532781f7fbd48265aeff11f |
|
BLAKE2b-256 | 0667debf3466c051c6b1ff88b37537dba2ab284971fd359c0cda667eabd17b08 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6c5fe240e6b7e98dbb8e684a9af677e78f4fdb28539cc8663b869cb1a5a63a4 |
|
MD5 | e9da7e4757540ba1970b59d4fadfc03f |
|
BLAKE2b-256 | 4aa4cbf50a22f0d244fb63dff4391fb8357bec9ec29e1a2c4baf0ebacc436a3a |
Close
Hashes for akatsuki_pp_py-0.9.9-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2da4686dea33ebbd50ed9bf6905f15f991693da4e78a8621b8554b3ab0d1f94 |
|
MD5 | 5895d9251bf1a747758ef2762810368c |
|
BLAKE2b-256 | 66d343ed53b75c19fbb0a172d3094b322e81f6c323ee8619f4682bf674fc55fd |
Close
Hashes for akatsuki_pp_py-0.9.9-cp38-cp38-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04a4d7a5a7c5367e186807a1ae7fd12c63cab880763b5f17b2b2f05cbeddc6a7 |
|
MD5 | 74041c8d17e8e63f44b66125b243089e |
|
BLAKE2b-256 | b53222393cfb473bb21bafd87818a5c49c84ea15051d30375b91d209567a566d |
Close
Hashes for akatsuki_pp_py-0.9.9-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39cdf9d6fd79b64210b692b0369e16165db91f2356c37fe250060f4112e0dcf8 |
|
MD5 | e490f77656f1c7f3bcee692e48703c6a |
|
BLAKE2b-256 | 8843163379dcf54232722aba54ceed5da94975192af4bd14ad78eca9e5cd0584 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb779b2565a403fb35772f589460c801c5b53292308aacd2313ea01a55216264 |
|
MD5 | 1e2a7ead60c14140840c86ed0059bb13 |
|
BLAKE2b-256 | 92e470d2d85615203ee39f08e606465151a12ebb970c1688b4598d426bdc7815 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01546c7e8d21beb66bce816e4f586f3962a12c232fea047ed936352182a1c3a4 |
|
MD5 | 7d636f0e7d42ebf85e719ae3339cc22a |
|
BLAKE2b-256 | 877047522b8731728db39c8f9cd747c25b0fe5cd3de6f5dd61ac9b77c0068e95 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7eee6cd3e86d2a829b8c80327e688a4745522c387a3a2cc5e9bbc98efa6621f |
|
MD5 | 8bac2ac1717e800599ddec71ebd1c46c |
|
BLAKE2b-256 | 6b051bac42514d1c7cc3a3891f42089a5ecc5ea9d714653b07418a89edea6dae |
Close
Hashes for akatsuki_pp_py-0.9.9-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93664cd39bba7e90c3ae39a4dddb61938a4e08aea3e50e6f18e3ca00e3073a50 |
|
MD5 | fd467318d52fe3246a8da3d98b63ba16 |
|
BLAKE2b-256 | fd90a6ceb2a5b58fe6867dddb3a074a0ec19ab59a7544c017379a4f233af31a4 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp37-cp37m-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 433ad4ff248984fd77ed9cc9ac4a2f8fc2ae1476161c82c99bfb4b1ba4cf7d7e |
|
MD5 | 8998ee2975ff7280c0e3d565f6aad812 |
|
BLAKE2b-256 | c390b7b877831c1d767f835b00c75e4c150f12a4676ef5d9555157a002e9b024 |
Close
Hashes for akatsuki_pp_py-0.9.9-cp37-cp37m-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf576a16e3d9941a62b2cff4a8f3d60638680db337ffcc5a6602a4225febb44 |
|
MD5 | 1b2133ceb318013aa781951929cb7ec4 |
|
BLAKE2b-256 | 5d4fcb2a2e95bd6be58df3bd741081c942659963e5152901144651ea07236f11 |