Metadata-Version: 2.4
Name: osu-native-py
Version: 0.0.2
Summary: A Python wrapper for the osu! native library, providing high-level interfaces for beatmap parsing, mod application, and difficulty/performance calculations.
License: MIT
License-File: LICENSE
Keywords: osu,osu!,difficulty,performance,pp
Author: 7mochi
Author-email: flyingcatdm@gmail.com
Requires-Python: >=3.8
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Project-URL: Repository, https://github.com/7mochi/osu-native-py
Description-Content-Type: text/markdown

# osu-native-py

[![PyPI Version](https://img.shields.io/pypi/v/osu-native-py.svg)](https://pypi.org/project/osu-native-py/)
[![Python Version](https://img.shields.io/pypi/pyversions/osu-native-py.svg)](https://pypi.org/project/osu-native-py/)
[![License](https://img.shields.io/badge/license-mit%20license-brightgreen.svg)][license]

Python wrapper for [osu-native], providing difficulty and performance calculation for all [osu!] modes.

## Example

### Calculating performance

```python
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

```bash
pip install osu-native-py
```

## Supported Platforms

- **Windows**: x64
- **Linux**: x64
- **macOS**: ARM64 (Apple Silicon)

## Thanks to
- [minisbett](https://github.com/minisbett) for maintaining [osu-native].
- [Lekuruu](https://github.com/Lekuruu) for helping me with Python-related questions and some cleanup of the code.

[osu!]: https://osu.ppy.sh/
[osu-native]: https://github.com/minisbett/osu-native
[license]: https://github.com/7mochi/osu-native-py/blob/master/LICENSE

