faceit 0.3.0__tar.gz → 0.3.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.
Files changed (37) hide show
  1. {faceit-0.3.0 → faceit-0.3.2}/PKG-INFO +5 -5
  2. {faceit-0.3.0 → faceit-0.3.2}/README.md +2 -1
  3. faceit-0.3.2/pyproject.toml +168 -0
  4. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/__init__.py +0 -1
  5. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/__init__.py +0 -1
  6. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/aggregator.py +6 -8
  7. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/base.py +6 -13
  8. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/championships.py +1 -1
  9. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/games.py +7 -8
  10. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/helpers.py +2 -0
  11. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/leagues.py +3 -7
  12. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/players.py +25 -26
  13. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/rankings.py +6 -10
  14. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/teams.py +3 -3
  15. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/pagination.py +12 -26
  16. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/constants.py +17 -27
  17. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/exceptions.py +16 -14
  18. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/http/__init__.py +0 -2
  19. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/http/client.py +37 -57
  20. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/http/helpers.py +5 -10
  21. faceit-0.3.2/src/faceit/models/base.py +7 -0
  22. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/championships.py +3 -2
  23. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/custom_types/common.py +8 -5
  24. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/custom_types/faceit_uuid.py +1 -1
  25. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/item_page.py +25 -30
  26. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/players/general.py +9 -10
  27. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/players/match.py +157 -152
  28. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/types.py +6 -7
  29. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/utils.py +5 -11
  30. faceit-0.3.0/pyproject.toml +0 -53
  31. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/__init__.py +0 -0
  32. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/matches.py +0 -0
  33. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/api/data/matchmakings.py +0 -0
  34. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/__init__.py +0 -0
  35. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/custom_types/__init__.py +0 -0
  36. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/models/players/__init__.py +0 -0
  37. {faceit-0.3.0 → faceit-0.3.2}/src/faceit/py.typed +0 -0
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: faceit
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: The Python wrapper for the FACEIT API
5
5
  Keywords: api,faceit,wrapper
6
6
  Author: zombyacoff
7
7
  Author-email: zombyacoff <zombyacoff@gmail.com>
8
8
  License-Expression: Apache-2.0
9
9
  Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: Apache Software License
11
10
  Classifier: Operating System :: OS Independent
12
11
  Classifier: Programming Language :: Python :: 3
13
12
  Classifier: Programming Language :: Python :: 3.10
@@ -22,9 +21,9 @@ Requires-Dist: pydantic>=2.13.0
22
21
  Requires-Dist: tenacity>=8.5.0
23
22
  Requires-Dist: python-decouple>=3.8 ; extra == 'env'
24
23
  Requires-Python: >=3.10
25
- Project-URL: Bug Tracker, https://github.com/zombyacoff/faceit-python/issues
26
- Project-URL: Releases, https://github.com/zombyacoff/faceit-python/releases
27
24
  Project-URL: Repository, https://github.com/zombyacoff/faceit-python
25
+ Project-URL: Releases, https://github.com/zombyacoff/faceit-python/releases
26
+ Project-URL: Bug Tracker, https://github.com/zombyacoff/faceit-python/issues
28
27
  Provides-Extra: env
29
28
  Description-Content-Type: text/markdown
30
29
 
@@ -115,7 +114,8 @@ See additional usage examples in the [examples/](examples/) directory.
115
114
 
116
115
  You can provide your API key directly in the constructor or let the library automatically load it from your environment.
117
116
 
118
- - **Automatic:** Set the `FACEIT_API_KEY` environment variable. _(Requires `faceit[env]` or manual [python-decouple](https://github.com/HBNetwork/python-decouple) installation)_.
117
+ - **Automatic:** Set the `FACEIT_API_KEY` environment variable.
118
+ Requires `faceit[env]` extra dependency or manual [python-decouple](https://github.com/HBNetwork/python-decouple) installation.
119
119
  - **Manual:** Pass the key string directly: `SyncDataResource("YOUR_API_KEY")`.
120
120
  - **Custom Variable:** To use a different environment variable name, pass an instance of `FromEnv`: `SyncDataResource(FromEnv("SECRET"))`
121
121
 
@@ -85,7 +85,8 @@ See additional usage examples in the [examples/](examples/) directory.
85
85
 
86
86
  You can provide your API key directly in the constructor or let the library automatically load it from your environment.
87
87
 
88
- - **Automatic:** Set the `FACEIT_API_KEY` environment variable. _(Requires `faceit[env]` or manual [python-decouple](https://github.com/HBNetwork/python-decouple) installation)_.
88
+ - **Automatic:** Set the `FACEIT_API_KEY` environment variable.
89
+ Requires `faceit[env]` extra dependency or manual [python-decouple](https://github.com/HBNetwork/python-decouple) installation.
89
90
  - **Manual:** Pass the key string directly: `SyncDataResource("YOUR_API_KEY")`.
90
91
  - **Custom Variable:** To use a different environment variable name, pass an instance of `FromEnv`: `SyncDataResource(FromEnv("SECRET"))`
91
92
 
@@ -0,0 +1,168 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.11.14,<0.12.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "faceit"
7
+ version = "0.3.2"
8
+ description = "The Python wrapper for the FACEIT API"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ authors = [
13
+ { name = "zombyacoff", email = "zombyacoff@gmail.com" },
14
+ ]
15
+ keywords = ["api", "faceit", "wrapper"]
16
+ classifiers = [
17
+ "Intended Audience :: Developers",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
25
+ "Programming Language :: Python :: 3.15",
26
+ "Typing :: Typed",
27
+ ]
28
+ dependencies = [
29
+ "httpx>=0.28.0",
30
+ "pydantic>=2.13.0",
31
+ "tenacity>=8.5.0",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ env = ["python-decouple>=3.8"]
36
+
37
+ [project.urls]
38
+ "Repository" = "https://github.com/zombyacoff/faceit-python"
39
+ "Releases" = "https://github.com/zombyacoff/faceit-python/releases"
40
+ "Bug Tracker" = "https://github.com/zombyacoff/faceit-python/issues"
41
+
42
+ [dependency-groups]
43
+ dev = [
44
+ "mypy>=2.0.0",
45
+ "pre-commit>=4.6.0",
46
+ "pytest>=9.0.0",
47
+ "pytest-asyncio>=1.3.0",
48
+ # TODO
49
+ # Achieve 100% test coverage !!!
50
+ # "pytest-cov>=7.1.0",
51
+ "ruff>=0.15.17",
52
+ ]
53
+
54
+ [tool.mypy]
55
+ exclude = [
56
+ "^docs/",
57
+ "^local/",
58
+ "^tests/",
59
+ ]
60
+ python_version = "3.10"
61
+ strict = true
62
+ warn_unreachable = true
63
+
64
+ [[tool.mypy.overrides]]
65
+ module = "decouple.*"
66
+ follow_untyped_imports = true
67
+ ignore_missing_imports = true
68
+
69
+ [tool.pytest]
70
+ asyncio_mode = "auto"
71
+ markers = [
72
+ "e2e: End-to-end tests that interact with the real FACEIT API"
73
+ ]
74
+
75
+ [tool.ruff]
76
+ line-length = 88
77
+ preview = true
78
+ target-version = "py310"
79
+
80
+ [tool.ruff.lint]
81
+ select = ["ALL"]
82
+ ignore = [
83
+ "ANN401", # Dynamically typed expressions (`Any`) are disallowed
84
+ "B024", # Abstract base class without abstract methods
85
+ "COM812", # Trailing comma formatting conflict
86
+ "CPY001", # Missing copyright notice
87
+ "D", # pydocstyle docstring violations
88
+ "DOC", # pydoclint docstring validation violations
89
+ "E501", # Line too long
90
+ "FIX002", # TODO comment detected
91
+ "PLR0904", # Too many public methods
92
+ "PLR0913", # Too many function arguments
93
+ "RUF003", # Ambiguous Unicode character in comment
94
+ "S101", # Use of assert detected
95
+ "SLF001", # Private member accessed outside class
96
+ "TD", # flake8-todos violations
97
+ ]
98
+
99
+ [tool.ruff.lint.isort]
100
+ combine-as-imports = true
101
+ required-imports = ["from __future__ import annotations"]
102
+
103
+ [tool.ruff.lint.flake8-bugbear]
104
+ extend-immutable-calls = [
105
+ "faceit.http.client.env",
106
+ "faceit.api.pagination.pages",
107
+ ]
108
+
109
+ [tool.ruff.lint.flake8-import-conventions]
110
+ banned-from = [
111
+ "asyncio", "decouple", "httpx", "inspect", "json", "logging",
112
+ "math", "os", "random", "re", "reprlib", "tenacity", "warnings",
113
+ ]
114
+
115
+ [tool.ruff.lint.pep8-naming]
116
+ ignore-names = [
117
+ "env", "pages",
118
+ ]
119
+
120
+ [tool.ruff.lint.pylint]
121
+ allow-dunder-method-names = [
122
+ "__get_pydantic_core_schema__",
123
+ ]
124
+
125
+ [tool.ruff.lint.flake8-type-checking]
126
+ runtime-evaluated-base-classes = ["pydantic.BaseModel", "faceit.models.base.BaseModel"]
127
+ runtime-evaluated-decorators = ["pydantic.validate_call"]
128
+
129
+ [tool.ruff.lint.per-file-ignores]
130
+ "__init__.py" = [
131
+ "I002", # Missing required import
132
+ "RUF067", # Code is present in `__init__.py`
133
+ ]
134
+ "docs/*" = ["ALL"]
135
+ "examples/*" = [
136
+ "ICN003", # Import a member from the module instead of importing the member directly
137
+ "INP001", # Missing `__init__.py` file in a package directory
138
+ "PLR0914", # Too many local variables
139
+ "PLR2004", # Magic value used in a comparison
140
+ "T201", # `print()` statement detected
141
+ ]
142
+ "exceptions.py" = [
143
+ "E302", # Expected 2 blank lines before top-level definitions
144
+ "E305", # Expected 2 blank lines after a class or function definition
145
+ ]
146
+ "scripts/*" = [
147
+ "INP001", # Missing `__init__.py` file in a package directory
148
+ "T201", # `print()` statement detected
149
+ ]
150
+ "!**/conftest.py" = [
151
+ "RUF076", # Avoid using `autouse=True` in `pytest.fixture` decorators
152
+ ]
153
+ "tests/*" = [
154
+ "PLC1901", # Compare to empty string (e.g., `x == ""` instead of `not x`)
155
+ "PLC2701", # Import of a private name from an external module
156
+ "PLR0917", # Too many positional arguments
157
+ "PLR2004", # Magic value used in a comparison
158
+ "PLR6301", # Method could be a function, class method, or static method (doesn't use `self`)
159
+ "PLW0717", # `try` contains too many statements
160
+ "PT011", # `pytest.raises()` is too broad, set the `match` parameter
161
+ "PT030", # `pytest.warns()` is too broad, set the `match` parameter
162
+ ]
163
+ "types.py" = [
164
+ "E302", # Expected 2 blank lines before top-level definitions
165
+ "F401", # Imported but unused
166
+ "ICN003", # Import a member from the module instead of importing the member directly
167
+ "PYI018", # Unused private `TypeVar`, `ParamSpec`, or `TypeVarTuple` declaration
168
+ ]
@@ -10,7 +10,6 @@ from importlib.metadata import PackageNotFoundError, version
10
10
  from .api import (
11
11
  AsyncDataResource as AsyncDataResource,
12
12
  AsyncPageIterator as AsyncPageIterator,
13
- MaxItems as MaxItems,
14
13
  SyncDataResource as SyncDataResource,
15
14
  SyncPageIterator as SyncPageIterator,
16
15
  TimestampPaginationConfig as TimestampPaginationConfig,
@@ -4,7 +4,6 @@ from .data import (
4
4
  )
5
5
  from .pagination import (
6
6
  AsyncPageIterator as AsyncPageIterator,
7
- MaxItems as MaxItems,
8
7
  SyncPageIterator as SyncPageIterator,
9
8
  TimestampPaginationConfig as TimestampPaginationConfig,
10
9
  pages as pages,
@@ -4,12 +4,13 @@ from abc import ABC
4
4
  from functools import cached_property
5
5
  from typing import TYPE_CHECKING, Any, Generic, TypeVar, get_args
6
6
 
7
- from typing_extensions import Never, Self
8
-
9
7
  from faceit.http import AsyncClient, FromEnv, SyncClient
10
8
  from faceit.types import ClientT, Raw, ValidUUID
9
+ from faceit.utils import representation
11
10
 
12
11
  if TYPE_CHECKING:
12
+ from typing_extensions import Never, Self
13
+
13
14
  from faceit.api.base import BaseResource
14
15
  from faceit.http.client import BaseAPIClient
15
16
 
@@ -17,6 +18,7 @@ if TYPE_CHECKING:
17
18
  _AggregatorT = TypeVar("_AggregatorT", bound="BaseResources[Any]")
18
19
 
19
20
 
21
+ @representation("client")
20
22
  class BaseResources(ABC, Generic[ClientT]):
21
23
  __slots__ = ("_client",)
22
24
 
@@ -35,12 +37,8 @@ class BaseResources(ABC, Generic[ClientT]):
35
37
  if auth is not None and client is not None:
36
38
  msg = f"Provide either {secret_type!r} or 'client', not both"
37
39
  raise ValueError(msg)
38
- self._client = (
39
- self._client_cls(
40
- FromEnv(f"FACEIT_{secret_type.upper()}") if auth is None else auth
41
- )
42
- if client is None
43
- else client
40
+ self._client = client or self._client_cls(
41
+ FromEnv(f"FACEIT_{secret_type.upper()}") if auth is None else auth
44
42
  )
45
43
 
46
44
  @property
@@ -28,7 +28,7 @@ from faceit.types import (
28
28
  RawAPIPageResponse,
29
29
  RawAPIResponse,
30
30
  )
31
- from faceit.utils import find_user_stacklevel
31
+ from faceit.utils import find_user_stacklevel, representation
32
32
 
33
33
  if TYPE_CHECKING:
34
34
  from collections.abc import Mapping
@@ -40,7 +40,7 @@ _logger = logging.getLogger(__name__)
40
40
  # Temporary placeholder type for unimplemented models.
41
41
  # Serves as a stub during development and should be replaced with
42
42
  # concrete models as implementation progresses.
43
- ModelPlaceholder: None = None
43
+ ModelPlaceholder = None
44
44
 
45
45
 
46
46
  @final
@@ -50,7 +50,7 @@ class RequestPayload(TypedDict):
50
50
 
51
51
 
52
52
  @final
53
- @dataclass(eq=False, frozen=True)
53
+ @dataclass(eq=False, frozen=True, kw_only=True)
54
54
  class MappedValidatorConfig(Generic[_T, ModelT]):
55
55
  validator_map: Mapping[_T, type[ModelT]]
56
56
  key_name: str = "key"
@@ -60,12 +60,9 @@ class MappedValidatorConfig(Generic[_T, ModelT]):
60
60
  # TODO: Refactor the base resource class if/when support for resources
61
61
  # other than Data is required, since the current implementation is
62
62
  # too Data-centric.
63
+ @representation("_raw", "_strict_validation")
63
64
  class BaseResource(ABC, Generic[ClientT]):
64
- __slots__ = (
65
- "_client",
66
- "_raw",
67
- "_strict_validation",
68
- )
65
+ __slots__ = ("_client", "_raw", "_strict_validation")
69
66
 
70
67
  if TYPE_CHECKING:
71
68
  PATH: ClassVar[Endpoint]
@@ -102,10 +99,6 @@ class BaseResource(ABC, Generic[ClientT]):
102
99
  cls.PATH = Endpoint(resource_path)
103
100
  super().__init_subclass__(**kwargs)
104
101
 
105
- @property
106
- def is_raw(self) -> bool:
107
- return self._raw
108
-
109
102
  @property
110
103
  def strict_validation_enabled(self) -> bool:
111
104
  return self._strict_validation
@@ -178,7 +171,7 @@ class BaseResource(ABC, Generic[ClientT]):
178
171
  return validator.model_validate(response)
179
172
  except ValidationError:
180
173
  _logger.exception("Validation failed for %s", validator.__name__)
181
- if self.strict_validation_enabled:
174
+ if self._strict_validation:
182
175
  raise
183
176
  warnings.warn(
184
177
  "Validation failed but strict mode disabled. Raw response returned.",
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from abc import ABC
4
- from collections.abc import Sequence # noqa: TC003
4
+ from collections.abc import Sequence
5
5
  from typing import Annotated, Generic, TypeAlias, final, overload
6
6
 
7
7
  from pydantic import AfterValidator, Field, validate_call
@@ -8,12 +8,11 @@ from pydantic import Field, validate_call
8
8
  from faceit.api.base import BaseResource, ModelPlaceholder
9
9
  from faceit.api.pagination import (
10
10
  AsyncPageIterator,
11
- MaxItems,
12
11
  MaxItemsType,
13
12
  SyncPageIterator,
14
13
  )
15
14
  from faceit.http import AsyncClient, SyncClient
16
- from faceit.models import ItemPage # noqa: TC001
15
+ from faceit.models import ItemPage
17
16
  from faceit.types import (
18
17
  APIResponseFormatT,
19
18
  ClientT,
@@ -71,16 +70,16 @@ class SyncGames(BaseGames[SyncClient], Generic[APIResponseFormatT]):
71
70
 
72
71
  @overload
73
72
  def all_items(
74
- self: SyncGames[Raw], max_items: MaxItemsType = MaxItems.SAFE
73
+ self: SyncGames[Raw], max_items: MaxItemsType = "safe"
75
74
  ) -> list[RawAPIItem]: ...
76
75
 
77
76
  @overload
78
77
  def all_items(
79
- self: SyncGames[Model], max_items: MaxItemsType = MaxItems.SAFE
78
+ self: SyncGames[Model], max_items: MaxItemsType = "safe"
80
79
  ) -> ItemPage[ModelNotImplemented]: ...
81
80
 
82
81
  def all_items(
83
- self, max_items: MaxItemsType = MaxItems.SAFE
82
+ self, max_items: MaxItemsType = "safe"
84
83
  ) -> list[RawAPIItem] | ItemPage[ModelNotImplemented]:
85
84
  iterator = SyncPageIterator(self.items, max_items=max_items)
86
85
  return iterator.collect()
@@ -124,16 +123,16 @@ class AsyncGames(BaseGames[AsyncClient], Generic[APIResponseFormatT]):
124
123
 
125
124
  @overload
126
125
  async def all_items(
127
- self: AsyncGames[Raw], max_items: MaxItemsType = MaxItems.SAFE
126
+ self: AsyncGames[Raw], max_items: MaxItemsType = "safe"
128
127
  ) -> list[RawAPIItem]: ...
129
128
 
130
129
  @overload
131
130
  async def all_items(
132
- self: AsyncGames[Model], max_items: MaxItemsType = MaxItems.SAFE
131
+ self: AsyncGames[Model], max_items: MaxItemsType = "safe"
133
132
  ) -> ItemPage[ModelNotImplemented]: ...
134
133
 
135
134
  async def all_items(
136
- self, max_items: MaxItemsType = MaxItems.SAFE
135
+ self, max_items: MaxItemsType = "safe"
137
136
  ) -> list[RawAPIItem] | ItemPage[ModelNotImplemented]:
138
137
  iterator = AsyncPageIterator(self.items, max_items=max_items)
139
138
  return await iterator.collect()
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from contextlib import suppress
2
4
  from typing import Any
3
5
 
@@ -18,7 +18,7 @@ from faceit.types import (
18
18
  )
19
19
  from faceit.utils import create_uuid_validator
20
20
 
21
- from .players import PlayerID, PlayerIDValidated # noqa: TC001
21
+ from .players import PlayerID, PlayerIDValidated
22
22
 
23
23
  _LeagueID: TypeAlias = ValidUUID
24
24
  _LeagueIDValidated: TypeAlias = Annotated[
@@ -106,15 +106,13 @@ class SyncLeagues(BaseLeagues[SyncClient], Generic[APIResponseFormatT]):
106
106
  season_id: _SeasonID,
107
107
  player_id: PlayerIDValidated,
108
108
  ) -> RawAPIItem | ModelNotImplemented:
109
- # fmt: off
110
109
  return self._validate_response(
111
110
  self._client.get(
112
111
  self.__class__.PATH / str(matchmaking_id) / "seasons" / str(season_id) / "players" / str(player_id),
113
112
  expect_item=True,
114
113
  ),
115
114
  ModelPlaceholder,
116
- )
117
- # fmt: on
115
+ ) # fmt: skip
118
116
 
119
117
 
120
118
  @final
@@ -187,12 +185,10 @@ class AsyncLeagues(BaseLeagues[AsyncClient], Generic[APIResponseFormatT]):
187
185
  season_id: _SeasonID,
188
186
  player_id: PlayerIDValidated,
189
187
  ) -> RawAPIItem | ModelNotImplemented:
190
- # fmt: off
191
188
  return self._validate_response(
192
189
  await self._client.get(
193
190
  self.__class__.PATH / str(matchmaking_id) / "seasons" / str(season_id) / "players" / str(player_id),
194
191
  expect_item=True,
195
192
  ),
196
193
  ModelPlaceholder,
197
- )
198
- # fmt: on
194
+ ) # fmt: skip
@@ -23,7 +23,6 @@ from faceit.api.base import (
23
23
  )
24
24
  from faceit.api.pagination import (
25
25
  AsyncPageIterator,
26
- MaxItems,
27
26
  MaxItemsType,
28
27
  SyncPageIterator,
29
28
  TimestampPaginationConfig,
@@ -43,7 +42,7 @@ from faceit.models import (
43
42
  Player,
44
43
  Tournament,
45
44
  )
46
- from faceit.models.custom_types import NotStrictTimestampMs # noqa: TC001
45
+ from faceit.models.custom_types import NotStrictTimestampMs
47
46
  from faceit.models.players.general import AnyPlayerStats
48
47
  from faceit.models.players.match import AbstractMatchPlayerStats
49
48
  from faceit.types import (
@@ -231,18 +230,18 @@ class SyncPlayers(BasePlayers[SyncClient], Generic[APIResponseFormatT]):
231
230
  def all_bans(
232
231
  self: SyncPlayers[Raw],
233
232
  player_id: PlayerID,
234
- max_items: MaxItemsType = MaxItems.SAFE,
233
+ max_items: MaxItemsType = "safe",
235
234
  ) -> list[RawAPIItem]: ...
236
235
 
237
236
  @overload
238
237
  def all_bans(
239
238
  self: SyncPlayers[Model],
240
239
  player_id: PlayerID,
241
- max_items: MaxItemsType = MaxItems.SAFE,
240
+ max_items: MaxItemsType = "safe",
242
241
  ) -> ItemPage[BanEntry]: ...
243
242
 
244
243
  def all_bans(
245
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
244
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
246
245
  ) -> list[RawAPIItem] | ItemPage[BanEntry]:
247
246
  iterator = SyncPageIterator(self.bans, player_id, max_items=max_items)
248
247
  return iterator.collect()
@@ -474,18 +473,18 @@ class SyncPlayers(BasePlayers[SyncClient], Generic[APIResponseFormatT]):
474
473
  def all_hubs(
475
474
  self: SyncPlayers[Raw],
476
475
  player_id: PlayerID,
477
- max_items: MaxItemsType = MaxItems.SAFE,
476
+ max_items: MaxItemsType = "safe",
478
477
  ) -> list[RawAPIItem]: ...
479
478
 
480
479
  @overload
481
480
  def all_hubs(
482
481
  self: SyncPlayers[Model],
483
482
  player_id: PlayerID,
484
- max_items: MaxItemsType = MaxItems.SAFE,
483
+ max_items: MaxItemsType = "safe",
485
484
  ) -> ItemPage[Hub]: ...
486
485
 
487
486
  def all_hubs(
488
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
487
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
489
488
  ) -> list[RawAPIItem] | ItemPage[Hub]:
490
489
  iterator = SyncPageIterator(self.hubs, player_id, max_items=max_items)
491
490
  return iterator.collect()
@@ -557,18 +556,18 @@ class SyncPlayers(BasePlayers[SyncClient], Generic[APIResponseFormatT]):
557
556
  def all_teams(
558
557
  self: SyncPlayers[Raw],
559
558
  player_id: PlayerID,
560
- max_items: MaxItemsType = MaxItems.SAFE,
559
+ max_items: MaxItemsType = "safe",
561
560
  ) -> list[RawAPIItem]: ...
562
561
 
563
562
  @overload
564
563
  def all_teams(
565
564
  self: SyncPlayers[Model],
566
565
  player_id: PlayerID,
567
- max_items: MaxItemsType = MaxItems.SAFE,
566
+ max_items: MaxItemsType = "safe",
568
567
  ) -> ItemPage[GeneralTeam]: ...
569
568
 
570
569
  def all_teams(
571
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
570
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
572
571
  ) -> list[RawAPIItem] | ItemPage[GeneralTeam]:
573
572
  iterator = SyncPageIterator(self.teams, player_id, max_items=max_items)
574
573
  return iterator.collect()
@@ -612,18 +611,18 @@ class SyncPlayers(BasePlayers[SyncClient], Generic[APIResponseFormatT]):
612
611
  def all_tournaments(
613
612
  self: SyncPlayers[Raw],
614
613
  player_id: PlayerID,
615
- max_items: MaxItemsType = MaxItems.SAFE,
614
+ max_items: MaxItemsType = "safe",
616
615
  ) -> list[RawAPIItem]: ...
617
616
 
618
617
  @overload
619
618
  def all_tournaments(
620
619
  self: SyncPlayers[Model],
621
620
  player_id: PlayerID,
622
- max_items: MaxItemsType = MaxItems.SAFE,
621
+ max_items: MaxItemsType = "safe",
623
622
  ) -> ItemPage[Tournament]: ...
624
623
 
625
624
  def all_tournaments(
626
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
625
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
627
626
  ) -> list[RawAPIItem] | ItemPage[Tournament]:
628
627
  iterator = SyncPageIterator(self.tournaments, player_id, max_items=max_items)
629
628
  return iterator.collect()
@@ -710,18 +709,18 @@ class AsyncPlayers(BasePlayers[AsyncClient], Generic[APIResponseFormatT]):
710
709
  async def all_bans(
711
710
  self: AsyncPlayers[Raw],
712
711
  player_id: PlayerID,
713
- max_items: MaxItemsType = MaxItems.SAFE,
712
+ max_items: MaxItemsType = "safe",
714
713
  ) -> list[RawAPIItem]: ...
715
714
 
716
715
  @overload
717
716
  async def all_bans(
718
717
  self: AsyncPlayers[Model],
719
718
  player_id: PlayerID,
720
- max_items: MaxItemsType = MaxItems.SAFE,
719
+ max_items: MaxItemsType = "safe",
721
720
  ) -> ItemPage[BanEntry]: ...
722
721
 
723
722
  async def all_bans(
724
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
723
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
725
724
  ) -> list[RawAPIItem] | ItemPage[BanEntry]:
726
725
  iterator = AsyncPageIterator(self.bans, player_id, max_items=max_items)
727
726
  return await iterator.collect()
@@ -950,18 +949,18 @@ class AsyncPlayers(BasePlayers[AsyncClient], Generic[APIResponseFormatT]):
950
949
  async def all_hubs(
951
950
  self: AsyncPlayers[Raw],
952
951
  player_id: PlayerID,
953
- max_items: MaxItemsType = MaxItems.SAFE,
952
+ max_items: MaxItemsType = "safe",
954
953
  ) -> list[RawAPIItem]: ...
955
954
 
956
955
  @overload
957
956
  async def all_hubs(
958
957
  self: AsyncPlayers[Model],
959
958
  player_id: PlayerID,
960
- max_items: MaxItemsType = MaxItems.SAFE,
959
+ max_items: MaxItemsType = "safe",
961
960
  ) -> ItemPage[Hub]: ...
962
961
 
963
962
  async def all_hubs(
964
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
963
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
965
964
  ) -> list[RawAPIItem] | ItemPage[Hub]:
966
965
  iterator = AsyncPageIterator(self.hubs, player_id, max_items=max_items)
967
966
  return await iterator.collect()
@@ -1033,18 +1032,18 @@ class AsyncPlayers(BasePlayers[AsyncClient], Generic[APIResponseFormatT]):
1033
1032
  async def all_teams(
1034
1033
  self: AsyncPlayers[Raw],
1035
1034
  player_id: PlayerID,
1036
- max_items: MaxItemsType = MaxItems.SAFE,
1035
+ max_items: MaxItemsType = "safe",
1037
1036
  ) -> list[RawAPIItem]: ...
1038
1037
 
1039
1038
  @overload
1040
1039
  async def all_teams(
1041
1040
  self: AsyncPlayers[Model],
1042
1041
  player_id: PlayerID,
1043
- max_items: MaxItemsType = MaxItems.SAFE,
1042
+ max_items: MaxItemsType = "safe",
1044
1043
  ) -> ItemPage[GeneralTeam]: ...
1045
1044
 
1046
1045
  async def all_teams(
1047
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
1046
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
1048
1047
  ) -> list[RawAPIItem] | ItemPage[GeneralTeam]:
1049
1048
  iterator = AsyncPageIterator(self.teams, player_id, max_items=max_items)
1050
1049
  return await iterator.collect()
@@ -1088,18 +1087,18 @@ class AsyncPlayers(BasePlayers[AsyncClient], Generic[APIResponseFormatT]):
1088
1087
  async def all_tournaments(
1089
1088
  self: AsyncPlayers[Raw],
1090
1089
  player_id: PlayerID,
1091
- max_items: MaxItemsType = MaxItems.SAFE,
1090
+ max_items: MaxItemsType = "safe",
1092
1091
  ) -> list[RawAPIItem]: ...
1093
1092
 
1094
1093
  @overload
1095
1094
  async def all_tournaments(
1096
1095
  self: AsyncPlayers[Model],
1097
1096
  player_id: PlayerID,
1098
- max_items: MaxItemsType = MaxItems.SAFE,
1097
+ max_items: MaxItemsType = "safe",
1099
1098
  ) -> ItemPage[Tournament]: ...
1100
1099
 
1101
1100
  async def all_tournaments(
1102
- self, player_id: PlayerID, max_items: MaxItemsType = MaxItems.SAFE
1101
+ self, player_id: PlayerID, max_items: MaxItemsType = "safe"
1103
1102
  ) -> list[RawAPIItem] | ItemPage[Tournament]:
1104
1103
  iterator = AsyncPageIterator(self.tournaments, player_id, max_items=max_items)
1105
1104
  return await iterator.collect()