Python api wrapper for osu!droid relax
Project description
Installation
pip install odrx-py git+https://github.com/unclem2/rosu-pp-py.git
API Wrapper
Quick Start
from odrx_py import AsyncODRXAPIClient
# Initialize client
client = AsyncODRXAPIClient()
# Get user by ID
user = await client.get_user_fromid(12345)
# Get beatmap
beatmap = await client.get_beatmap_fromid(1234567)
# Get leaderboard
leaderboard = await client.get_leaderboard(type="pp")
# Get top scores for a user
top_scores = await client.get_top_scores(12345)
Methods
User Methods
get_user_fromid(user_id)- Fetch user by IDget_user_fromusername(username)- Fetch user by username
Beatmap Methods
get_beatmap_fromid(map_id)- Fetch beatmap by IDget_beatmap_frommd5(md5)- Fetch beatmap by MD5 hashget_beatmap_leaderboard_fromid(map_id)- Get leaderboard for beatmap by IDget_beatmap_leaderboard_frommd5(md5)- Get leaderboard for beatmap by MD5
Score Methods
get_top_scores(user_id)- Get top 100 scores for userget_recent_score(user_id, offset)- Get recent scores with optional offsetget_scores_uid_beatmap_fromid(user_id, map_id)- Get user scores on beatmap by IDget_scores_uid_beatmap_frommd5(user_id, md5)- Get user scores on beatmap by MD5get_scores_uname_beatmap_fromid(username, map_id)- Get user scores by username on beatmap IDget_scores_uname_beatmap_frommd5(username, md5)- Get user scores by username on beatmap MD5
Leaderboard & Whitelist
get_leaderboard(type, country)- Get global leaderboard (type: "pp" or "score")get_whitelist()- Get whitelisted beatmapswhitelist_add_fromid(map_id)- Add beatmap to whitelist by ID (requires key)whitelist_add_frommd5(md5)- Add beatmap to whitelist by MD5 (requires key)
Authentication
For whitelist operations, provide your whitelist key:
client = AsyncODRXAPIClient(whitelist_key="your_key_here")
Performance Calculator
Quick Start
from odrx_py import PPCalculator
from pathlib import Path
# Initialize Path of the beatmap
beatmap = Path(__file__).parent / "resources" / "beatmap.osu"
# Initialize calculator
calculator = PPCalculator(beatmap, mods=[{"acronym": "RX"}])
# Get the pp number/calculate
calculator.calculate_performance()
Class / Methods
-
PPCalculator(beatmap, mods, n300, n100, n50, misses, combo)- Initializes the Calculator class giving it the required data. -
calculate_performance()- Calculates the performance points.
Mod Format
Normal mods
mods = [{
"acronym": "(insert mod name)"
}]
Speed modifier
mods = [{
"acronym": "CS",
"settings": {
"rateMultiplier": 1.0
}
}]
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
odrx_py-2.1.0.tar.gz
(7.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
odrx_py-2.1.0-py3-none-any.whl
(10.7 kB
view details)
File details
Details for the file odrx_py-2.1.0.tar.gz.
File metadata
- Download URL: odrx_py-2.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0cee12c52902563594a5bb011e769db0a205ce5edcf14b75a6ef1986e68a645
|
|
| MD5 |
a21bc76f044fe258b81a6c176fbdd4db
|
|
| BLAKE2b-256 |
bfe99712e3c1b81de05ee784d350056a0de1931e18a8e406510abc4659888542
|
File details
Details for the file odrx_py-2.1.0-py3-none-any.whl.
File metadata
- Download URL: odrx_py-2.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fd862500576e3894b1e9f7f331a52507ac8f4ab6815c6d26705db46fe7a590d
|
|
| MD5 |
b971fc43e30a5758193e8c32ebb9a150
|
|
| BLAKE2b-256 |
28798e8aa54d01ccbc8c5b9b8110f6454f23dceabf4aecb20384d7d288555c7f
|