Skip to main content

A simple object-oriented python3 wrapper around the python bindings of oppai-ng

Project description

oppaipy

oppaipy is a simple object-oriented python3 wrapper around the python bindings of oppai-ng.

Usage

$ pip install oppaipy

There are 5 steps to using oppaipy:

  1. Initialise
  2. Set parameters
  3. Calculate
  4. Check results
  5. Release resources

Example

>>> import oppaipy
>>> calc = oppaipy.Calculator()
>>> calc.set_beatmap("/path/to/beatmap")
>>> calc.set_misses(1)
>>> calc.set_combo(2354)
>>> calc.calculate()
>>> print(calc.pp)
727.3976135253906
>>> calc.close()

There is some extra syntactic sugar to make it shorter for simple usage however

Simple example

>>> import oppaipy
>>> with oppaipy.Calculator("/path/to/beatmap", misses=1) as calc:
...     print(calc.calculate())
(7.8976135253906, 727.3976135253906)

API

# Setting parameters
Calculator.set_beatmap(beatmap_path)
Calculator.set_mods(mods)
Calculator.set_combo(combo)
Calculator.set_accuracy_percent(accuracy)
Calculator.set_accuracy(count_100, count_50)
Calculator.set_misses(misses)
Calculator.set_score_version(score_version)
Calculator.set_base_ar(ar)
Calculator.set_base_od(od)
Calculator.set_base_cs(cs)
Calculator.set_base_hp(hp)
Calculator.reset()

# Calculating
Calculator.calculate()

# Getting values
Calculator.pp
Calculator.aim_pp
Calculator.speed_pp
Calculator.acc_pp
Calculator.stars
Calculator.aim_stars
Calculator.speed_stars

# Cleanup
Calculator.close()

Why should I use this?

You get the speed of the C bindings with a pythonic object interface.

Why the name "oppaipy"?

I already used "OOppai" for the wrapper of the original oppai's bindings, and I didn't like the look of "OOppai-ng".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oppaipy-1.0.4.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

oppaipy-1.0.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file oppaipy-1.0.4.tar.gz.

File metadata

  • Download URL: oppaipy-1.0.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.0

File hashes

Hashes for oppaipy-1.0.4.tar.gz
Algorithm Hash digest
SHA256 43c854f13406125bafca5068ed0ebd87a6c6f68735b6f1f755fa114da1e66021
MD5 74908d9aee2167ead74f0c5f2bab3995
BLAKE2b-256 c94478f460a35e3a91ad887d7a677a5740e7c2707fb64b368fa5be96451b54a9

See more details on using hashes here.

File details

Details for the file oppaipy-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: oppaipy-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.0

File hashes

Hashes for oppaipy-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a176175f0706815d4f6278ab30ea79942953f1f911dd5d9892b5f653633efb8b
MD5 48f4d7ac82fef187318224183752518c
BLAKE2b-256 03c9be65a9f3d0203849390fb70732c41305b9819f598c8844c37797ebe0abe6

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