Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ dynamic = ["version"]
Homepage = "https://github.com/tr4nt0r/python-xbox"

[project.scripts]
xbox-authenticate = "xbox.webapi.scripts.authenticate:main"
xbox-change-gt = "xbox.webapi.scripts.change_gamertag:main"
xbox-friends = "xbox.webapi.scripts.friends:main"
xbox-searchlive = "xbox.webapi.scripts.search:main"
xbox-xal = "xbox.webapi.scripts.xal:main"
xbox-authenticate = "pythonxbox.scripts.authenticate:main"
xbox-change-gt = "pythonxbox.scripts.change_gamertag:main"
xbox-friends = "pythonxbox.scripts.friends:main"
xbox-searchlive = "pythonxbox.scripts.search:main"
xbox-xal = "pythonxbox.scripts.xal:main"

[tool.ruff]
line-length = 88
Expand Down Expand Up @@ -78,14 +78,14 @@ tests = [
[tool.hatch.version]
source = "regex_commit"
commit_extra_args = ["-e"]
path = "xbox/webapi/__init__.py"
path = "src/pythonxbox/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/xbox/webapi",
"src/pythonxbox",
]
[tool.hatch.build.targets.wheel]
packages = ["xbox/webapi"]
packages = ["src/pythonxbox"]

[tool.hatch.envs.default]
python = "3.13"
Expand All @@ -110,12 +110,12 @@ extra-dependencies = [
"respx~=0.22",
"freezegun==1.5.5"
]
extra-args = ["--cov=xbox/webapi/", "--cov-report=term-missing", "--cov-report=xml", "-vv"]
extra-args = ["--cov=src/", "--cov-report=term-missing", "--cov-report=xml", "-vv"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
pythonpath = ["xbox/webapi"]
pythonpath = ["src"]

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.14", "3.13", "3.12", "3.11"]
Expand Down
10 changes: 5 additions & 5 deletions readme_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

from httpx import HTTPStatusError

from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.authentication.manager import AuthenticationManager
from xbox.webapi.authentication.models import OAuth2TokenResponse
from xbox.webapi.common.signed_session import SignedSession
from xbox.webapi.scripts import CLIENT_ID, CLIENT_SECRET, TOKENS_FILE
from pythonxbox.webapi.api.client import XboxLiveClient
from pythonxbox.webapi.authentication.manager import AuthenticationManager
from pythonxbox.webapi.authentication.models import OAuth2TokenResponse
from pythonxbox.webapi.common.signed_session import SignedSession
from pythonxbox.webapi.scripts import CLIENT_ID, CLIENT_SECRET, TOKENS_FILE

"""
This uses the global default client identification by OpenXbox
Expand Down
File renamed without changes.
File renamed without changes.
40 changes: 20 additions & 20 deletions xbox/webapi/api/client.py → src/pythonxbox/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@
from httpx import Response
from ms_cv import CorrelationVector

from xbox.webapi.api.language import DefaultXboxLiveLanguages, XboxLiveLanguage
from xbox.webapi.api.provider.account import AccountProvider
from xbox.webapi.api.provider.achievements import AchievementsProvider
from xbox.webapi.api.provider.catalog import CatalogProvider
from xbox.webapi.api.provider.cqs import CQSProvider
from xbox.webapi.api.provider.gameclips import GameclipProvider
from xbox.webapi.api.provider.lists import ListsProvider
from xbox.webapi.api.provider.mediahub import MediahubProvider
from xbox.webapi.api.provider.message import MessageProvider
from xbox.webapi.api.provider.people import PeopleProvider
from xbox.webapi.api.provider.presence import PresenceProvider
from xbox.webapi.api.provider.profile import ProfileProvider
from xbox.webapi.api.provider.screenshots import ScreenshotsProvider
from xbox.webapi.api.provider.smartglass import SmartglassProvider
from xbox.webapi.api.provider.titlehub import TitlehubProvider
from xbox.webapi.api.provider.usersearch import UserSearchProvider
from xbox.webapi.api.provider.userstats import UserStatsProvider
from xbox.webapi.authentication.manager import AuthenticationManager
from xbox.webapi.common.exceptions import RateLimitExceededException
from xbox.webapi.common.ratelimits import RateLimit
from pythonxbox.api.language import DefaultXboxLiveLanguages, XboxLiveLanguage
from pythonxbox.api.provider.account import AccountProvider
from pythonxbox.api.provider.achievements import AchievementsProvider
from pythonxbox.api.provider.catalog import CatalogProvider
from pythonxbox.api.provider.cqs import CQSProvider
from pythonxbox.api.provider.gameclips import GameclipProvider
from pythonxbox.api.provider.lists import ListsProvider
from pythonxbox.api.provider.mediahub import MediahubProvider
from pythonxbox.api.provider.message import MessageProvider
from pythonxbox.api.provider.people import PeopleProvider
from pythonxbox.api.provider.presence import PresenceProvider
from pythonxbox.api.provider.profile import ProfileProvider
from pythonxbox.api.provider.screenshots import ScreenshotsProvider
from pythonxbox.api.provider.smartglass import SmartglassProvider
from pythonxbox.api.provider.titlehub import TitlehubProvider
from pythonxbox.api.provider.usersearch import UserSearchProvider
from pythonxbox.api.provider.userstats import UserStatsProvider
from pythonxbox.authentication.manager import AuthenticationManager
from pythonxbox.common.exceptions import RateLimitExceededException
from pythonxbox.common.ratelimits import RateLimit

log = logging.getLogger("xbox.api")

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from xbox.webapi.api.provider.account.models import (
from pythonxbox.api.provider.account.models import (
ChangeGamertagResult,
ClaimGamertagResult,
)
from xbox.webapi.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.baseprovider import BaseProvider


class AccountProvider(BaseProvider):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Get Xbox 360 and Xbox One Achievement data
"""

from xbox.webapi.api.provider.achievements.models import (
from pythonxbox.api.provider.achievements.models import (
Achievement360ProgressResponse,
Achievement360Response,
AchievementResponse,
RecentProgressResponse,
)
from xbox.webapi.api.provider.ratelimitedprovider import RateLimitedProvider
from pythonxbox.api.provider.ratelimitedprovider import RateLimitedProvider


class AchievementsProvider(RateLimitedProvider):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pydantic import BaseModel

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel


class PagingInfo(CamelCaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from typing import List

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.catalog.models import (
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.catalog.models import (
AlternateIdType,
CatalogResponse,
CatalogSearchResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Web API Constants."""

from xbox.webapi.api.provider.catalog.models import AlternateIdType
from pythonxbox.api.provider.catalog.models import AlternateIdType

HOME_APP_IDS = {
AlternateIdType.LEGACY_XBOX_PRODUCT_ID: "7b3ca835-5ef5-4d96-bc84-c1d8b5084236",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pydantic import Field, field_validator

from xbox.webapi.common.models import PascalCaseModel
from pythonxbox.common.models import PascalCaseModel


class AlternateIdType(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
(RemoteTVInput ServiceChannel on Smartglass)
"""

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.cqs.models import (
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.cqs.models import (
CqsChannelListResponse,
CqsScheduleResponse,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any, Dict, List, Optional

from xbox.webapi.common.models import PascalCaseModel
from pythonxbox.common.models import PascalCaseModel


class Image(PascalCaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Gameclips - Get gameclip info
"""

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.gameclips.models import GameclipsResponse
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.gameclips.models import GameclipsResponse


class GameclipProvider(BaseProvider):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import List, Optional

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel


class Thumbnail(CamelCaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
EPLists - Mainly used for XBL Pins
"""

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.lists.models import ListMetadata, ListsResponse
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.lists.models import ListMetadata, ListsResponse


class ListsProvider(BaseProvider):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Optional

from xbox.webapi.common.models import PascalCaseModel
from pythonxbox.common.models import PascalCaseModel


class Item(PascalCaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Mediahub - Fetch screenshots and gameclips
"""

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.mediahub.models import (
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.mediahub.models import (
MediahubGameclips,
MediahubScreenshots,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Optional

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel


class ContentSegment(CamelCaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
TODO: Support group messaging
"""

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.message.models import (
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.message.models import (
ConversationResponse,
InboxResponse,
SendMessageResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Any, List, Optional

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel


class Part(CamelCaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
People - Access friendlist from own profiles and others
"""

from xbox.webapi.api.provider.people.models import (
from pythonxbox.api.provider.people.models import (
PeopleDecoration,
PeopleResponse,
PeopleSummaryResponse,
)
from xbox.webapi.api.provider.ratelimitedprovider import RateLimitedProvider
from pythonxbox.api.provider.ratelimitedprovider import RateLimitedProvider
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from xbox.webapi.api.client import XboxLiveClient
from pythonxbox.api.client import XboxLiveClient


class PeopleProvider(RateLimitedProvider):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pydantic import Field

from xbox.webapi.common.models import CamelCaseModel, PascalCaseModel
from pythonxbox.common.models import CamelCaseModel, PascalCaseModel


class PeopleDecoration(StrEnum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from typing import List

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.presence.models import (
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.presence.models import (
PresenceBatchResponse,
PresenceItem,
PresenceLevel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, Optional
from pydantic import RootModel

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel


class PresenceLevel(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from typing import List

from xbox.webapi.api.provider.ratelimitedprovider import RateLimitedProvider
from xbox.webapi.api.provider.profile.models import ProfileResponse, ProfileSettings
from pythonxbox.api.provider.ratelimitedprovider import RateLimitedProvider
from pythonxbox.api.provider.profile.models import ProfileResponse, ProfileSettings


class ProfileProvider(RateLimitedProvider):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum
from typing import List

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel


class ProfileSettings(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

from typing import Dict, Union

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.common.exceptions import XboxException
from xbox.webapi.common.ratelimits import CombinedRateLimit
from xbox.webapi.common.ratelimits.models import LimitType, ParsedRateLimit, TimePeriod
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.common.exceptions import XboxException
from pythonxbox.common.ratelimits import CombinedRateLimit
from pythonxbox.common.ratelimits.models import LimitType, ParsedRateLimit, TimePeriod


class RateLimitedProvider(BaseProvider):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Screenshots - Get screenshot info
"""

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.screenshots.models import ScreenshotResponse
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.screenshots.models import ScreenshotResponse


class ScreenshotsProvider(BaseProvider):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Any, List, Optional

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel


class Thumbnail(CamelCaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from httpx import Response

from xbox.webapi.api.provider.baseprovider import BaseProvider
from xbox.webapi.api.provider.smartglass.models import (
from pythonxbox.api.provider.baseprovider import BaseProvider
from pythonxbox.api.provider.smartglass.models import (
CommandResponse,
GuideTab,
InputKeyType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import Enum
from typing import List, Optional

from xbox.webapi.common.models import CamelCaseModel
from pythonxbox.common.models import CamelCaseModel

# Responses

Expand Down
Loading
Loading