osu! difficulty and pp calculation for all modes
Project description
rosu-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 rosu-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 rosu_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 rosu-pp-py
or
$ pip install git+https://github.com/MaxOhn/rosu-pp-py
Learn More
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rina_pp_pyb-0.9.17.tar.gz
(25.8 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.17-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39d7a7ae14f1e1a126b069bcd06db9cbbb57336177d76f725610a6f72a48b0e9 |
|
MD5 | 649d01949201b11bc4a3a4682f5c0603 |
|
BLAKE2b-256 | 96609c6e6b9086b1835a51a78925af5cff02a0e490ff60801a23dcc7ed1ddb99 |
Close
Hashes for rina_pp_pyb-0.9.17-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b73a2dfa0ee242476ffcf01c1d753a2961e09c14b5350e6cc661f0e3f825828c |
|
MD5 | 7c4ef6725f7101b7f627c53e5a06b761 |
|
BLAKE2b-256 | 96241cf74945d9b845c4b7b9a72171a73201946f9f5e502eca0c52595ea38289 |
Close
Hashes for rina_pp_pyb-0.9.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0aa67a875dd2db480d1036766cf63abb64e4e7b10fabc7f437a2afe81c91c8cc |
|
MD5 | ce2ffde78387b4641b94b108c4d63e25 |
|
BLAKE2b-256 | 5f5880507119dddc6a359f0eabd0982ce91a7908278f60e0380d628f5aa5986b |
Close
Hashes for rina_pp_pyb-0.9.17-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22c6aa2e10de66af5c037817c2b8e9cd1f41bb891132d2b06651913507201673 |
|
MD5 | e80d99c629f66b965090ca38c62291a2 |
|
BLAKE2b-256 | 197d4444f4bd7bc01e131c2294d5afa2aef16547cb73265b3eb09b8fe463120c |
Close
Hashes for rina_pp_pyb-0.9.17-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eb6425eb829b9c847e5f7d9c0f9d99114648d9e0f91e50a9ba69bb9ff318db7 |
|
MD5 | a62e4e7881bfcefb200c0e19b280d2d7 |
|
BLAKE2b-256 | f09ff9467078a341c4a3d2df803daf22c9a817266afc301ddda7da6ee4c29fa7 |
Close
Hashes for rina_pp_pyb-0.9.17-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 336714f69c5efdc6a422fda9515387e7dc925f5586423b882469ddfb5edd95a8 |
|
MD5 | b7da8c8d9995e36f6814755f474390eb |
|
BLAKE2b-256 | 91036690affbcf8aa67d515c9034c8732f648bdc674ad7ddf2b60e6fa84f3331 |
Close
Hashes for rina_pp_pyb-0.9.17-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 257dce2b6625610db88e4a92f423babbb667417b40ac663cd5e7778336ef9b8a |
|
MD5 | cde72123281da12895d7fc6abad658c0 |
|
BLAKE2b-256 | 74d89567d3290dab7f757950c42a009109d68abdcf4b473e914a2489abb3c897 |
Close
Hashes for rina_pp_pyb-0.9.17-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2c328445779efabb05dde7cc9f3e4cb00982a72cb0565896d9a73f5bd843d92 |
|
MD5 | 35b5c0d804d99171d3c998216a1391e6 |
|
BLAKE2b-256 | 4284635145da51022edbc06d682b80f0a30f92cf0e0bbdded5f1fe651360abdd |
Close
Hashes for rina_pp_pyb-0.9.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c32a12d4d5c094babe0bd97f8dbe5e2d2f21fae4004f67a13502c8557f1f277 |
|
MD5 | da3d406b7c76d7b5dd7bc2956cec3cf1 |
|
BLAKE2b-256 | 49d8834f98469d377cbf6430bca1f82078a053937f24f7e313c8d5d22ec13b5e |
Close
Hashes for rina_pp_pyb-0.9.17-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d501867d1de8cbbbd4fa95a50e7b3ee1c8cf550e60843f27d084d7609c8b511d |
|
MD5 | 9ddf57c8cc8e7bcea3f876f181709972 |
|
BLAKE2b-256 | cac24af731ee7ab56afd6d55c2d4516438f17681edb8360c8f65980426de7918 |
Close
Hashes for rina_pp_pyb-0.9.17-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2c61e88492707fb7c7bb303125307bb1795a3e3828f7839894fa5718a3dbc9e |
|
MD5 | 7459234c744d0489d208721d6a29ee88 |
|
BLAKE2b-256 | 53f110995a239913d7069d3f38737ed09f6d53f86cb386193895cee0b4d66c6b |
Close
Hashes for rina_pp_pyb-0.9.17-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a79f801e4d76dd9fcf583ae4dda30f39280a1ef0683498f670bff9887d8534fc |
|
MD5 | d82ebcc50279da05667f3e39ac53f36b |
|
BLAKE2b-256 | 4fd2c7e9bb9bdd0c83456356e3ef7ed3ba667f155a9c778c5ad3e910c3ed6601 |
Close
Hashes for rina_pp_pyb-0.9.17-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a141102af49f439917597e6ca2e70e89b7a147847be450ef599229ba9f2b090e |
|
MD5 | 17107c90fcdb2d87cad8da3ee383ac24 |
|
BLAKE2b-256 | fb9d77884d8bd9d932c7b925cd4c9a21ee17acf3d71f828bed95be4750906a54 |
Close
Hashes for rina_pp_pyb-0.9.17-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd57b06948851b6afc4520edd5d5fdfcd1f4d18e06ae189b871ea694977f859c |
|
MD5 | a683e2cfec0e29fdb3f704dff3c73ef6 |
|
BLAKE2b-256 | 2e1e45ec03ed6444fefd0db3bbefa3cf1090e291e20beb4368efcbbb14e888a5 |
Close
Hashes for rina_pp_pyb-0.9.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fb9d2d0065287056d976bb71aa6207c690cd089df81b9a12af5d978aa444ab4 |
|
MD5 | c1954446ca4e5493f64b599ab7bcdd8f |
|
BLAKE2b-256 | 6d75fa150f094defae9104f2d480a075957519dfd185fac2c36d5eabea81ea3a |
Close
Hashes for rina_pp_pyb-0.9.17-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfaf7894cd126a6b1fb09f5ff4eb53f04eef1f732bc740bfb05a6e8c04377115 |
|
MD5 | 335d6df16065ace5ae7b574581682e56 |
|
BLAKE2b-256 | 51620aa780ded4f4d4eb6b2ff5218c9a3329d4e704439e632ddf0630f1b1eb54 |
Close
Hashes for rina_pp_pyb-0.9.17-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a2d840c2a1a708737fb61231cf6ca3e4ba6bd0cbbf7eb5a8673f9c17c15bbc |
|
MD5 | 04653ac1be0751e70f4f7d6aa5191a13 |
|
BLAKE2b-256 | 14d4c40ba9417eca029b203491825d83ead3decb71219b381392bf415d365507 |
Close
Hashes for rina_pp_pyb-0.9.17-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43297f8b4dfb68bce631ef7b5f6d369ab4c2f260027eabd9c161fd93c71e7616 |
|
MD5 | 12b4cdd822a7744655af12a73bb9cd60 |
|
BLAKE2b-256 | b77f8e25b8978bf3f5f5a757c84849b4458fceb418bb1c94ccceb079fe972c48 |
Close
Hashes for rina_pp_pyb-0.9.17-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 219b1d57d7df02a0e2f668e7520a84053fcdf8a032c6330f2b3fcb14b9710efa |
|
MD5 | 885623716d50384dd3e15d5ff42adbdd |
|
BLAKE2b-256 | da0b914f3db5afa4563a2f90333739c3420b0de8cce6b5db9c464a164e1ac188 |
Close
Hashes for rina_pp_pyb-0.9.17-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c7b3b6120f2b5f984f3a76285bc0b74dbfc7af3913649b550a7ce3d5d8c9ff6 |
|
MD5 | a5cef79e662d3570f017a1982a1c52f8 |
|
BLAKE2b-256 | 83b2e138e4f52805e7c5e62b54d50f7f78d741febe2a247009cc5ad2381884c1 |
Close
Hashes for rina_pp_pyb-0.9.17-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1077d1b77dd62babc23900b74876a45e78d20384070bb0b4967e0c7002c76cc0 |
|
MD5 | 03d31cdb5908ea2d89e3ff9512144d98 |
|
BLAKE2b-256 | bdbe5c9a57935a239f2ddff912ff9ccc56def8c31c9ba6a330c594b488783777 |
Close
Hashes for rina_pp_pyb-0.9.17-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fb265853ef18329793507f50027deba242ce98d6adb2e0245ed83770c7af9e5 |
|
MD5 | 6ad2311f896d5e084c4aed5c84540f24 |
|
BLAKE2b-256 | 751ba51e3955713474f548b1d603758faa102d843019ce839c6a6917efe25998 |
Close
Hashes for rina_pp_pyb-0.9.17-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc2bd1165b458a143ad6ad0f4b9c8a91f7ae70264eb433fefa8489b40235b86f |
|
MD5 | 14df077bf84041ac2e04698b9297dedf |
|
BLAKE2b-256 | b68f76555723f150b1be9c9b2cdb4aba98c46f5ded265815ea36a6e6458589d7 |
Close
Hashes for rina_pp_pyb-0.9.17-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1c14a176ef9b20bc7e81c1eda155e0c38abfed5a80f5fe455dcd683451566ae |
|
MD5 | 9f4926075c1dd0234dd243ff8690a63d |
|
BLAKE2b-256 | c07517d1a6e7a4ef2050c172f561a267b2711eada3b46bb2c1295faaea128bb4 |
Close
Hashes for rina_pp_pyb-0.9.17-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f9d651e338d128020b7934f46aed6ea54a818359e706307dd8e8c2327bfe451 |
|
MD5 | 419070f06e46ee38d7d846cad8fba272 |
|
BLAKE2b-256 | 6bcdb70499af7ff58493d27567bd6d21b3f93cee4130b072ff69eb61c3c3660b |
Close
Hashes for rina_pp_pyb-0.9.17-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 926f979be3f15c22f985a2ca0b40f9572327ec2af6b28e49710c2d4695a1e90b |
|
MD5 | 07d00ca7952faec2d6bc4e9237816193 |
|
BLAKE2b-256 | 4aac7d302611e0108f5bd91aa918654d39e80d75fffc62298186cb9c37b1616e |
Close
Hashes for rina_pp_pyb-0.9.17-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99a0cb7f21efd7c988de5f1797a8dcdab549d7986eee24313746200137d6ecb0 |
|
MD5 | 8d2d8808962f8bc14e00605bf657bd19 |
|
BLAKE2b-256 | b7e3db49f41f3a65779b76226adaaadf1578cd04d5c570bc2f88cc87bc20b1ff |
Close
Hashes for rina_pp_pyb-0.9.17-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 978d52ecdf5fb285feeb849b084c8eda822b811ceb961985382ddba97a20fde1 |
|
MD5 | 591282dfb2c82e7c3293d1d2c38e85fe |
|
BLAKE2b-256 | 2c747ae334bc2d10a35157c39315d9c1ae0bd264fd2d98027afff04238253e3d |
Close
Hashes for rina_pp_pyb-0.9.17-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a42a75f1726129ee47b61ddc14610f6a04d2a9be0f0848f20983a5583aa41c7 |
|
MD5 | 96128c20ed8c3c7617e7ca43e1695be0 |
|
BLAKE2b-256 | ebcfddc486748d6c40ad34fcee2a6c2199cc2c50386451ed6a99a9e229745efb |
Close
Hashes for rina_pp_pyb-0.9.17-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 601725139607d2ee84ace02c2a1e6afbce2cbc2b40c99dfbf4386cd3cacc0766 |
|
MD5 | 4f62c04f8fe6e494089f1d9bf801ae23 |
|
BLAKE2b-256 | 977b11b9101d9ddf66f9bb15a36a3a2220a84e0a4b66f0a43a6fa79d19298c2c |