ossapi 5.1.2__tar.gz → 5.2.0__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.
Files changed (66) hide show
  1. {ossapi-5.1.2 → ossapi-5.2.0}/PKG-INFO +4 -3
  2. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/__init__.py +1 -2
  3. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/models.py +11 -1
  4. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/ossapiv2.py +29 -2
  5. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/ossapiv2_async.py +18 -0
  6. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi.egg-info/PKG-INFO +4 -3
  7. {ossapi-5.1.2 → ossapi-5.2.0}/pyproject.toml +10 -2
  8. {ossapi-5.1.2 → ossapi-5.2.0}/tests/test_endpoints.py +7 -0
  9. {ossapi-5.1.2 → ossapi-5.2.0}/.gitignore +0 -0
  10. {ossapi-5.1.2 → ossapi-5.2.0}/.nojekyll +0 -0
  11. {ossapi-5.1.2 → ossapi-5.2.0}/LICENSE +0 -0
  12. {ossapi-5.1.2 → ossapi-5.2.0}/Makefile +0 -0
  13. {ossapi-5.1.2 → ossapi-5.2.0}/README.md +0 -0
  14. {ossapi-5.1.2 → ossapi-5.2.0}/docs/_static/custom.css +0 -0
  15. {ossapi-5.1.2 → ossapi-5.2.0}/docs/advanced.rst +0 -0
  16. {ossapi-5.1.2 → ossapi-5.2.0}/docs/api-reference.rst +0 -0
  17. {ossapi-5.1.2 → ossapi-5.2.0}/docs/async.rst +0 -0
  18. {ossapi-5.1.2 → ossapi-5.2.0}/docs/beatmap packs.rst +0 -0
  19. {ossapi-5.1.2 → ossapi-5.2.0}/docs/beatmaps.rst +0 -0
  20. {ossapi-5.1.2 → ossapi-5.2.0}/docs/beatmapsets.rst +0 -0
  21. {ossapi-5.1.2 → ossapi-5.2.0}/docs/changelog.rst +0 -0
  22. {ossapi-5.1.2 → ossapi-5.2.0}/docs/chat.rst +0 -0
  23. {ossapi-5.1.2 → ossapi-5.2.0}/docs/comments.rst +0 -0
  24. {ossapi-5.1.2 → ossapi-5.2.0}/docs/conf.py +0 -0
  25. {ossapi-5.1.2 → ossapi-5.2.0}/docs/creating-a-client.rst +0 -0
  26. {ossapi-5.1.2 → ossapi-5.2.0}/docs/domains.rst +0 -0
  27. {ossapi-5.1.2 → ossapi-5.2.0}/docs/endpoints.rst +0 -0
  28. {ossapi-5.1.2 → ossapi-5.2.0}/docs/events.rst +0 -0
  29. {ossapi-5.1.2 → ossapi-5.2.0}/docs/expandable-models.rst +0 -0
  30. {ossapi-5.1.2 → ossapi-5.2.0}/docs/foreign-keys.rst +0 -0
  31. {ossapi-5.1.2 → ossapi-5.2.0}/docs/forums.rst +0 -0
  32. {ossapi-5.1.2 → ossapi-5.2.0}/docs/friends.rst +0 -0
  33. {ossapi-5.1.2 → ossapi-5.2.0}/docs/generate_docs.py +0 -0
  34. {ossapi-5.1.2 → ossapi-5.2.0}/docs/generate_readme_list.py +0 -0
  35. {ossapi-5.1.2 → ossapi-5.2.0}/docs/grants.rst +0 -0
  36. {ossapi-5.1.2 → ossapi-5.2.0}/docs/home.rst +0 -0
  37. {ossapi-5.1.2 → ossapi-5.2.0}/docs/index.rst +0 -0
  38. {ossapi-5.1.2 → ossapi-5.2.0}/docs/matches.rst +0 -0
  39. {ossapi-5.1.2 → ossapi-5.2.0}/docs/me.rst +0 -0
  40. {ossapi-5.1.2 → ossapi-5.2.0}/docs/news.rst +0 -0
  41. {ossapi-5.1.2 → ossapi-5.2.0}/docs/oauth.rst +0 -0
  42. {ossapi-5.1.2 → ossapi-5.2.0}/docs/pagination.rst +0 -0
  43. {ossapi-5.1.2 → ossapi-5.2.0}/docs/quickstart.rst +0 -0
  44. {ossapi-5.1.2 → ossapi-5.2.0}/docs/rankings.rst +0 -0
  45. {ossapi-5.1.2 → ossapi-5.2.0}/docs/rooms.rst +0 -0
  46. {ossapi-5.1.2 → ossapi-5.2.0}/docs/scores.rst +0 -0
  47. {ossapi-5.1.2 → ossapi-5.2.0}/docs/seasonal backgrounds.rst +0 -0
  48. {ossapi-5.1.2 → ossapi-5.2.0}/docs/serializing-models.rst +0 -0
  49. {ossapi-5.1.2 → ossapi-5.2.0}/docs/spotlights.rst +0 -0
  50. {ossapi-5.1.2 → ossapi-5.2.0}/docs/users.rst +0 -0
  51. {ossapi-5.1.2 → ossapi-5.2.0}/docs/wiki.rst +0 -0
  52. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/encoder.py +0 -0
  53. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/enums.py +0 -0
  54. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/mod.py +0 -0
  55. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/ossapi.py +0 -0
  56. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/replay.py +0 -0
  57. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi/utils.py +0 -0
  58. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi.egg-info/SOURCES.txt +0 -0
  59. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi.egg-info/dependency_links.txt +0 -0
  60. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi.egg-info/requires.txt +0 -0
  61. {ossapi-5.1.2 → ossapi-5.2.0}/ossapi.egg-info/top_level.txt +0 -0
  62. {ossapi-5.1.2 → ossapi-5.2.0}/setup.cfg +0 -0
  63. {ossapi-5.1.2 → ossapi-5.2.0}/tests/__init__.py +0 -0
  64. {ossapi-5.1.2 → ossapi-5.2.0}/tests/test_cursor.py +0 -0
  65. {ossapi-5.1.2 → ossapi-5.2.0}/tests/test_models.py +0 -0
  66. {ossapi-5.1.2 → ossapi-5.2.0}/tests/test_v1.py +0 -0
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: ossapi
3
- Version: 5.1.2
4
- Summary: Complete python wrapper for osu! api v2 and v1.
3
+ Version: 5.2.0
4
+ Summary: The definitive python wrapper for the osu! api
5
5
  Author-email: Liam DeVoe <orionldevoe@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/tybug/ossapi
7
7
  Keywords: osu!,wrapper,api,python
@@ -16,6 +16,7 @@ Requires-Dist: osrparse~=6.0
16
16
  Requires-Dist: typing_utils
17
17
  Provides-Extra: async
18
18
  Requires-Dist: aiohttp; extra == "async"
19
+ Dynamic: license-file
19
20
 
20
21
  # ossapi ([documentation](https://tybug.github.io/ossapi/)) [![PyPI version](https://badge.fury.io/py/ossapi.svg)](https://pypi.org/project/ossapi/)
21
22
 
@@ -3,7 +3,6 @@ import logging
3
3
  # we need to explicitly set a handler for the logging module to be happy
4
4
  handler = logging.StreamHandler()
5
5
  logging.getLogger("ossapi").addHandler(handler)
6
- from importlib import metadata
7
6
 
8
7
  from ossapi.ossapi import (
9
8
  OssapiV1,
@@ -145,7 +144,7 @@ from ossapi.ossapiv2_async import OssapiAsync
145
144
  from oauthlib.oauth2 import AccessDeniedError, TokenExpiredError
146
145
  from oauthlib.oauth2.rfc6749.errors import InsufficientScopeError
147
146
 
148
- __version__ = metadata.version(__package__)
147
+ __version__ = "5.2.0"
149
148
 
150
149
  __all__ = [
151
150
  # OssapiV1
@@ -1520,7 +1520,7 @@ class RoomLeaderboardUserScore(RoomLeaderboardScore):
1520
1520
 
1521
1521
  class RoomLeaderboard(Model):
1522
1522
  leaderboard: List[RoomLeaderboardScore]
1523
- user_score: RoomLeaderboardUserScore
1523
+ user_score: Optional[RoomLeaderboardUserScore]
1524
1524
 
1525
1525
 
1526
1526
  class Match(Model):
@@ -1596,3 +1596,13 @@ class DailyChallengeUserStats(Model):
1596
1596
  class NonLegacyMod(Model):
1597
1597
  acronym: str
1598
1598
  settings: Any
1599
+
1600
+
1601
+ class Tag(Model):
1602
+ id: int
1603
+ name: str
1604
+ description: str
1605
+
1606
+
1607
+ class Tags(Model):
1608
+ tags: List[Tag]
@@ -37,6 +37,8 @@ from ossapi.models import (
37
37
  Score,
38
38
  BeatmapsetSearchResult,
39
39
  ModdingHistoryEventsBundle,
40
+ Tag,
41
+ Tags,
40
42
  User,
41
43
  Rankings,
42
44
  BeatmapScores,
@@ -2491,7 +2493,9 @@ class Ossapi:
2491
2493
  return self._get(Room, f"/rooms/{room_id}")
2492
2494
 
2493
2495
  @request(Scope.PUBLIC, requires_user=True, category="rooms")
2494
- def room_leaderboard(self, room_id: RoomIdT) -> RoomLeaderboard:
2496
+ def room_leaderboard(
2497
+ self, room_id: RoomIdT, limit: Optional[int] = None, page: Optional[int] = None
2498
+ ) -> RoomLeaderboard:
2495
2499
  """
2496
2500
  Get the leaderboard of a room.
2497
2501
 
@@ -2499,13 +2503,20 @@ class Ossapi:
2499
2503
  ----------
2500
2504
  room_id
2501
2505
  The room to get the leaderboard of.
2506
+ limit
2507
+ Maximum number of room scores to return.
2508
+ offset
2509
+ Offset for pagination.
2502
2510
 
2503
2511
  Notes
2504
2512
  -----
2505
2513
  Implements the `Get Room Leaderboard
2506
2514
  <https://osu.ppy.sh/docs/index.html#roomsroomleaderboard>`__ endpoint.
2507
2515
  """
2508
- return self._get(RoomLeaderboard, f"/rooms/{room_id}/leaderboard")
2516
+ params = {"limit": limit, "page": page}
2517
+ return self._get(
2518
+ RoomLeaderboard, f"/rooms/{room_id}/leaderboard", params=params
2519
+ )
2509
2520
 
2510
2521
  @request(Scope.PUBLIC, requires_user=True, category="rooms")
2511
2522
  def rooms(
@@ -2721,6 +2732,22 @@ class Ossapi:
2721
2732
  spotlights = self._get(Spotlights, "/spotlights")
2722
2733
  return spotlights.spotlights
2723
2734
 
2735
+ # /tags
2736
+ # -----
2737
+
2738
+ @request(Scope.PUBLIC, category="tags")
2739
+ def tags(self) -> List[Tag]:
2740
+ """
2741
+ Get beatmap tags.
2742
+
2743
+ Notes
2744
+ -----
2745
+ Implements the `Get Tags
2746
+ <https://osu.ppy.sh/docs/index.html#get-apiv2tags>`__ endpoint.
2747
+ """
2748
+ tags = self._get(Tags, "/tags")
2749
+ return tags.tags
2750
+
2724
2751
  # /users
2725
2752
  # ------
2726
2753
 
@@ -50,6 +50,8 @@ from ossapi.models import (
50
50
  Score,
51
51
  BeatmapsetSearchResult,
52
52
  ModdingHistoryEventsBundle,
53
+ Tag,
54
+ Tags,
53
55
  User,
54
56
  Rankings,
55
57
  BeatmapScores,
@@ -2829,6 +2831,22 @@ class OssapiAsync:
2829
2831
  spotlights = await self._get(Spotlights, "/spotlights")
2830
2832
  return spotlights.spotlights
2831
2833
 
2834
+ # /tags
2835
+ # -----
2836
+
2837
+ @request(Scope.PUBLIC, category="tags")
2838
+ async def tags(self) -> List[Tag]:
2839
+ """
2840
+ Get beatmap tags.
2841
+
2842
+ Notes
2843
+ -----
2844
+ Implements the `Get Tags
2845
+ <https://osu.ppy.sh/docs/index.html#get-apiv2tags>`__ endpoint.
2846
+ """
2847
+ tags = await self._get(Tags, "/tags")
2848
+ return tags.tags
2849
+
2832
2850
  # /users
2833
2851
  # ------
2834
2852
 
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: ossapi
3
- Version: 5.1.2
4
- Summary: Complete python wrapper for osu! api v2 and v1.
3
+ Version: 5.2.0
4
+ Summary: The definitive python wrapper for the osu! api
5
5
  Author-email: Liam DeVoe <orionldevoe@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/tybug/ossapi
7
7
  Keywords: osu!,wrapper,api,python
@@ -16,6 +16,7 @@ Requires-Dist: osrparse~=6.0
16
16
  Requires-Dist: typing_utils
17
17
  Provides-Extra: async
18
18
  Requires-Dist: aiohttp; extra == "async"
19
+ Dynamic: license-file
19
20
 
20
21
  # ossapi ([documentation](https://tybug.github.io/ossapi/)) [![PyPI version](https://badge.fury.io/py/ossapi.svg)](https://pypi.org/project/ossapi/)
21
22
 
@@ -1,7 +1,12 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
1
5
  [project]
2
6
  name = "ossapi"
3
- version = "5.1.2"
4
- description = "Complete python wrapper for osu! api v2 and v1."
7
+ # see [tool.setuptools.dynamic]
8
+ dynamic = ["version"]
9
+ description = "The definitive python wrapper for the osu! api"
5
10
  readme = "README.md"
6
11
  keywords = ["osu!", "wrapper", "api", "python"]
7
12
  authors = [
@@ -24,3 +29,6 @@ async = ["aiohttp"]
24
29
 
25
30
  [project.urls]
26
31
  "Homepage" = "https://github.com/tybug/ossapi"
32
+
33
+ [tool.setuptools.dynamic]
34
+ version = {attr = "ossapi.__version__"}
@@ -331,6 +331,11 @@ class TestScores(TestCase):
331
331
  api.scores("osu", cursor_string=scores.cursor_string)
332
332
 
333
333
 
334
+ class TestTags(TestCase):
335
+ def test_deserialize(self):
336
+ api.tags()
337
+
338
+
334
339
  # ======================
335
340
  # api_full test cases
336
341
  # ======================
@@ -356,6 +361,8 @@ class TestRoomLeaderboard(TestCaseAuthorizationCode):
356
361
  def test_deserialize(self):
357
362
  # https://osu.ppy.sh/multiplayer/rooms/232594
358
363
  api_full.room_leaderboard(232594)
364
+ # https://osu.ppy.sh/multiplayer/rooms/1222586 (daily challenge)
365
+ api_full.room_leaderboard(1222586, page=10)
359
366
 
360
367
 
361
368
  class TestRooms(TestCaseAuthorizationCode):
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
File without changes
File without changes
File without changes
File without changes
File without changes