Skip to main content

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

PyPI Version Python Version License

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

Project details


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

If you're not sure about the file name format, learn more about wheel file names.

osu_native_py-0.0.2-py3-none-any.whl (22.9 MB view details)

Uploaded Python 3

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

Hashes for osu_native_py-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0494d38ce99a5f9f98dae69c96c3b716cf10522ef7e8f4b38e98f4e84ef44081
MD5 e63d24900afe448e423094cb9f4763d6
BLAKE2b-256 0b40e1cfbae8be2de9f157452c217de0e9a83c90f39227b27c24b560749f80d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page