A Python wrapper for the osu! native library, providing high-level interfaces for beatmap parsing, mod application, and difficulty/performance calculations.
Project description
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.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osu_native_py-0.0.2-py3-none-any.whl.
File metadata
- Download URL: osu_native_py-0.0.2-py3-none-any.whl
- Upload date:
- Size: 22.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0494d38ce99a5f9f98dae69c96c3b716cf10522ef7e8f4b38e98f4e84ef44081
|
|
| MD5 |
e63d24900afe448e423094cb9f4763d6
|
|
| BLAKE2b-256 |
0b40e1cfbae8be2de9f157452c217de0e9a83c90f39227b27c24b560749f80d0
|