osu-native-py
Python wrapper for osu-native, providing difficulty and performance calculation for all osu! modes.
Example
Calculating performance
from osu_native_py.wrapper.calculators import create_difficulty_calculator
from osu_native_py.wrapper.calculators import create_performance_calculator
from osu_native_py.wrapper.objects import Beatmap
from osu_native_py.wrapper.objects import Mod
from osu_native_py.wrapper.objects import ModsCollection
from osu_native_py.wrapper.objects import Ruleset
from osu_native_py.wrapper.objects import ScoreInfo
BEATMAP_PATH = "/path/to/file.osu"
beatmap = Beatmap.from_file(BEATMAP_PATH)
ruleset = Ruleset.from_id(0)
mods = ModsCollection.create()
for mod_name in ["DT", "CL"]:
mod = Mod.create(mod_name)
mods.add(mod)
score = ScoreInfo(
accuracy=0.94,
max_combo=116,
count_great=65,
count_meh=0,
count_ok=6,
count_miss=0,
)
diff_calc = create_difficulty_calculator(ruleset, beatmap)
diff_attrs = diff_calc.calculate(mods)
perf_calc = create_performance_calculator(ruleset)
perf_attrs = perf_calc.calculate(ruleset, beatmap, mods, score, diff_attrs)
print(perf_attrs.total)
Installation
pip install osu-native-py
Supported Platforms
- Windows: x64
- Linux: x64
- macOS: ARM64 (Apple Silicon)
Thanks to
- minisbett for maintaining osu-native.
- Lekuruu for helping me with Python-related questions and some cleanup of the code.
Release files for osu-native-py 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| osu_native_py-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / osu_native_py-0.1.0-py3-none-any.whl
| Download URL | osu_native_py-0.1.0-py3-none-any.whl |
|---|---|
| Size | 22.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe30bc6382a65117b575a71300498b592824bcfc96a3941493374baaf46dd947
|
|
BLAKE2b-256 checksum How to use checksums |
0319bd55549439c1d554ea5e5a4d6c4cc60dfa5401913f7c233ca0f349ccc711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|