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.3.tar.gz
(17.6 kB
view hashes)
Built Distributions
Close
Hashes for akatsuki_pp_py-0.9.3-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3009a399cd10bde747ceccfbdcb4e09d8c5dd17be473e1f005ffe1b2fd7343ba |
|
MD5 | ae11f645c65e6d7344c0c4968f34bf33 |
|
BLAKE2b-256 | 0e6298b4237597f1f49cf0b122fa391a911371dd0f11a97e91471b93820efd97 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbd9d55e99a4e2c731c8f871a8a0270ac7f9feed9bba54c8f77f954dff406bc2 |
|
MD5 | 2409c2f2f56fbb9de30f2de0e44cae64 |
|
BLAKE2b-256 | 140d0e4e5e65fc9579911202625c868ada060275c33cc232958939ef66ebbb45 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc26faaeb7709d9472b3e1003788a957ce28bd95804162ca5c373aec9edae0b2 |
|
MD5 | 1be2062ed90723bc3562db2cda0ea1a6 |
|
BLAKE2b-256 | 9382e14cab95675032ebaa8f4660542eddc9493127c6754452bf31e08e2e81f9 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a41b242cd4af158e95de409b82b98f5e1a124450597e5acc2be852e6b0c2b63c |
|
MD5 | 9e407f8314d0d78fb18a40a1dcddb87d |
|
BLAKE2b-256 | c38262a4895266a6cf3ee11aadd5486c8c136cf5a81028bb24e39e593ee661a1 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ef01d925a81941e996d298050cc8cd305bb747ec1c556dc4a0034503a8c130a |
|
MD5 | e84aab11d4ed08c6b248fe4b07f0adae |
|
BLAKE2b-256 | aabb0f8e25f03fb0e61772177b2ae673b13bd2f3f4692fe27f99eb861209ab6a |
Close
Hashes for akatsuki_pp_py-0.9.3-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f4600870291a823ef47a6acc8519fae0bdabdd6cfb9ed0e1356bf2797d13a13 |
|
MD5 | 57abd3b887d801eac8654bd5bdd26bea |
|
BLAKE2b-256 | 8019de71f27502331bbf8e32f201a3d77bee19fc748daa53158c5fa66d8f0636 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8092588afb0a826b14c1457b3a5e84af0bdf9bce32890cfd059bb957f29f2a4d |
|
MD5 | 7b45207d88cd26a97e5f616f3c31ed6c |
|
BLAKE2b-256 | 5bfc852ae6946d96a0ac0976cac417c2a741101f3e9c04ab177f489c184a6220 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39d82958c110c39b347d0b9d734d730ef5d8d387037da409fb382525e9828422 |
|
MD5 | 970586c1fa1691540a1957954f91bee4 |
|
BLAKE2b-256 | c3c62f332b43d6486df38cc7634def675789bd7e74d7a4f9de3a00fdb78d81cd |
Close
Hashes for akatsuki_pp_py-0.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71a091542a88ce7712deb4c76fcde3ddb53fdf47c9124a0be30c65a2136c36aa |
|
MD5 | 018caa710b2ee5fcb19bd05642320434 |
|
BLAKE2b-256 | 2bc63682dc44ac0e1ef6fb04570544e5fbdfb987fb84e39c84d9f8ad8eb9e399 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e5deee1492749e5f09199ab19f7c67a979d13ff7fb2de2f1e1a8d529539d41f |
|
MD5 | b6cbf93f7948c4879208b8d75826440b |
|
BLAKE2b-256 | 081a85ef14a7bbeecec7af7fc20a786c274df81fd2e400238e396c06efc1f969 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3392028b1f133548f06a0b4fafc1fb3185fa02e5b478bc635497ae96048ede84 |
|
MD5 | f7f155b7aa3a77599109f02bc1ad0162 |
|
BLAKE2b-256 | 501f9c52fce04ab90948a9c7480da48526502e8c1ad638502eb34a06d061b579 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f6fb332b81e3b875cf6289e0c70f43baa20ffeb878354d02f05b480b52867e7 |
|
MD5 | d755ac14d7673244a629acd1f9712c42 |
|
BLAKE2b-256 | 7e9166ee7b0b7114688fb72e73fc00618a37ccc09f9571480212a5f2518c0315 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5368a92cde5732c1825cf253ca570b14d3a51caed2890680bb9bf0d2495912d9 |
|
MD5 | 0d371631c7b195132adee2fe82268806 |
|
BLAKE2b-256 | d3191c77fa8f65b457f49f2f1fc608b923d31f928c139ff2193930d4deb8ae25 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88842a6bbdfdd2939881b1d51757622258bbf958d84f1f8f82557b97500be2b7 |
|
MD5 | c40766fc8600a90e638a7f9793ffa79c |
|
BLAKE2b-256 | 1d22ffdb2269f936ec1817edae6fb6cf992a66818c3d8e08b75a42f6266cd12f |
Close
Hashes for akatsuki_pp_py-0.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b1f65bd3175d24035e9f4b16d259b9fa4aed2ba126bbc5759b34310a43d2af |
|
MD5 | bc82241ba6816d80c6acf3b4c013ace2 |
|
BLAKE2b-256 | 62421b264602ae9239d6d9e2b4c92b7b55d942ad2c2f6f43ccb47242728b1bcb |
Close
Hashes for akatsuki_pp_py-0.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b9c2dcd1e85f3c1932a460e804d70cc8f9b202d8c1a07b27fcfff52b48c33ec |
|
MD5 | d6161ca83619fbceffb9672dece120b5 |
|
BLAKE2b-256 | e79e8d0e5850cd289bcc977b9325e1183cd488425edecb3942082a6ab6e0d49c |
Close
Hashes for akatsuki_pp_py-0.9.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 892b4d982d5682d14e447817b8fcbf46753f118c08d2152231d767a2d17ab14f |
|
MD5 | 858262dd4818b5dcdbc4cfaae27a700a |
|
BLAKE2b-256 | fefec1b78c8d4977b06704259595d65682812b777a4c00f46b82a843bf8821a6 |
Close
Hashes for akatsuki_pp_py-0.9.3-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 524d614c2b2ae7bf5383261b5ff592ddcf26d34cbf3deabee73351fb7c581e46 |
|
MD5 | f4f14cb9d3f625bbba16a33ae3c19bab |
|
BLAKE2b-256 | 40249c0b93822eaf4edba124590d39d79e07528ae25ea301c5a679691adca6d7 |