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.13.tar.gz
(17.3 kB
view hashes)
Built Distributions
Close
Hashes for rina_pp_pyb-0.9.13-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43d3df5fc425e945bcd10e22f89d5f4a9a9ad0d422ea5163374dad37c824cec1 |
|
MD5 | 15e8a769e860e35794ea77d5bd713f88 |
|
BLAKE2b-256 | 8c6445f678afa2d9a5e3e3c6b0071707276ce6b0d7fdfde940260b00fa72b4d4 |
Close
Hashes for rina_pp_pyb-0.9.13-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a2d8d04907121eeb3de74ecccb42dfb9bbcfcd9337ca8f98217e84d938b9330 |
|
MD5 | 8c231c95673ff5b4348a8d16de29a37e |
|
BLAKE2b-256 | 4b52664bffd642fda4e22e08a54a9659c7256969d0828fe13595d5f0461e04b1 |
Close
Hashes for rina_pp_pyb-0.9.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67cda88d9276d7764a24ef491a54680e4931dc380a9f0bd16553e7c3d1d0e8f6 |
|
MD5 | 41211a5c40414d84b24c2a592f57b1dd |
|
BLAKE2b-256 | 9d47697f048de7f82cc97d9f9d4079a7b9918370e9859b6808bb70ec12b92983 |
Close
Hashes for rina_pp_pyb-0.9.13-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd769a7362fccdfa0f01a4e232b61f65ee1815951e35dba8bde1f79e4f0572c |
|
MD5 | f005c1dc94d6654f99edf59785bb000e |
|
BLAKE2b-256 | 81bfc48a4fd682264bac9fe87bcfbf4b01b863e95ac30256d1e50cf929f394b0 |
Close
Hashes for rina_pp_pyb-0.9.13-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2bb577c30181dc20988780ca667306ecd165c8ca924c0cb79344dfcd1195568 |
|
MD5 | 33925d2e01833962f4478d4bdeeebb9f |
|
BLAKE2b-256 | 6f467c0b94600e7bb9404d991b72d391d6e7a45af4f582d5c88793af77176320 |
Close
Hashes for rina_pp_pyb-0.9.13-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6b682d7cf00833e36b2fd1b3a27842e33dae554b314df5af06fec6a9474035f |
|
MD5 | 457978db91de7351597fb866b746811d |
|
BLAKE2b-256 | a305ca80fbf1184db586ba40177336de9816d8e5368fc882c556f768d7ed0003 |
Close
Hashes for rina_pp_pyb-0.9.13-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37295d228d992f6e08238801e42ee4e15b606595e8499fc1a0b97e28d0873311 |
|
MD5 | b1b74b34d466a277990c9ad418e3b6d2 |
|
BLAKE2b-256 | a1aeccc414f5137659193222cc3d394915b2e88b5569a8bbef9e66f755086b11 |
Close
Hashes for rina_pp_pyb-0.9.13-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | beff6d853573b1df2cf3e023c6d877980a3cd361dcf7a2cdb423ceaebfa6352a |
|
MD5 | 45fd4bce81b4c4afa6099b0a0222cdbf |
|
BLAKE2b-256 | 7b894842a84e154cb7cb3b83686b4181f378356ba79f14c152d094f0c995ba73 |
Close
Hashes for rina_pp_pyb-0.9.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 312275390f2986902fbf4c33c87152a30638310ebcdfe3404e7718df0dee8d22 |
|
MD5 | 1c27c1b1827b9362e107feb38282ff07 |
|
BLAKE2b-256 | 9b6032fc9f5043a0676fdc9ffce6028dbc050652094e24bf1eb9b16503857c4c |
Close
Hashes for rina_pp_pyb-0.9.13-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04848dba265883d0d81cbf9729673230b906081e6796d0fc6504b6a37a07fbbd |
|
MD5 | e34d7bb77cd958e993315958a44fa77e |
|
BLAKE2b-256 | 9bab65a924dc51e0ff9c4d7d40bd82fb9f76b30621144c55f68d06df74d0cacb |
Close
Hashes for rina_pp_pyb-0.9.13-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 593e3d0ca49dfc47cb3ca34f96c613bee474a3e6132e37e1adacc8241819622b |
|
MD5 | 02e95bb6fcaa0d12b8c57ff0b254a441 |
|
BLAKE2b-256 | 4a88d13a84f10421b7ed00758e68a9995b5cc5f586c0f649d9c86b007c68bf8e |
Close
Hashes for rina_pp_pyb-0.9.13-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7599ac72d4ec7c898a4aae8974fbc08f83d00699ce2076d899dcc8add33fc55 |
|
MD5 | c59263806009a23a04133034fdf11ebd |
|
BLAKE2b-256 | a50536b2f6d9596468e953337c52cc20e5eb78476972b57a02c3324078471e18 |
Close
Hashes for rina_pp_pyb-0.9.13-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6799404a2bdceb742a63ed2beca135d2af3d22359973e26525fa6b35be9a8f22 |
|
MD5 | 3de31afe5c49a4a229c5782c9374373b |
|
BLAKE2b-256 | c0c0a1d802351bd6c52a71c26560ad988ac262ac9d6bf4b38b2395ccdb1a539d |
Close
Hashes for rina_pp_pyb-0.9.13-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 023a2866e1b68daa3252dca070e0459d7c74365fcf8b55cc55fa1536ebb0c0ca |
|
MD5 | e46fdd58d1453fcf4708e39780730358 |
|
BLAKE2b-256 | d6a7f758e8c6bd9ceebb228978caec99814c7585e8984775cbe2799035d8a26f |
Close
Hashes for rina_pp_pyb-0.9.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f1c3a331642f501303f2718380724cd88e438d988e442fc9771fdc7797f9b0f |
|
MD5 | 124df36c989e25d9aa44c0cc757916d9 |
|
BLAKE2b-256 | ad9b1cded68e5ec255a213e9862eda42ecc5df08e9332cabc5a7bac8e87ba61a |
Close
Hashes for rina_pp_pyb-0.9.13-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a392618620da8c2dcf99a14e977be513179726e33dc1bd527ee3591490e824a |
|
MD5 | b297856b8d4e6df2444fc9f92276c216 |
|
BLAKE2b-256 | 0c0bab7db063ff3c59532acf07b1b9e16bce5db695ca6f2c36c59e575442b09a |
Close
Hashes for rina_pp_pyb-0.9.13-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c578813237cc3a241cc1d7e78122a5fda1915d2393148ef1a9793156e3559be5 |
|
MD5 | bd97cef7c43e4d6edeabbaff2f3162b5 |
|
BLAKE2b-256 | b282e34306dce298ab8618c9955c10c7eed70bb7027be58a787de91df17019ae |
Close
Hashes for rina_pp_pyb-0.9.13-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2931d6da5f5b989c6aa14ec28cb4fd7f896c1ab01da537e4769f9e0e91e1991 |
|
MD5 | e1ca1cb3d6e92f66e1c20d76105777db |
|
BLAKE2b-256 | 6b75760015ac9536aaa559305f63bd5eec54c8d67b2d581377fa0afe9b7dd421 |
Close
Hashes for rina_pp_pyb-0.9.13-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a64bbc9d0d4846545dc976b9b651fc532cc80a928ab2151d32dfd0d67b664e4b |
|
MD5 | ed69bca3676e0c4f90bf64d0169c76ce |
|
BLAKE2b-256 | c2a4a42855f10942a6a934ae28e4e8128d7786500841357b3a06405684adaeb6 |
Close
Hashes for rina_pp_pyb-0.9.13-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d04fecc23036d21675e15d972bfe58ac743433385eaae6b53deb45fac461a9c4 |
|
MD5 | 6753da5aed83c37dc335f360c6a35888 |
|
BLAKE2b-256 | 587d42dc9b36b86995a22e1908d0a54ee72b50c10a95fe5b9bdf1b134861e0cd |
Close
Hashes for rina_pp_pyb-0.9.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de8f32ea5e6b1874db68e78aaf6a0d6aabbd28a38f2967b1ecbc7d1cfa1b4fee |
|
MD5 | 03bda847dfcf0aa692f223fb92776e3e |
|
BLAKE2b-256 | 5e0fd7f5ed377cf1345beab33b826db33498d3c343eb4f87eef539149c577948 |
Close
Hashes for rina_pp_pyb-0.9.13-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84d2ba7c87fdbbf96045dbd1f2d713ed3ec1ce1e23d78163ee43c55d5fbb002c |
|
MD5 | e81f19e97cd7c10c634e5bfcc757a2a5 |
|
BLAKE2b-256 | 4652a378029677bcc13d1f74999f04d4be4079fadeb7ac8410c69f2cfc0b602c |
Close
Hashes for rina_pp_pyb-0.9.13-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e929a5f2c96429fb89bd7f7bf17b6c02463a7af6e60690000960aefd330686ba |
|
MD5 | 820f80e2647bae1ca641ffe51b095d35 |
|
BLAKE2b-256 | f3d57cf679346d4009361d1018d8bc112d288430f6ff623677f43e454d102dbb |
Close
Hashes for rina_pp_pyb-0.9.13-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f28a077850c40fe7991e927e0ce64d6a4f6ab0619922c15dc28d4bb6788650 |
|
MD5 | 8159c68dfad5885bfa5af31961d6f26e |
|
BLAKE2b-256 | 33be641973bf0ecffd1a0208c1cca2842cbf91ed1fd5a08cc45b320d9e05445e |
Close
Hashes for rina_pp_pyb-0.9.13-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac083605ca12d49a6e99f9cabf9159bd5cd7c3c2b0f57f5ddb49e4776c64826c |
|
MD5 | 9905a202422fc44fa35b6483742d4314 |
|
BLAKE2b-256 | 07912b5cda9ef7b001d0d4d633701459cdeab74a494bfe25a116de07799051fe |
Close
Hashes for rina_pp_pyb-0.9.13-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99987c057bb83ca3695d0715b5b211d68f9f8cffdf4843e3cc1a76ac9835ee81 |
|
MD5 | 7f71d3b507637972bd317e41c4471539 |
|
BLAKE2b-256 | bff39d23b906fb3ec36a0c5f3e3feb2538928cfaa9ab1169dc457a1141c2f1b5 |
Close
Hashes for rina_pp_pyb-0.9.13-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21777920ab8285babdb9faa382f6418099d7495194f554e392783f6ed6fd3026 |
|
MD5 | 1034d4767accc40a839c109dc8386a28 |
|
BLAKE2b-256 | 60f817c2a2aa0a86ef587c861e98be9de0fa0b835b9b06b0f172379791753c1a |
Close
Hashes for rina_pp_pyb-0.9.13-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c29044d6131e1e07ae84101609fa6650507f0571ac586b3d2c8ae280ffeb02d5 |
|
MD5 | f4adf97401d9a510988828b1b7a51b2c |
|
BLAKE2b-256 | 7fc9ca88f355f8c1314ed277869cbd6897d95ed12d573e89a9781de95fb3e2fc |
Close
Hashes for rina_pp_pyb-0.9.13-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48dfb258557c4b292008e38b3a85d33b589d0e28aa174c50fe056d5a1adf19a8 |
|
MD5 | 4295ca233f0953440eebdbc962cc80b1 |
|
BLAKE2b-256 | 707112f8a0e3af90e5326479496d2b1191898ddc2246b224e6a81b12a65c553b |
Close
Hashes for rina_pp_pyb-0.9.13-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d892a7a2e3154b1a44c3e6d4573ab74d51ba99f7af0bc8715f4fec6ad2e3b21 |
|
MD5 | 70227040ac0fd29158cb061c3ac84c57 |
|
BLAKE2b-256 | fe274bd6a20a2c04bba9d9cfc67b67bb46fe13b8a73f36d1595327c5a43f31b9 |