osu.py 2.2.2__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {osu_py-2.2.2/osu.py.egg-info → osu_py-2.2.3}/PKG-INFO +1 -1
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/__init__.py +1 -1
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/asyncio/client.py +16 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/client.py +17 -3
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/score.py +12 -5
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/user.py +5 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/path.py +4 -0
- {osu_py-2.2.2 → osu_py-2.2.3/osu.py.egg-info}/PKG-INFO +1 -1
- {osu_py-2.2.2 → osu_py-2.2.3}/LICENSE +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/MANIFEST.in +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/README.rst +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/asyncio/__init__.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/asyncio/http.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/auth.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/constants.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/enums.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/exceptions.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/http.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/notification.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/__init__.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/achievement.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/beatmap.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/beatmapset_event.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/build.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/chat.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/comment.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/current_user_attributes.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/discussion.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/event.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/forum.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/group.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/kudosu.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/match.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/multiplayer.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/news.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/notification.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/ranking.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/scope.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/seasonal_background.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/objects/wiki.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/results.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu/util.py +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu.py.egg-info/SOURCES.txt +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu.py.egg-info/dependency_links.txt +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu.py.egg-info/requires.txt +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/osu.py.egg-info/top_level.txt +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/pyproject.toml +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/requirements.txt +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/setup.cfg +0 -0
- {osu_py-2.2.2 → osu_py-2.2.3}/setup.py +0 -0
|
@@ -1492,6 +1492,22 @@ class AsynchronousClient:
|
|
|
1492
1492
|
res = await self.http.make_request(Path.get_users(), **{"ids[]": ids})
|
|
1493
1493
|
return list(map(UserCompact, res["users"]))
|
|
1494
1494
|
|
|
1495
|
+
async def lookup_users(self, users: list[int, str]):
|
|
1496
|
+
"""
|
|
1497
|
+
Lookup users by a mix of user ids and usernames.
|
|
1498
|
+
Can lookup maximum 50 at a time.
|
|
1499
|
+
|
|
1500
|
+
ids: Sequence[Union[:class:`int`, :class:`str`]]
|
|
1501
|
+
Can be a list of user ids and usernames.
|
|
1502
|
+
Usernames should be prefixed with "@" to make sure they're interpreted as usernames by the api.
|
|
1503
|
+
|
|
1504
|
+
**Returns**
|
|
1505
|
+
|
|
1506
|
+
Sequence[:class:`UserCompact`]
|
|
1507
|
+
"""
|
|
1508
|
+
res = await self.http.make_request(Path.get_users(), **{"ids[]": users})
|
|
1509
|
+
return list(map(UserCompact, res["users"]))
|
|
1510
|
+
|
|
1495
1511
|
async def get_wiki_page(self, locale: str, path: str) -> WikiPage:
|
|
1496
1512
|
"""
|
|
1497
1513
|
The wiki article or image data.
|
|
@@ -1450,6 +1450,7 @@ class Client:
|
|
|
1450
1450
|
def get_users(self, ids: Sequence[int]) -> List[UserCompact]:
|
|
1451
1451
|
"""
|
|
1452
1452
|
Returns list of users.
|
|
1453
|
+
Can get maximum 50 at a time.
|
|
1453
1454
|
|
|
1454
1455
|
Requires OAuth and scope public
|
|
1455
1456
|
|
|
@@ -1465,9 +1466,22 @@ class Client:
|
|
|
1465
1466
|
Includes attributes: country, cover, groups, statistics_rulesets.
|
|
1466
1467
|
"""
|
|
1467
1468
|
res = self.http.make_request(Path.get_users(), **{"ids[]": ids})
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1469
|
+
return list(map(UserCompact, res["users"]))
|
|
1470
|
+
|
|
1471
|
+
def lookup_users(self, users: list[int, str]):
|
|
1472
|
+
"""
|
|
1473
|
+
Lookup users by a mix of user ids and usernames.
|
|
1474
|
+
Can lookup maximum 50 at a time.
|
|
1475
|
+
|
|
1476
|
+
ids: Sequence[Union[:class:`int`, :class:`str`]]
|
|
1477
|
+
Can be a list of user ids and usernames.
|
|
1478
|
+
Usernames should be prefixed with "@" to make sure they're interpreted as usernames by the api.
|
|
1479
|
+
|
|
1480
|
+
**Returns**
|
|
1481
|
+
|
|
1482
|
+
Sequence[:class:`UserCompact`]
|
|
1483
|
+
"""
|
|
1484
|
+
res = self.http.make_request(Path.get_users(), **{"ids[]": users})
|
|
1471
1485
|
return list(map(UserCompact, res["users"]))
|
|
1472
1486
|
|
|
1473
1487
|
def get_wiki_page(self, locale: str, path: str) -> WikiPage:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from dateutil import parser
|
|
2
2
|
from typing import Optional, List, TYPE_CHECKING, Union, Dict
|
|
3
3
|
|
|
4
|
-
from .beatmap import BeatmapCompact, BeatmapsetCompact
|
|
4
|
+
from .beatmap import BeatmapCompact, BeatmapsetCompact, Beatmap
|
|
5
5
|
from .user import UserCompact
|
|
6
6
|
from .current_user_attributes import ScoreUserAttributes
|
|
7
7
|
from ..enums import GameModeStr, GameModeInt, Mods, Mod, ObjectType, ScoreRank
|
|
@@ -176,6 +176,10 @@ class SoloScore:
|
|
|
176
176
|
|
|
177
177
|
beatmap_id: Optional[:class:`int`]
|
|
178
178
|
|
|
179
|
+
beatmap: Optional[:class:`Beatmap`]
|
|
180
|
+
|
|
181
|
+
beatmapset: Optional[:class:`BeatmapsetCompact`]
|
|
182
|
+
|
|
179
183
|
ended_at: :class:`datetime.datetime`
|
|
180
184
|
|
|
181
185
|
max_combo: :class:`int`
|
|
@@ -249,6 +253,8 @@ class SoloScore:
|
|
|
249
253
|
"user",
|
|
250
254
|
"current_user_attributes",
|
|
251
255
|
"weight",
|
|
256
|
+
"beatmap",
|
|
257
|
+
"beatmapset"
|
|
252
258
|
)
|
|
253
259
|
|
|
254
260
|
def __init__(self, data):
|
|
@@ -280,6 +286,8 @@ class SoloScore:
|
|
|
280
286
|
data, "current_user_attributes", ScoreUserAttributes
|
|
281
287
|
)
|
|
282
288
|
self.weight: Optional[PpWeight] = get_optional(data, "weight", PpWeight)
|
|
289
|
+
self.beatmap: Optional[Beatmap] = get_optional(data, "beatmap", Beatmap)
|
|
290
|
+
self.beatmapset: Optional[BeatmapsetCompact] = get_optional(data, "beatmapset", BeatmapsetCompact)
|
|
283
291
|
|
|
284
292
|
def __repr__(self):
|
|
285
293
|
return prettify(self, "beatmap_id", "statistics")
|
|
@@ -306,11 +314,10 @@ class PpWeight:
|
|
|
306
314
|
|
|
307
315
|
|
|
308
316
|
def get_score_object(data) -> Union[SoloScore, LegacyScore]:
|
|
309
|
-
|
|
310
|
-
try:
|
|
317
|
+
if data["type"] == "solo_score":
|
|
311
318
|
return SoloScore(data)
|
|
312
|
-
|
|
313
|
-
|
|
319
|
+
|
|
320
|
+
return LegacyScore(data)
|
|
314
321
|
|
|
315
322
|
|
|
316
323
|
class ScoreStatistics:
|
|
@@ -338,6 +338,9 @@ class User(UserCompact):
|
|
|
338
338
|
post_count: :class:`int`
|
|
339
339
|
number of forum posts
|
|
340
340
|
|
|
341
|
+
profile_hue: Optional[:class:`int`]
|
|
342
|
+
Custom color hue in HSL degrees (0-359).
|
|
343
|
+
|
|
341
344
|
profile_order: List[:class:`str`]
|
|
342
345
|
Ordered list of sections in user profile page. Sections consist of:
|
|
343
346
|
me, recent_activity, beatmaps, historical, kudosu, top_ranks, medals
|
|
@@ -365,6 +368,7 @@ class User(UserCompact):
|
|
|
365
368
|
"playmode",
|
|
366
369
|
"playstyle",
|
|
367
370
|
"post_count",
|
|
371
|
+
"profile_hue",
|
|
368
372
|
"profile_order",
|
|
369
373
|
"title",
|
|
370
374
|
"title_url",
|
|
@@ -387,6 +391,7 @@ class User(UserCompact):
|
|
|
387
391
|
self.playmode: GameModeStr = GameModeStr(get_required(data, "playmode"))
|
|
388
392
|
self.playstyle: List[str] = get_required(data, "playstyle")
|
|
389
393
|
self.post_count: int = get_required(data, "post_count")
|
|
394
|
+
self.profile_hue: Optional[int] = get_required(data, "profile_hue")
|
|
390
395
|
self.profile_order: List[str] = get_required(data, "profile_order")
|
|
391
396
|
self.title: Optional[str] = get_required(data, "title")
|
|
392
397
|
self.title_url: Optional[str] = get_required(data, "title_url")
|
|
@@ -172,6 +172,10 @@ class Path:
|
|
|
172
172
|
def get_users(cls):
|
|
173
173
|
return cls("get", "users", "public")
|
|
174
174
|
|
|
175
|
+
@classmethod
|
|
176
|
+
def lookup_users(cls):
|
|
177
|
+
return cls("get", "users/lookup", "public")
|
|
178
|
+
|
|
175
179
|
@classmethod
|
|
176
180
|
def get_wiki_page(cls, locale, path):
|
|
177
181
|
return cls("get", f"wiki/{locale}/{path}", None)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|