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:
- Initialise
- Set parameters
- Calculate
- Check results
- 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".
Metadata
Release files for oppaipy 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oppaipy-1.0.4.tar.gz | 3.8 kB | Without provenance | Details for oppaipy-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oppaipy-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for oppaipy-1.0.4-py3-none-any.whl |
Total release size: 7.9 kB
Release files / oppaipy-1.0.4.tar.gz
| Download URL | oppaipy-1.0.4.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43c854f13406125bafca5068ed0ebd87a6c6f68735b6f1f755fa114da1e66021
|
|
BLAKE2b-256 checksum How to use checksums |
c94478f460a35e3a91ad887d7a677a5740e7c2707fb64b368fa5be96451b54a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / oppaipy-1.0.4-py3-none-any.whl
| Download URL | oppaipy-1.0.4-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a176175f0706815d4f6278ab30ea79942953f1f911dd5d9892b5f653633efb8b
|
|
BLAKE2b-256 checksum How to use checksums |
03c9be65a9f3d0203849390fb70732c41305b9819f598c8844c37797ebe0abe6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for oppaipy 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.