osu.py 2.2.1__tar.gz → 2.2.2__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.1/osu.py.egg-info → osu_py-2.2.2}/PKG-INFO +1 -1
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/__init__.py +1 -1
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/asyncio/client.py +5 -1
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/client.py +8 -1
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/util.py +5 -2
- {osu_py-2.2.1 → osu_py-2.2.2/osu.py.egg-info}/PKG-INFO +1 -1
- {osu_py-2.2.1 → osu_py-2.2.2}/LICENSE +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/MANIFEST.in +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/README.rst +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/asyncio/__init__.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/asyncio/http.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/auth.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/constants.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/enums.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/exceptions.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/http.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/notification.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/__init__.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/achievement.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/beatmap.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/beatmapset_event.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/build.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/chat.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/comment.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/current_user_attributes.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/discussion.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/event.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/forum.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/group.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/kudosu.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/match.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/multiplayer.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/news.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/notification.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/ranking.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/scope.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/score.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/seasonal_background.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/user.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/objects/wiki.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/path.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu/results.py +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu.py.egg-info/SOURCES.txt +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu.py.egg-info/dependency_links.txt +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu.py.egg-info/requires.txt +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/osu.py.egg-info/top_level.txt +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/pyproject.toml +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/requirements.txt +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/setup.cfg +0 -0
- {osu_py-2.2.1 → osu_py-2.2.2}/setup.py +0 -0
|
@@ -1449,6 +1449,9 @@ class AsynchronousClient:
|
|
|
1449
1449
|
User default mode will be used if not specified.
|
|
1450
1450
|
|
|
1451
1451
|
key: Optional[:class:`str`]
|
|
1452
|
+
**DEPRECATED**
|
|
1453
|
+
It's recommended to prefix usernames with @ instead of setting key
|
|
1454
|
+
|
|
1452
1455
|
Type of user passed in url parameter. Can be either `id` or `username`
|
|
1453
1456
|
to limit lookup by their respective type. Passing empty or invalid
|
|
1454
1457
|
value will result in id lookup followed by username lookup if not found.
|
|
@@ -1466,7 +1469,8 @@ class AsynchronousClient:
|
|
|
1466
1469
|
`user_achievements`.
|
|
1467
1470
|
"""
|
|
1468
1471
|
mode = parse_enum_args(mode)
|
|
1469
|
-
|
|
1472
|
+
user = f"@{user}" if key is not None and key.lower() == "username" else user
|
|
1473
|
+
return User(await self.http.make_request(Path.get_user(user, mode)))
|
|
1470
1474
|
|
|
1471
1475
|
async def get_users(self, ids: Sequence[int]) -> List[UserCompact]:
|
|
1472
1476
|
"""
|
|
@@ -1424,6 +1424,9 @@ class Client:
|
|
|
1424
1424
|
User default mode will be used if not specified.
|
|
1425
1425
|
|
|
1426
1426
|
key: Optional[:class:`str`]
|
|
1427
|
+
**DEPRECATED**
|
|
1428
|
+
It's recommended to prefix usernames with @ instead of setting key
|
|
1429
|
+
|
|
1427
1430
|
Type of user passed in url parameter. Can be either `id` or `username`
|
|
1428
1431
|
to limit lookup by their respective type. Passing empty or invalid
|
|
1429
1432
|
value will result in id lookup followed by username lookup if not found.
|
|
@@ -1441,7 +1444,8 @@ class Client:
|
|
|
1441
1444
|
`user_achievements`.
|
|
1442
1445
|
"""
|
|
1443
1446
|
mode = parse_enum_args(mode)
|
|
1444
|
-
|
|
1447
|
+
user = f"@{user}" if key is not None and key.lower() == "username" else user
|
|
1448
|
+
return User(self.http.make_request(Path.get_user(user, mode)))
|
|
1445
1449
|
|
|
1446
1450
|
def get_users(self, ids: Sequence[int]) -> List[UserCompact]:
|
|
1447
1451
|
"""
|
|
@@ -1461,6 +1465,9 @@ class Client:
|
|
|
1461
1465
|
Includes attributes: country, cover, groups, statistics_rulesets.
|
|
1462
1466
|
"""
|
|
1463
1467
|
res = self.http.make_request(Path.get_users(), **{"ids[]": ids})
|
|
1468
|
+
import json
|
|
1469
|
+
with open("users.json", "w", encoding="utf-8") as f:
|
|
1470
|
+
json.dump(res["users"], f)
|
|
1464
1471
|
return list(map(UserCompact, res["users"]))
|
|
1465
1472
|
|
|
1466
1473
|
def get_wiki_page(self, locale: str, path: str) -> WikiPage:
|
|
@@ -126,13 +126,16 @@ class BeatmapsetSearchFilter:
|
|
|
126
126
|
self._filters["query"] = query
|
|
127
127
|
return self
|
|
128
128
|
|
|
129
|
-
def set_sort(self, sort: Union[BeatmapsetSearchSort, str]) -> "BeatmapsetSearchFilter":
|
|
129
|
+
def set_sort(self, sort: Union[BeatmapsetSearchSort, str], order: str = "desc") -> "BeatmapsetSearchFilter":
|
|
130
130
|
"""
|
|
131
131
|
Set the sort order of the search.
|
|
132
132
|
|
|
133
133
|
sort: Union[:class:`BeatmapsetSearchSort`, :class:`str`]
|
|
134
|
+
|
|
135
|
+
order: :class:`str`
|
|
136
|
+
"desc" or "asc"
|
|
134
137
|
"""
|
|
135
|
-
self._filters["sort"] = sort.value if isinstance(sort, BeatmapsetSearchSort) else sort
|
|
138
|
+
self._filters["sort"] = (sort.value if isinstance(sort, BeatmapsetSearchSort) else sort) + "_" + order
|
|
136
139
|
return self
|
|
137
140
|
|
|
138
141
|
def set_nsfw(self, nsfw: bool) -> "BeatmapsetSearchFilter":
|
|
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
|
|
File without changes
|
|
File without changes
|