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.3-py3-none-any.whl (22.9 MB view details)

Uploaded Python 3

File details

Details for the file osu_native_py-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: osu_native_py-0.0.3-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.12

File hashes

Hashes for osu_native_py-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 02fcc62a77d2c934e1052445b6b154ea971fb45947e93b14c65da8bcff536416
MD5 5eb8c742e03819b970fbfe4778d6e1c9
BLAKE2b-256 955ff0c344bad8b6f69991d5731bbf492f1f7318361a5c513b533bb4a3b5d72e

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