Skip to content

Commit e69d732

Browse files
committed
Merge branch 'main' into bump
2 parents 220bc3e + 36d7afd commit e69d732

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+439
-194
lines changed

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Copyright (c) 2020 OpenXbox
1+
Copyright (c) 2025 Manfred Dennerlein Rodelo
2+
Copyright (c) 2020 - 2025 OpenXbox
23

34
Permission is hereby granted, free of charge, to any person obtaining a copy
45
of this software and associated documentation files (the "Software"), to deal

pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "python-xbox"
33
description = "A library to authenticate with Xbox Network and use their API"
44
authors = [
5+
{name = "Manfred Dennerlein Rodelo", email = "manfred@dennerlein.name"},
56
{name = "OpenXbox"},
67
]
78
dependencies = [
@@ -15,20 +16,21 @@ readme = "README.md"
1516
license = "MIT"
1617
keywords = ["xbox one live api"]
1718
classifiers = [
18-
"Development Status :: 4 - Beta",
19+
"Development Status :: 5 - Production/Stable",
1920
"Intended Audience :: Developers",
2021
"License :: OSI Approved :: MIT License",
2122
"Programming Language :: Python :: 3",
2223
"Programming Language :: Python :: 3.11",
2324
"Programming Language :: Python :: 3.12",
2425
"Programming Language :: Python :: 3.13",
2526
"Programming Language :: Python :: 3.14",
27+
"Operating System :: OS Independent",
2628
"Topic :: Software Development :: Libraries :: Python Modules",
2729
]
2830
dynamic = ["version"]
2931

3032
[project.urls]
31-
Homepage = "https://github.com/tr4nt0r/python-xbox"
33+
Source = "https://github.com/tr4nt0r/python-xbox"
3234

3335
[project.optional-dependencies]
3436
cli = [
@@ -47,8 +49,9 @@ line-length = 88
4749
target-version = "py311"
4850

4951
[tool.ruff.lint]
50-
select = ["E4", "E7", "E9", "F", "UP", "S"]
51-
ignore = []
52+
select = ["E4", "E7", "E9", "F", "UP", "S", "ANN"]
53+
# select = ["ALL"]
54+
ignore = ["ANN003", "ANN401"]
5255

5356

5457
[tool.ruff.lint.per-file-ignores]

readme_example.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
from httpx import HTTPStatusError
55

6-
from pythonxbox.webapi.api.client import XboxLiveClient
7-
from pythonxbox.webapi.authentication.manager import AuthenticationManager
8-
from pythonxbox.webapi.authentication.models import OAuth2TokenResponse
9-
from pythonxbox.webapi.common.signed_session import SignedSession
10-
from pythonxbox.webapi.scripts import CLIENT_ID, CLIENT_SECRET, TOKENS_FILE
6+
from pythonxbox.api.client import XboxLiveClient
7+
from pythonxbox.authentication.manager import AuthenticationManager
8+
from pythonxbox.authentication.models import OAuth2TokenResponse
9+
from pythonxbox.common.signed_session import SignedSession
10+
from pythonxbox.scripts import CLIENT_ID, CLIENT_SECRET, TOKENS_FILE
1111

1212
"""
1313
This uses the global default client identification by OpenXbox
@@ -23,7 +23,7 @@
2323
"""
2424

2525

26-
async def async_main():
26+
async def async_main() -> None:
2727
# Create a HTTP client session
2828
async with SignedSession() as session:
2929
"""

src/pythonxbox/api/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
class Session:
39-
def __init__(self, auth_mgr: AuthenticationManager):
39+
def __init__(self, auth_mgr: AuthenticationManager) -> None:
4040
self._auth_mgr = auth_mgr
4141
self._cv = CorrelationVector()
4242

@@ -125,7 +125,7 @@ def __init__(
125125
self,
126126
auth_mgr: AuthenticationManager,
127127
language: XboxLiveLanguage = DefaultXboxLiveLanguages.United_States,
128-
):
128+
) -> None:
129129
self._auth_mgr = auth_mgr
130130
self.session = Session(auth_mgr)
131131
self._language = language

src/pythonxbox/api/language.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55

66
class XboxLiveLanguage:
7-
def __init__(self, name, short_id, identifier, locale):
7+
def __init__(
8+
self,
9+
name: str,
10+
short_id: str,
11+
identifier: str,
12+
locale: str,
13+
) -> None:
814
"""
915
Initialize a new instance of :class:`XboxLiveLanguage`
1016

src/pythonxbox/api/provider/account/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class AccountProvider(BaseProvider):
1212
HEADERS_USER_MGT = {"x-xbl-contract-version": "1"}
1313
HEADERS_ACCOUNT = {"x-xbl-contract-version": "2"}
1414

15-
async def claim_gamertag(self, xuid, gamertag, **kwargs) -> ClaimGamertagResult:
15+
async def claim_gamertag(
16+
self, xuid: str, gamertag: str, **kwargs
17+
) -> ClaimGamertagResult:
1618
"""
1719
Claim gamertag
1820
@@ -40,7 +42,7 @@ async def claim_gamertag(self, xuid, gamertag, **kwargs) -> ClaimGamertagResult:
4042
resp.raise_for_status()
4143

4244
async def change_gamertag(
43-
self, xuid, gamertag, preview=False, **kwargs
45+
self, xuid: str, gamertag: str, preview: bool = False, **kwargs
4446
) -> ChangeGamertagResult:
4547
"""
4648
Change your gamertag.

src/pythonxbox/api/provider/achievements/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AchievementsProvider(RateLimitedProvider):
2121
RATE_LIMITS = {"burst": 100, "sustain": 300}
2222

2323
async def get_achievements_detail_item(
24-
self, xuid, service_config_id, achievement_id, **kwargs
24+
self, xuid: str, service_config_id: str, achievement_id: str, **kwargs
2525
) -> AchievementResponse:
2626
"""
2727
Get achievement detail for specific item
@@ -45,7 +45,7 @@ async def get_achievements_detail_item(
4545
return AchievementResponse(**resp.json())
4646

4747
async def get_achievements_xbox360_all(
48-
self, xuid, title_id, **kwargs
48+
self, xuid: str, title_id: str, **kwargs
4949
) -> Achievement360Response:
5050
"""
5151
Get all achievements for specific X360 title Id
@@ -70,7 +70,7 @@ async def get_achievements_xbox360_all(
7070
return Achievement360Response(**resp.json())
7171

7272
async def get_achievements_xbox360_earned(
73-
self, xuid, title_id, **kwargs
73+
self, xuid: str, title_id: str, **kwargs
7474
) -> Achievement360Response:
7575
"""
7676
Get earned achievements for specific X360 title id
@@ -95,7 +95,7 @@ async def get_achievements_xbox360_earned(
9595
return Achievement360Response(**resp.json())
9696

9797
async def get_achievements_xbox360_recent_progress_and_info(
98-
self, xuid, **kwargs
98+
self, xuid: str, **kwargs
9999
) -> Achievement360ProgressResponse:
100100
"""
101101
Get recent achievement progress and information
@@ -117,7 +117,7 @@ async def get_achievements_xbox360_recent_progress_and_info(
117117
return Achievement360ProgressResponse(**resp.json())
118118

119119
async def get_achievements_xboxone_gameprogress(
120-
self, xuid, title_id, **kwargs
120+
self, xuid: str, title_id: str, **kwargs
121121
) -> AchievementResponse:
122122
"""
123123
Get gameprogress for Xbox One title
@@ -142,7 +142,7 @@ async def get_achievements_xboxone_gameprogress(
142142
return AchievementResponse(**resp.json())
143143

144144
async def get_achievements_xboxone_recent_progress_and_info(
145-
self, xuid, **kwargs
145+
self, xuid: str, **kwargs
146146
) -> RecentProgressResponse:
147147
"""
148148
Get recent achievement progress and information

src/pythonxbox/api/provider/baseprovider.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
Subclassed by every *real* provider
55
"""
66

7+
from typing import TYPE_CHECKING
8+
9+
10+
if TYPE_CHECKING:
11+
from pythonxbox.api.client import XboxLiveClient
12+
713

814
class BaseProvider:
9-
def __init__(self, client):
15+
def __init__(self, client: "XboxLiveClient") -> None:
1016
"""
1117
Initialize an the BaseProvider
1218

src/pythonxbox/api/provider/catalog/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class SkuProperties(PascalCaseModel):
250250
is_bundle: bool
251251

252252
@field_validator("last_update_date", mode="before", check_fields=True)
253-
def validator(x):
253+
def validator(x: "SkuProperties") -> "SkuProperties":
254254
return x or None
255255

256256

src/pythonxbox/api/provider/presence/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class PresenceProvider(BaseProvider):
1717

1818
async def get_presence(
1919
self,
20-
xuid,
20+
xuid: str,
2121
presence_level: PresenceLevel = PresenceLevel.USER,
2222
**kwargs,
2323
) -> PresenceItem:

0 commit comments

Comments
 (0)