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.23.tar.gz
(25.8 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.23-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f27c5c3072894e8a43067016563f34468f7e699d3471567327b6a42195a92c |
|
MD5 | a5c1d2ac280ebcc70bc91e463dd8b70b |
|
BLAKE2b-256 | cd21e5eceb68ca718931efc50c4489981a353ef9ab770a6be12ab434966be5bc |
Close
Hashes for rina_pp_pyb-0.9.23-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22f09810f9073c9695a690f93ffb69e0cc05412308c2eca0131c3182e887ab61 |
|
MD5 | 54251eb3f45a7c1eb9556afb6f683b40 |
|
BLAKE2b-256 | 65809d1cb765b8e0d2b313e6a1db0f962d61712c5b715fa1a13128fee858649c |
Close
Hashes for rina_pp_pyb-0.9.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bf44d72fd94df08bc70b8d81aa827ca7a5b0c0e3e6bdf230a4a83d2f78137c0 |
|
MD5 | 6b2dd5ec424c34ae6448b18657e6838c |
|
BLAKE2b-256 | 012d3b5d463bf4d9e3e7f311b23ea5d6bc658f70ef7ce06a779862ce0ff81f73 |
Close
Hashes for rina_pp_pyb-0.9.23-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81e3c1fcb0581fb2ce35a4a6fe431e9b16b5627cc9091945131e46b88e6834cf |
|
MD5 | 08ee9e9424702e6efff0ca102fb37dac |
|
BLAKE2b-256 | f2ad0a9dc9f9bccaac4c3b785f14a0e42b8e87e20a1e47bb53908e2fc25d91e0 |
Close
Hashes for rina_pp_pyb-0.9.23-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb59302c927f8fc6715ce315450524f7c1310f56bfbb4ef79edf4913769ff4f4 |
|
MD5 | 050455810a2f9437f7760c667fe1d9b9 |
|
BLAKE2b-256 | 6b693a6dea177c62e4d14514a71f7c7227398da783734bd8fc7a4ec110afb69a |
Close
Hashes for rina_pp_pyb-0.9.23-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5d1fe4a9c780f8a5dd2c63de1c1e189062ed3a93c2e162699c7e2ded2f2e913 |
|
MD5 | ef2674bd6ec70ac52e16e8e382065bd0 |
|
BLAKE2b-256 | 41d2a4c2fbb9b4e804bcc0ece7d2f12cfad755743c910f22d1d75cea9c8dbbb4 |
Close
Hashes for rina_pp_pyb-0.9.23-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a5d5ec8b64fd689d2f589383cafdb38e73e4204bcb0f109d064c2d9c343a078 |
|
MD5 | 5dfa4ae96cdbfe77937db3fae9f4c770 |
|
BLAKE2b-256 | e1b8c29624412c1803c0c55366ca00a3695bbc8b3d4552f23b6ce5cfe7dc303a |
Close
Hashes for rina_pp_pyb-0.9.23-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6c52c7b786f64c6e2c7f375172a5ffed60540debf68fc8a5b1b5ffc2b268d11 |
|
MD5 | 011e3445ebf819ac2d6a3f0162768bf8 |
|
BLAKE2b-256 | 4a9a093f5fcb2048982da166e449a36969dc23744f77f37fbd7b7e55302b67c0 |
Close
Hashes for rina_pp_pyb-0.9.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 930b69396d03d327ce01c612960a0fbaa9a3b6e058eaca9f59eac7c04b58cde4 |
|
MD5 | 552bdb2b2992c74084ef2e5960c0796f |
|
BLAKE2b-256 | 0938a844258d88ea7282ae50f5a5d2a1eb15b53eaff9300ba0fa7e0eba484d4d |
Close
Hashes for rina_pp_pyb-0.9.23-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 421b19f367e573cc21d607ba3b85b9741469f401fbda15653a6b09e36ec4cf72 |
|
MD5 | 7f08d8ee6a85f50fda540628a034ac5c |
|
BLAKE2b-256 | 75be00cf021a73d715d67688d3f2ef5048ad7f6460e47fcc6b468d8ade6efc56 |
Close
Hashes for rina_pp_pyb-0.9.23-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88f061390155ba9d4d32a0c6b0bcd9b06c70012820df015da0c8cc8012c6ccdd |
|
MD5 | 50687d3b41a71520fafe5b5f85ea7881 |
|
BLAKE2b-256 | acf5d3258b20a2d55e4e5b1ae8231bb9147ff12901c240cfa4c3e5606bd2e695 |
Close
Hashes for rina_pp_pyb-0.9.23-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b88a774afa5d65278d8254f641dc1917bd71e4ba86b02ac5ca940c858105d68 |
|
MD5 | a684fa7f9d3642f6ba493eccb0e4749b |
|
BLAKE2b-256 | 285e92a5fe09adbcd0dfbb0e1010da0cf3ac354ec63613c3f4bbd198d6bf68b9 |
Close
Hashes for rina_pp_pyb-0.9.23-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 528f8a344f141ec1129825e283ae18f78b1004dd2c02dcb1a8c3da57fdaf9c4d |
|
MD5 | 846d8689e947667c7b517a8856701939 |
|
BLAKE2b-256 | ec39ea5679d95e5efb1abc97717fae2bb291922946802cd573abe917da671d22 |
Close
Hashes for rina_pp_pyb-0.9.23-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab5e2a1f51f1a0766f31ca046e61d9233e77f72a7fd00f62ed96edb8813b6ad6 |
|
MD5 | ba5a3634a331c4b3e7fa6bfe1719d907 |
|
BLAKE2b-256 | 112b3c87b35809260ac138c555bdd5d02c61950025202eddbb181a3f67db80c8 |
Close
Hashes for rina_pp_pyb-0.9.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c4a222dccd921c266a20b083e3b7188d34eae7cf733357c9f6536d06b70fe4c |
|
MD5 | b8718f008a255dff50bb7a694414e09d |
|
BLAKE2b-256 | 190e12ed86e9eff25136dfac867cb74d48ee73d58c9a1a1b83e22a4443622d9e |
Close
Hashes for rina_pp_pyb-0.9.23-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8acff16fd20da7f6cc5db4fc60ae9d4d02197aaa2048073a5e4410fbb537349f |
|
MD5 | 283ba2b900f3e421f0609e4150939341 |
|
BLAKE2b-256 | 932dd76e7512f91d35fb3fec5226ccfed2ad5bc38a8bb3cb5461923a1d497d2b |
Close
Hashes for rina_pp_pyb-0.9.23-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04e37a6f9a665b164ac751deb37e17c65a4f0ac105d5961117263af81ee8aac0 |
|
MD5 | cea81903fda90a96a5d9e9117c7e61cb |
|
BLAKE2b-256 | 1ab43fa8cf2bce9a2594905a5fedc5492a0780b4f9336ae39ae4be898c32a2a3 |
Close
Hashes for rina_pp_pyb-0.9.23-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed1f41106cc28240efa5cb74eb5f3f668e1d7fef38bc8e5c9ed779ee2d4e1ea6 |
|
MD5 | 9f6f827498b759100db5fef9c5afa24b |
|
BLAKE2b-256 | 61de3da90f11a1b93c4ec7680bf7e45eaba73d379ccd7fd97b77701b1a2fed85 |
Close
Hashes for rina_pp_pyb-0.9.23-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b14d710936885e633f9688132926c83a5e12c6ee11bdbfe61c9d593a9bdb6c86 |
|
MD5 | 65bd17cb2872a807e6f4baf597e17c2c |
|
BLAKE2b-256 | a6bc4c49d38522791b253460d80f4bd31432b7a66d1de2cb48e63c6af2adae71 |
Close
Hashes for rina_pp_pyb-0.9.23-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17f22b035f7e163d45b6aeda26808972486b9d21ff160a0724e9f59ed3c5ce86 |
|
MD5 | c9a016c10943a2fabf0321369b2fbdae |
|
BLAKE2b-256 | 4f98b109d1f4a12f63a593f3be0474ab05a9d33f035b0dde56ec05acf425873a |
Close
Hashes for rina_pp_pyb-0.9.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 014efb28cfc48ecfab0157c0923050cbcb03897a2d7f47f7ad10f9f2c60a69e0 |
|
MD5 | b274a10a986a5f637ec3682e7175bff6 |
|
BLAKE2b-256 | bcb6aa19f894dde8d01286132948b76b01167b2a5aa2c79770fcf13b61bec3bc |
Close
Hashes for rina_pp_pyb-0.9.23-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a519f3766777565896a65ef5eabf7a5a7790ef9326efa2f6ac034cf007d825b2 |
|
MD5 | a02346631c3a685cc3975030ae2865bf |
|
BLAKE2b-256 | 81c8c676bae15d8f08c161b0f279bf23ffdbcc24922fb3ab67de8408234f86ae |
Close
Hashes for rina_pp_pyb-0.9.23-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19375571fa44d77aa2063393c1a97fcd2a72671525026ec1e760fd65f102fd2e |
|
MD5 | d0dd917c493b5ae6a67c37ce24c2db08 |
|
BLAKE2b-256 | 3bb76a20c716ad0c61e52beb4c335e8daa44feba29e696355ea91518fc1af675 |
Close
Hashes for rina_pp_pyb-0.9.23-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c85450d9fe18c9412160422b15709d8ae2591c36f5d1c6b6c21b7b5ae663740e |
|
MD5 | 89fcc50ab65efd5d268f59ada5301b55 |
|
BLAKE2b-256 | 5d6bc9f17774332be8f3c88dbe33c5a8f14a9e3ca68b3450b3d882c8e2cbc0ba |
Close
Hashes for rina_pp_pyb-0.9.23-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d59e095a6aaa54122f5b3fcbfecf5d5b0285099834d3701d514ff66a4c65297 |
|
MD5 | a198094e583d53fa7ce24609d5471931 |
|
BLAKE2b-256 | 96894d7c3a3df7a382bbf52899e0eda250478ba5f1f52097248b6eb27dc5e6ff |
Close
Hashes for rina_pp_pyb-0.9.23-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7435ab6ea76b85f553bb136e7ca814e966430eafac94023eb4c127a873c34804 |
|
MD5 | 1ced3c1f455c77fd122f4ab8ebbbc5ac |
|
BLAKE2b-256 | 84a5ff7956af03e5ae0c869baa7afadb227e3cbdcf883094d5e5dd6317da1152 |
Close
Hashes for rina_pp_pyb-0.9.23-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76811352213a82f94a89703e1b89db9ebda8ead3c656a4b59384caa49863ad46 |
|
MD5 | 2aec60455a518f7e284b33e775a361bd |
|
BLAKE2b-256 | ebe7bf8129f8dfd2ad63345d592f280bbdb894f5a83a9be6be6e0264890619d6 |
Close
Hashes for rina_pp_pyb-0.9.23-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85456c352a89f451d165cfec395b16237f09706c73eb7d77e626ac140d781910 |
|
MD5 | 29f1021bc34116da78c3820eb31cff6b |
|
BLAKE2b-256 | 64fb333a128426a3f80cdecafecddea57ce4a3bfddb28c88b8bdd56f45a70025 |
Close
Hashes for rina_pp_pyb-0.9.23-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ec49e16e2c5479394c844e0a1e557de56720b7fd7d7e5b26d159af2a70a66d |
|
MD5 | 46d8de5a1308505ace1711633de3166c |
|
BLAKE2b-256 | 4894962289e52875fa4e6200c519636a79e1bafc4bec4aadcb96f55b5868ed50 |
Close
Hashes for rina_pp_pyb-0.9.23-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5033bb96048065b682dc328fbbf07a263d280ac0bfb814793f7931eba1f7be8f |
|
MD5 | 3888ff0cb9675d52857e998d80ff8231 |
|
BLAKE2b-256 | 002728c7f49c71320bc7c6a1d6ab639c5d39f351b15347be39de5099d81c7aee |