pychpp 0.4.0b1__tar.gz → 0.4.0b2__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 (64) hide show
  1. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/PKG-INFO +4 -2
  2. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/README.md +3 -1
  3. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/chpp.py +2 -2
  4. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_arena.py +4 -4
  5. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_team.py +1 -1
  6. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_youth_team.py +1 -1
  7. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/ht_model.py +86 -75
  8. pychpp-0.4.0b2/pychpp/models/ht_version.py +84 -0
  9. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/achievements.py +7 -3
  10. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/arena_details.py +19 -9
  11. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/challenges.py +6 -7
  12. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/cup_matches.py +0 -1
  13. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/league_details.py +1 -1
  14. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/league_fixtures.py +7 -3
  15. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/manager_compendium.py +21 -17
  16. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/match_details.py +1 -1
  17. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/match_lineup.py +1 -1
  18. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/matches_archive.py +1 -1
  19. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/national_team_details.py +7 -3
  20. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/national_teams.py +7 -2
  21. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/player_details.py +7 -3
  22. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/players.py +1 -1
  23. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/region_details.py +1 -1
  24. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/team_details.py +6 -5
  25. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/training.py +13 -11
  26. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/world_cup.py +21 -6
  27. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/world_details.py +1 -1
  28. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/youth_player_details.py +1 -1
  29. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/youth_player_list.py +1 -1
  30. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/youth_team_details.py +3 -3
  31. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pyproject.toml +1 -1
  32. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/LICENSE +0 -0
  33. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/__init__.py +0 -0
  34. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/fixtures/__init__.py +0 -0
  35. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/fixtures/ht_datetime.py +0 -0
  36. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/fixtures/ht_error.py +0 -0
  37. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/__init__.py +0 -0
  38. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/__init__.py +0 -0
  39. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/__init__.py +0 -0
  40. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_arena.py +0 -0
  41. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_country.py +0 -0
  42. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_league.py +0 -0
  43. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_league_unit.py +0 -0
  44. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_match.py +0 -0
  45. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_player.py +0 -0
  46. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_region.py +0 -0
  47. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_team.py +0 -0
  48. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/base/ht_user.py +0 -0
  49. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_challenge.py +0 -0
  50. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_league.py +0 -0
  51. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_league_unit.py +0 -0
  52. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_match.py +0 -0
  53. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_match_lineup.py +0 -0
  54. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_matches_archive.py +0 -0
  55. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_player.py +0 -0
  56. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_region.py +0 -0
  57. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_transfer_history.py +0 -0
  58. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_user.py +0 -0
  59. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/custom/ht_youth_player.py +0 -0
  60. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/ht_field.py +0 -0
  61. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/ht_init_var.py +0 -0
  62. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/ht_xml.py +0 -0
  63. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/__init__.py +0 -0
  64. {pychpp-0.4.0b1 → pychpp-0.4.0b2}/pychpp/models/xml/transfers_team.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pychpp
3
- Version: 0.4.0b1
3
+ Version: 0.4.0b2
4
4
  Summary: framework created to use the API provided by the online game Hattrick
5
5
  Home-page: https://framagit.org/Pierre86/pychpp
6
6
  License: Apache-2.0
@@ -164,7 +164,9 @@ Then, to use this new class:
164
164
  In this way, only the data you're really interested in is parsed, which can in some cases be interesting from a performance point of view.
165
165
 
166
166
  ## List of supported CHPP XML files
167
- The following table shows the CHPP XML files that are currently supported (23/57) :
167
+ ![23/57](https://progress-bar.xyz/40/?title=23%20on%2057)
168
+
169
+ The following table shows the CHPP XML files that are currently supported:
168
170
 
169
171
  | pyCHPP class | CHPP XML files |
170
172
  |:-------------------:|:-------------------------:|
@@ -143,7 +143,9 @@ Then, to use this new class:
143
143
  In this way, only the data you're really interested in is parsed, which can in some cases be interesting from a performance point of view.
144
144
 
145
145
  ## List of supported CHPP XML files
146
- The following table shows the CHPP XML files that are currently supported (23/57) :
146
+ ![23/57](https://progress-bar.xyz/40/?title=23%20on%2057)
147
+
148
+ The following table shows the CHPP XML files that are currently supported:
147
149
 
148
150
  | pyCHPP class | CHPP XML files |
149
151
  |:-------------------:|:-------------------------:|
@@ -375,12 +375,12 @@ class CHPPXml(CHPPBase):
375
375
  self, stats_type: str = None, arena_id: int = None, team_id: int = None,
376
376
  match_type: str = None, first_date: datetime = None,
377
377
  last_date: datetime = None, stats_league_id: int = None,
378
- ) -> Union[arena_details.ArenaDetails,
378
+ ) -> Union[arena_details.ArenaDetailsDefault,
379
379
  arena_details.ArenaDetailsMyArena,
380
380
  arena_details.ArenaDetailsLeagueArenaStats]:
381
381
 
382
382
  if stats_type is None:
383
- return arena_details.ArenaDetails(
383
+ return arena_details.ArenaDetailsDefault(
384
384
  chpp=self, stats_type=stats_type, arena_id=arena_id, team_id=team_id,
385
385
  )
386
386
 
@@ -6,13 +6,13 @@ from pychpp.models.ht_field import HTProxyField
6
6
  from pychpp.models.xml import arena_details
7
7
 
8
8
 
9
- class HTArena(arena_details.ArenaDetails, BaseHTArena):
9
+ class HTArena(arena_details.ArenaDetailsDefault, BaseHTArena):
10
10
  """
11
11
  Hattrick Arena
12
12
  """
13
- team: 'HTArenaTeam' = HTProxyField(arena_details.ArenaDetails)
14
- league: 'HTArenaLeague' = HTProxyField(arena_details.ArenaDetails)
15
- region: 'HTArenaRegion' = HTProxyField(arena_details.ArenaDetails)
13
+ team: 'HTArenaTeam' = HTProxyField(arena_details.ArenaDetailsDefault)
14
+ league: 'HTArenaLeague' = HTProxyField(arena_details.ArenaDetailsDefault)
15
+ region: 'HTArenaRegion' = HTProxyField(arena_details.ArenaDetailsDefault)
16
16
 
17
17
 
18
18
  class HTArenaTeam(arena_details.Team, HTLightTeam):
@@ -14,7 +14,7 @@ from pychpp.models.xml.players import PlayersViewTeamPlayerItem, PlayersViewTeam
14
14
  from pychpp.models.xml import team_details as td
15
15
 
16
16
 
17
- class HTTeam(td.BaseTeamDetails, td.TeamItem, BaseHTTeam):
17
+ class HTTeam(td.RequestTeamDetails, td.TeamItem, BaseHTTeam):
18
18
 
19
19
  XML_PREFIX = 'Teams/Team/'
20
20
  XML_FILTER = ''
@@ -12,7 +12,7 @@ if TYPE_CHECKING:
12
12
  from pychpp.models.custom import ht_team, ht_user
13
13
 
14
14
 
15
- class HTYouthTeam(ytd.BaseYouthTeamDetails, CustomModel):
15
+ class HTYouthTeam(ytd.RequestYouthTeamDetails, CustomModel):
16
16
  """
17
17
  Hattrick Youth Team
18
18
  """
@@ -6,6 +6,7 @@ from datetime import datetime, date
6
6
  from typing import get_type_hints, get_origin, Union, get_args
7
7
 
8
8
  import pychpp.chpp as _chpp
9
+ from pychpp.models.ht_version import HTVersionConstraint, HTVersion
9
10
  from pychpp.models.ht_xml import HTXml
10
11
  from pychpp.models.ht_field import HTBaseField, HTField, HTAliasField, HTProxyField
11
12
  from pychpp.models.ht_init_var import HTInitVar
@@ -113,7 +114,9 @@ class HTModel(metaclass=MetaHTModel):
113
114
  self._data = data
114
115
  self._url = ''
115
116
  self._requests_args = dict()
116
- self.version = version
117
+ self.version = (HTVersion(version)
118
+ if version is not None
119
+ else HTVersion(self.LAST_VERSION))
117
120
  self.xml_prefix = xml_prefix if xml_prefix is not None else self.XML_PREFIX
118
121
 
119
122
  if suppl_attrs is not None:
@@ -128,8 +131,6 @@ class HTModel(metaclass=MetaHTModel):
128
131
 
129
132
  def _fetch(self, version, **kwargs):
130
133
 
131
- self.version = version if version is not None else self.LAST_VERSION
132
-
133
134
  for attr, ht_init_var in self._ht_init_vars.items():
134
135
 
135
136
  ht_init_var.value = kwargs.get(ht_init_var.init_arg, None)
@@ -155,7 +156,7 @@ class HTModel(metaclass=MetaHTModel):
155
156
  setattr(self, attr, ht_init_var.value)
156
157
 
157
158
  self._data = self._chpp.request(file=self.SOURCE_FILE,
158
- version=self.version,
159
+ version=self.version.as_string,
159
160
  **self._requests_args,
160
161
  )
161
162
 
@@ -195,82 +196,92 @@ class HTModel(metaclass=MetaHTModel):
195
196
 
196
197
  field: HTField
197
198
 
198
- f_type = self.get_type(field_name)
199
- f_item_type = self.get_item_type(field_name)
200
- f_is_optional = True if self.is_optional_attrib(field_name) else False
201
- path = proxy_path if proxy_path else field.path
202
- xml_path = self.xml_prefix + self.XML_FILTER + path
203
- xml_node = self._data.find(xml_path)
204
- suppl_attrs = {k: getattr(self, v) for k, v in field.suppl_attrs.items()}
205
-
206
- # instance attribute set to transformed value
207
- # according to type hint
208
- if f_type is list:
209
-
210
- if xml_node is None:
211
- if not f_is_optional:
212
- raise ValueError(f"{self.__class__} : "
213
- f"non optional field {field} returned 'None'")
199
+ if (field.version is None
200
+ or HTVersionConstraint(field.version).is_valid(self.version)):
201
+
202
+ f_type = self.get_type(field_name)
203
+ f_item_type = self.get_item_type(field_name)
204
+ f_is_optional = True if self.is_optional_attrib(field_name) else False
205
+ path = proxy_path if proxy_path else field.path
206
+ xml_path = self.xml_prefix + self.XML_FILTER + path
207
+ xml_node = self._data.find(xml_path)
208
+ suppl_attrs = {k: getattr(self, v) for k, v in field.suppl_attrs.items()}
209
+
210
+ # instance attribute set to transformed value
211
+ # according to type hint
212
+ if f_type is list:
213
+
214
+ if xml_node is None:
215
+ if not f_is_optional:
216
+ raise ValueError(f"{self.__class__} : "
217
+ f"non optional field {field} returned 'None'")
218
+ else:
219
+ setattr(self, field_name, list())
220
+ continue
221
+
222
+ if f_item_type is str:
223
+ setattr(self, field_name, HTXml.ht_str_items(xml_node, field.items))
224
+ elif issubclass(f_item_type, HTModel):
225
+ f_item_type: Type[HTModel]
226
+ setattr(self,
227
+ field_name,
228
+ [f_item_type(chpp=self._chpp,
229
+ data=i,
230
+ version=self.version.as_string,
231
+ xml_prefix=field.xml_prefix,
232
+ suppl_attrs=suppl_attrs,
233
+ )
234
+ for i in HTXml.iter_data_items(xml_node, field.items)])
214
235
  else:
215
- setattr(self, field_name, list())
216
- continue
217
-
218
- if f_item_type is str:
219
- setattr(self, field_name, HTXml.ht_str_items(xml_node, field.items))
220
- elif issubclass(f_item_type, HTModel):
221
- f_item_type: Type[HTModel]
222
- setattr(self,
223
- field_name,
224
- [f_item_type(chpp=self._chpp,
225
- data=i,
226
- xml_prefix=field.xml_prefix,
227
- suppl_attrs=suppl_attrs,
228
- )
229
- for i in HTXml.iter_data_items(xml_node, field.items)])
236
+ raise ValueError(f"unsupported type '{f_item_type}' for list item")
237
+
230
238
  else:
231
- raise ValueError(f"unsupported type '{f_item_type}' for list item")
232
239
 
233
- else:
240
+ if xml_node is None:
241
+ if not f_is_optional:
242
+ raise ValueError(f"{self.__class__} : "
243
+ f"non optional field {field} returned 'None'")
244
+ else:
245
+ setattr(self, field_name, None)
246
+ continue
247
+
248
+ if f_type is int:
249
+ setattr(self, field_name, HTXml.ht_int(xml_node, attrib=field.attrib))
250
+
251
+ elif f_type is str:
252
+ setattr(self, field_name, HTXml.ht_str(xml_node, attrib=field.attrib))
253
+
254
+ elif f_type is float:
255
+ setattr(self,
256
+ field_name,
257
+ HTXml.ht_float(xml_node, attrib=field.attrib))
258
+
259
+ elif f_type is bool:
260
+ setattr(self, field_name, HTXml.ht_bool(xml_node, attrib=field.attrib))
261
+
262
+ elif f_type is datetime and self.is_optional_attrib(field_name):
263
+ setattr(self,
264
+ field_name,
265
+ HTXml.ht_datetime_from_text(xml_node, attrib=field.attrib))
266
+
267
+ elif f_type is datetime:
268
+ setattr(self,
269
+ field_name,
270
+ HTXml.opt_ht_datetime_from_text(xml_node, attrib=field.attrib))
271
+
272
+ elif issubclass(f_type, HTModel):
273
+ setattr(self, field_name, f_type(chpp=self._chpp,
274
+ data=xml_node,
275
+ version=self.version.as_string,
276
+ xml_prefix=field.xml_prefix,
277
+ suppl_attrs=suppl_attrs,
278
+ ))
234
279
 
235
- if xml_node is None:
236
- if not f_is_optional:
237
- raise ValueError(f"{self.__class__} : "
238
- f"non optional field {field} returned 'None'")
239
280
  else:
240
- setattr(self, field_name, None)
241
- continue
242
-
243
- if f_type is int:
244
- setattr(self, field_name, HTXml.ht_int(xml_node, attrib=field.attrib))
245
-
246
- elif f_type is str:
247
- setattr(self, field_name, HTXml.ht_str(xml_node, attrib=field.attrib))
248
-
249
- elif f_type is float:
250
- setattr(self, field_name, HTXml.ht_float(xml_node, attrib=field.attrib))
281
+ raise ValueError(f"type hint '{f_type}' no implemented")
251
282
 
252
- elif f_type is bool:
253
- setattr(self, field_name, HTXml.ht_bool(xml_node, attrib=field.attrib))
254
-
255
- elif f_type is datetime and self.is_optional_attrib(field_name):
256
- setattr(self,
257
- field_name,
258
- HTXml.ht_datetime_from_text(xml_node, attrib=field.attrib))
259
-
260
- elif f_type is datetime:
261
- setattr(self,
262
- field_name,
263
- HTXml.opt_ht_datetime_from_text(xml_node, attrib=field.attrib))
264
-
265
- elif issubclass(f_type, HTModel):
266
- setattr(self, field_name, f_type(chpp=self._chpp,
267
- data=xml_node,
268
- xml_prefix=field.xml_prefix,
269
- suppl_attrs=suppl_attrs,
270
- ))
271
-
272
- else:
273
- raise ValueError(f"type hint '{f_type}' no implemented")
283
+ else:
284
+ setattr(self, field_name, None)
274
285
 
275
286
  elif isinstance(field, HTAliasField):
276
287
  field: HTAliasField
@@ -288,7 +299,7 @@ class HTModel(metaclass=MetaHTModel):
288
299
  path = pathlib.Path.cwd()
289
300
 
290
301
  if filename is None:
291
- args = {'file': self.SOURCE_FILE, 'version': self.version}
302
+ args = {'file': self.SOURCE_FILE, 'version': self.version.as_string}
292
303
  args.update(sorted(self._requests_args.items()))
293
304
  filename = '&'.join(f"{k}={v}" for k, v in args.items()) + '.xml'
294
305
 
@@ -0,0 +1,84 @@
1
+ class HTVersion:
2
+
3
+ def __init__(self, version: str):
4
+ self.as_string = version
5
+ self.major = int(version.split('.')[0])
6
+ self.minor = int(version.split('.')[1])
7
+
8
+ def __lt__(self, other):
9
+ if isinstance(other, self.__class__):
10
+ if self.major == other.major:
11
+ return self.minor < other.minor
12
+ else:
13
+ return self.major < other.major
14
+ else:
15
+ return TypeError(f"can not compare {other.__class__.__name__}"
16
+ f" instance with HTVersion instance")
17
+
18
+ def __le__(self, other):
19
+ if isinstance(other, self.__class__):
20
+ if self.major == other.major:
21
+ return self.minor <= other.minor
22
+ else:
23
+ return self.major <= other.major
24
+ else:
25
+ return TypeError(f"can not compare {other.__class__.__name__}"
26
+ f" instance with HTVersion instance")
27
+
28
+ def __gt__(self, other):
29
+ return not self.__le__(other)
30
+
31
+ def __ge__(self, other):
32
+ return not self.__lt__(other)
33
+
34
+ def __eq__(self, other):
35
+ if isinstance(other, self.__class__):
36
+ return (self.major, self.minor) == (other.major, other.minor)
37
+ else:
38
+ return TypeError(f"can not compare {other.__class__.__name__}"
39
+ f" instance with HTVersion instance")
40
+
41
+
42
+ class HTVersionConstraint:
43
+
44
+ def __init__(self, version_constraint: str):
45
+
46
+ if version_constraint[0] == '=':
47
+ self.constraint = 'eq'
48
+
49
+ elif version_constraint[0:2] == '<=':
50
+ self.constraint = 'le'
51
+
52
+ elif version_constraint[0:2] == '>=':
53
+ self.constraint = 'ge'
54
+
55
+ elif version_constraint[0] == '<':
56
+ self.constraint = 'lt'
57
+
58
+ elif version_constraint[0] == '>':
59
+ self.constraint = 'gt'
60
+
61
+ else:
62
+ raise ValueError("Unknown version constraint")
63
+
64
+ if self.constraint in ('le', 'ge'):
65
+ self.version = HTVersion(version_constraint[2:])
66
+ else:
67
+ self.version = HTVersion(version_constraint[1:])
68
+
69
+ def is_valid(self, ht_version: HTVersion):
70
+
71
+ if self.constraint == 'eq':
72
+ return ht_version == self.version
73
+
74
+ elif self.constraint == 'gt':
75
+ return ht_version > self.version
76
+
77
+ elif self.constraint == 'ge':
78
+ return ht_version >= self.version
79
+
80
+ elif self.constraint == 'lt':
81
+ return ht_version < self.version
82
+
83
+ elif self.constraint == 'le':
84
+ return ht_version <= self.version
@@ -4,16 +4,20 @@ from typing import List
4
4
  from pychpp.models.ht_model import HTField, HTInitVar, HTModel
5
5
 
6
6
 
7
- class Achievements(HTModel):
7
+ class RequestAchievements(HTModel):
8
8
  """
9
- Achievements
9
+ Achievements - Request arguments
10
10
  """
11
-
12
11
  SOURCE_FILE = "achievements"
13
12
  LAST_VERSION = "1.2"
14
13
 
15
14
  _r_user_id: int = HTInitVar('userID', init_arg='user_id')
16
15
 
16
+
17
+ class Achievements(RequestAchievements):
18
+ """
19
+ Achievements
20
+ """
17
21
  max_points: int = HTField('MaxPoints')
18
22
  achievements: List['Achievement'] = HTField('AchievementList', items='Achievement')
19
23
 
@@ -4,9 +4,9 @@ from typing import Optional, List
4
4
  from pychpp.models.ht_model import HTField, HTInitVar, HTModel
5
5
 
6
6
 
7
- class CommonArenaDetails(HTModel):
7
+ class CommonRequestArenaDetails(HTModel):
8
8
  """
9
- Common Arena Details
9
+ Arena Details - Common request arguments
10
10
  """
11
11
  SOURCE_FILE = "arenadetails"
12
12
  LAST_VERSION = "1.7"
@@ -14,15 +14,15 @@ class CommonArenaDetails(HTModel):
14
14
  _r_stats_type: Optional[str] = HTInitVar('StatsType', init_arg='stats_type')
15
15
 
16
16
 
17
- class RequestArenaDetails(CommonArenaDetails):
17
+ class RequestArenaDetailsDefault(CommonRequestArenaDetails):
18
18
  """
19
- Base requests args for Arena Details
19
+ Arena Details - Default - Request arguments
20
20
  """
21
21
  _r_arena_id: Optional[int] = HTInitVar('arenaID', init_arg='arena_id', fill_with='id')
22
22
  _r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
23
23
 
24
24
 
25
- class ArenaDetails(RequestArenaDetails):
25
+ class ArenaDetailsDefault(RequestArenaDetailsDefault):
26
26
  """
27
27
  Arena Details
28
28
  """
@@ -87,9 +87,9 @@ class ExpandedCapacity(BaseCapacity):
87
87
  expansion_date: Optional[datetime] = HTField('ExpansionDate')
88
88
 
89
89
 
90
- class ArenaDetailsMyArena(CommonArenaDetails):
90
+ class RequestArenaDetailsMyArena(CommonRequestArenaDetails):
91
91
  """
92
- Arena Details - My Arena
92
+ Arena Details - My Arena - Request arguments
93
93
  """
94
94
  _r_arena_id: Optional[int] = HTInitVar('arenaID', init_arg='id', fill_with='id')
95
95
  _r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
@@ -97,6 +97,11 @@ class ArenaDetailsMyArena(CommonArenaDetails):
97
97
  _r_first_date: Optional[datetime] = HTInitVar('FirstDate', init_arg='first_date')
98
98
  _r_last_date: Optional[datetime] = HTInitVar('LastDate', init_arg='last_date')
99
99
 
100
+
101
+ class ArenaDetailsMyArena(RequestArenaDetailsMyArena):
102
+ """
103
+ Arena Details - My Arena
104
+ """
100
105
  id: Optional[int] = HTField('MyArena/ArenaID')
101
106
  name: Optional[str] = HTField('MyArena/ArenaName')
102
107
  image: Optional[str] = HTField('MyArena/ArenaImage')
@@ -121,12 +126,17 @@ class Visitors(HTModel):
121
126
  total: int = HTField('Total')
122
127
 
123
128
 
124
- class ArenaDetailsLeagueArenaStats(CommonArenaDetails):
129
+ class RequestArenaDetailsLeagueArenaStats(CommonRequestArenaDetails):
125
130
  """
126
- Arena Details - League Arena Stats
131
+ Arena Details - League Arena Stats - Request arguments
127
132
  """
128
133
  _r_league_id: int = HTInitVar('StatsLeagueID', init_arg='league_id')
129
134
 
135
+
136
+ class ArenaDetailsLeagueArenaStats(RequestArenaDetailsLeagueArenaStats):
137
+ """
138
+ Arena Details - League Arena Stats
139
+ """
130
140
  league_id: int = HTField('LeagueArenaStats/LeagueID')
131
141
  league_name: str = HTField('LeagueArenaStats/LeagueName')
132
142
  created_date: datetime = HTField('LeagueArenaStats/CreatedDate')
@@ -8,7 +8,7 @@ from pychpp.models.ht_model import HTModel
8
8
 
9
9
  class CommonRequestChallenges(HTModel):
10
10
  """
11
- Common request for Challenges
11
+ Challenges - Common request arguments
12
12
  """
13
13
  SOURCE_FILE = 'challenges'
14
14
  LAST_VERSION = '1.6'
@@ -31,7 +31,7 @@ class BaseChallenges(CommonRequestChallenges):
31
31
 
32
32
  class ChallengeItem(HTModel):
33
33
  """
34
- Challenges - View -> Challenges by me / Offers by others -> Challenge item
34
+ Challenges -> Challenges by me / Offers by others -> Challenge item
35
35
  """
36
36
  training_match_id: int = HTField('TrainingMatchID')
37
37
  match_time: datetime = HTField('MatchTime')
@@ -45,7 +45,7 @@ class ChallengeItem(HTModel):
45
45
 
46
46
  class ChallengeItemOpponent(HTModel):
47
47
  """
48
- Challenges - View -> Challenges by me / Offers by others -> Challenge item -> Opponent
48
+ Challenges -> Challenges by me / Offers by others -> Challenge item -> Opponent
49
49
  """
50
50
  id: int = HTField('TeamID')
51
51
  name: str = HTField('TeamName')
@@ -54,7 +54,7 @@ class ChallengeItemOpponent(HTModel):
54
54
 
55
55
  class ChallengeArena(HTModel):
56
56
  """
57
- Challenges - View -> Challenges by me / Offers by others -> Challenge item -> Opponent -> Arena
57
+ Challenges -> Challenges by me / Offers by others -> Challenge item -> Opponent -> Arena
58
58
  """
59
59
  id: int = HTField('ArenaID')
60
60
  name: str = HTField('ArenaName')
@@ -62,8 +62,7 @@ class ChallengeArena(HTModel):
62
62
 
63
63
  class ChallengeCountry(HTModel):
64
64
  """
65
- Challenges - View -> Challenges by me / Offers by others -> Challenge item
66
- -> Opponent -> Country
65
+ Challenges -> Challenges by me / Offers by others -> Challenge item -> Opponent -> Country
67
66
  """
68
67
  id: int = HTField('CountryID')
69
68
  name: str = HTField('CountryName')
@@ -71,7 +70,7 @@ class ChallengeCountry(HTModel):
71
70
 
72
71
  class ChallengesView(BaseChallenges):
73
72
  """
74
- Challenges view
73
+ Challenges - View
75
74
  """
76
75
  pass
77
76
 
@@ -10,7 +10,6 @@ class RequestCupMatches(HTModel):
10
10
  """
11
11
  Cup Matches - Request arguments
12
12
  """
13
-
14
13
  SOURCE_FILE = "cupmatches"
15
14
  LAST_VERSION = "1.4"
16
15
 
@@ -7,7 +7,7 @@ from pychpp.models.ht_model import HTModel
7
7
 
8
8
  class RequestLeagueDetails(HTModel):
9
9
  """
10
- Request arguments for League Details
10
+ League Details - Request arguments
11
11
  """
12
12
  SOURCE_FILE = 'leaguedetails'
13
13
  LAST_VERSION = '1.6'
@@ -6,17 +6,21 @@ from pychpp.models.ht_init_var import HTInitVar
6
6
  from pychpp.models.ht_model import HTModel
7
7
 
8
8
 
9
- class LeagueFixtures(HTModel):
9
+ class RequestLeagueFixtures(HTModel):
10
10
  """
11
- League Fixtures
11
+ League Fixtures - Request arguments
12
12
  """
13
-
14
13
  SOURCE_FILE = 'leaguefixtures'
15
14
  LAST_VERSION = '1.2'
16
15
 
17
16
  _r_league_level_unit_id: int = HTInitVar('leagueLevelUnitID', init_arg='league_level_unit_id')
18
17
  _r_season: int = HTInitVar('season', init_arg='season')
19
18
 
19
+
20
+ class LeagueFixtures(RequestLeagueFixtures):
21
+ """
22
+ League Fixtures
23
+ """
20
24
  id: int = HTField('LeagueLevelUnitID')
21
25
  name: str = HTField('LeagueLevelUnitName')
22
26
  season: int = HTField('Season')
@@ -3,16 +3,20 @@ from typing import List, Optional
3
3
  from pychpp.models.ht_model import HTField, HTInitVar, HTModel
4
4
 
5
5
 
6
- class ManagerCompendium(HTModel):
6
+ class RequestManagerCompendium(HTModel):
7
7
  """
8
- Manager Compendium
8
+ Manager Compendium - Request arguments
9
9
  """
10
-
11
10
  SOURCE_FILE = "managercompendium"
12
11
  LAST_VERSION = "1.5"
13
12
 
14
13
  _r_user_id: Optional[int] = HTInitVar(param='userID', init_arg='user_id', fill_with='id')
15
14
 
15
+
16
+ class ManagerCompendium(RequestManagerCompendium):
17
+ """
18
+ Manager Compendium
19
+ """
16
20
  id: int = HTField(path='Manager/UserId')
17
21
  login_name: str = HTField(path='Manager/Loginname')
18
22
  supporter_tier: str = HTField(path='Manager/SupporterTier')
@@ -31,7 +35,7 @@ class ManagerCompendium(HTModel):
31
35
 
32
36
  class Language(HTModel):
33
37
  """
34
- managercompendium -> Language
38
+ Manager Compendium -> Language
35
39
  """
36
40
  id: int = HTField(path='LanguageId')
37
41
  name: str = HTField(path='LanguageName')
@@ -39,7 +43,7 @@ class Language(HTModel):
39
43
 
40
44
  class Country(HTModel):
41
45
  """
42
- managercompendium -> Country
46
+ Manager Compendium -> Country
43
47
  """
44
48
  id: int = HTField(path='CountryId')
45
49
  name: str = HTField(path='CountryName')
@@ -47,7 +51,7 @@ class Country(HTModel):
47
51
 
48
52
  class Currency(HTModel):
49
53
  """
50
- managercompendium -> Currency
54
+ Manager Compendium -> Currency
51
55
  """
52
56
  name: str = HTField(path='CurrencyName')
53
57
  rate: float = HTField(path='CurrencyRate')
@@ -55,7 +59,7 @@ class Currency(HTModel):
55
59
 
56
60
  class TeamItem(HTModel):
57
61
  """
58
- managercompendium -> Teams -> Team item
62
+ Manager Compendium -> Teams -> Team item
59
63
  """
60
64
  id: int = HTField(path='TeamId')
61
65
  name: str = HTField(path='TeamName')
@@ -69,7 +73,7 @@ class TeamItem(HTModel):
69
73
 
70
74
  class TeamItemArena(HTModel):
71
75
  """
72
- managercompendium -> Teams -> Team item -> Arena
76
+ Manager Compendium -> Teams -> Team item -> Arena
73
77
  """
74
78
  id: int = HTField(path='ArenaId')
75
79
  name: str = HTField(path='ArenaName')
@@ -77,7 +81,7 @@ class TeamItemArena(HTModel):
77
81
 
78
82
  class TeamItemLeague(HTModel):
79
83
  """
80
- managercompendium -> Teams -> Team item -> League
84
+ Manager Compendium -> Teams -> Team item -> League
81
85
  """
82
86
  id: int = HTField(path='LeagueId')
83
87
  name: str = HTField(path='LeagueName')
@@ -86,7 +90,7 @@ class TeamItemLeague(HTModel):
86
90
 
87
91
  class TeamItemCountry(HTModel):
88
92
  """
89
- managercompendium -> Teams -> Team item -> Country
93
+ Manager Compendium -> Teams -> Team item -> Country
90
94
  """
91
95
  id: int = HTField(path='CountryId')
92
96
  name: str = HTField(path='CountryName')
@@ -94,7 +98,7 @@ class TeamItemCountry(HTModel):
94
98
 
95
99
  class TeamItemLeagueLevelUnit(HTModel):
96
100
  """
97
- managercompendium -> Teams -> Team item -> League Level Unit
101
+ Manager Compendium -> Teams -> Team item -> League Level Unit
98
102
  """
99
103
  id: int = HTField(path='LeagueLevelUnitId')
100
104
  name: str = HTField(path='LeagueLevelUnitName')
@@ -102,7 +106,7 @@ class TeamItemLeagueLevelUnit(HTModel):
102
106
 
103
107
  class TeamItemRegion(HTModel):
104
108
  """
105
- managercompendium -> Teams -> Team item -> Region
109
+ Manager Compendium -> Teams -> Team item -> Region
106
110
  """
107
111
  id: int = HTField(path='RegionId')
108
112
  name: str = HTField(path='RegionName')
@@ -110,7 +114,7 @@ class TeamItemRegion(HTModel):
110
114
 
111
115
  class TeamItemYouthTeam(HTModel):
112
116
  """
113
- managercompendium -> Teams -> Team item -> Youth team
117
+ Manager Compendium -> Teams -> Team item -> Youth team
114
118
  """
115
119
  id: int = HTField(path='YouthTeamId')
116
120
  name: str = HTField(path='YouthTeamName')
@@ -119,7 +123,7 @@ class TeamItemYouthTeam(HTModel):
119
123
 
120
124
  class TeamItemYouthTeamLeague(HTModel):
121
125
  """
122
- managercompendium -> Teams -> Team item -> Youth team -> League
126
+ Manager Compendium -> Teams -> Team item -> Youth team -> League
123
127
  """
124
128
  id: int = HTField(path='YouthLeagueId')
125
129
  name: str = HTField(path='YouthLeagueName')
@@ -127,7 +131,7 @@ class TeamItemYouthTeamLeague(HTModel):
127
131
 
128
132
  class NationalTeamItem(HTModel):
129
133
  """
130
- managercompendium -> National teams (coach or assistant) -> National team item
134
+ Manager Compendium -> National teams (coach or assistant) -> National team item
131
135
  """
132
136
  id: int = HTField(path='NationalTeamId')
133
137
  name: str = HTField(path='NationalTeamName')
@@ -135,7 +139,7 @@ class NationalTeamItem(HTModel):
135
139
 
136
140
  class Avatar(HTModel):
137
141
  """
138
- managercompendium -> Avatar
142
+ Manager Compendium -> Avatar
139
143
  """
140
144
  background_image: str = HTField(path='BackgroundImage')
141
145
  layers: Optional[List['AvatarLayer']] = HTField(path='../..', items='Layer')
@@ -143,7 +147,7 @@ class Avatar(HTModel):
143
147
 
144
148
  class AvatarLayer(HTModel):
145
149
  """
146
- managercompendium -> Avatar -> Layers -> Layer item
150
+ Manager Compendium -> Avatar -> Layers -> Layer item
147
151
  """
148
152
  x: int = HTField(path='../..', attrib='x')
149
153
  y: int = HTField(path='../..', attrib='y')
@@ -8,7 +8,7 @@ from pychpp.models.ht_model import HTModel
8
8
 
9
9
  class RequestMatchDetails(HTModel):
10
10
  """
11
- Request arguments for Match Details
11
+ Match Details - Request arguments
12
12
  """
13
13
  SOURCE_FILE = 'matchdetails'
14
14
  LAST_VERSION = '3.1'
@@ -7,7 +7,7 @@ from pychpp.models.ht_model import HTModel
7
7
 
8
8
  class RequestMatchLineup(HTModel):
9
9
  """
10
- Request arguments for Match Lineup
10
+ Match Lineup - Request arguments
11
11
  """
12
12
  SOURCE_FILE = 'matchlineup'
13
13
  LAST_VERSION = '2.1'
@@ -8,7 +8,7 @@ from pychpp.models.ht_model import HTModel
8
8
 
9
9
  class RequestMatchesArchive(HTModel):
10
10
  """
11
- Request arguments for Matches Archive
11
+ Matches Archive - Request arguments
12
12
  """
13
13
  SOURCE_FILE = 'matchesarchive'
14
14
  LAST_VERSION = '1.5'
@@ -5,16 +5,20 @@ from pychpp.models.ht_init_var import HTInitVar
5
5
  from pychpp.models.ht_model import HTModel
6
6
 
7
7
 
8
- class NationalTeamDetails(HTModel):
8
+ class RequestNationalTeamDetails(HTModel):
9
9
  """
10
- National Team Details
10
+ National Team Details - Request arguments
11
11
  """
12
-
13
12
  SOURCE_FILE = 'nationalteamdetails'
14
13
  LAST_VERSION = '1.9'
15
14
 
16
15
  _r_team_id: int = HTInitVar('teamID', init_arg='team_id')
17
16
 
17
+
18
+ class NationalTeamDetails(RequestNationalTeamDetails):
19
+ """
20
+ National Team Details
21
+ """
18
22
  user_supporter_tier: str = HTField('UserSupporterTier')
19
23
  is_playing_match: bool = HTField('IsPlayingMatch')
20
24
  id: int = HTField('Team/TeamID')
@@ -5,9 +5,9 @@ from pychpp.models.ht_init_var import HTInitVar
5
5
  from pychpp.models.ht_model import HTModel
6
6
 
7
7
 
8
- class NationalTeams(HTModel):
8
+ class RequestNationalTeams(HTModel):
9
9
  """
10
- National Teams
10
+ National Teams - Request arguments
11
11
  """
12
12
  SOURCE_FILE = 'nationalteams'
13
13
  LAST_VERSION = '1.6'
@@ -15,6 +15,11 @@ class NationalTeams(HTModel):
15
15
  _r_league_office_type_id: int = HTInitVar('LeagueOfficeTypeID',
16
16
  init_arg='league_office_type_id')
17
17
 
18
+
19
+ class NationalTeams(RequestNationalTeams):
20
+ """
21
+ National Teams
22
+ """
18
23
  user_supporter_tier: str = HTField('UserSupporterTier')
19
24
  league_office_type_id: int = HTField('LeagueOfficeTypeID')
20
25
  national_teams: List['NationalTeamItem'] = HTField('NationalTeams', items='NationalTeam')
@@ -6,11 +6,10 @@ from pychpp.models.ht_init_var import HTInitVar
6
6
  from pychpp.models.ht_model import HTModel
7
7
 
8
8
 
9
- class PlayerDetails(HTModel):
9
+ class RequestPlayerDetails(HTModel):
10
10
  """
11
- Player Details
11
+ Player Details - Request arguments
12
12
  """
13
-
14
13
  SOURCE_FILE = 'playerdetails'
15
14
  LAST_VERSION = '3.0'
16
15
 
@@ -22,6 +21,11 @@ class PlayerDetails(HTModel):
22
21
  _r_bid_amount: Optional[int] = HTInitVar('bidAmount', init_arg='bid_amount')
23
22
  _r_max_bid_amount: Optional[int] = HTInitVar('maxBidAmount', init_arg='max_bid_amount')
24
23
 
24
+
25
+ class PlayerDetails(RequestPlayerDetails):
26
+ """
27
+ Player Details
28
+ """
25
29
  XML_PREFIX = 'Player/'
26
30
 
27
31
  user_supporter_tier: str = HTField('../UserSupporterTier')
@@ -8,7 +8,7 @@ from pychpp.models.ht_model import HTModel
8
8
 
9
9
  class RequestPlayers(HTModel):
10
10
  """
11
- Players - Request args
11
+ Players - Request arguments
12
12
  """
13
13
  SOURCE_FILE = 'players'
14
14
  LAST_VERSION = '2.6'
@@ -7,7 +7,7 @@ from pychpp.models.ht_model import HTModel
7
7
 
8
8
  class RequestRegionDetails(HTModel):
9
9
  """
10
- Request arguments for Region Details
10
+ Region Details - Request arguments
11
11
  """
12
12
  SOURCE_FILE = 'regiondetails'
13
13
  LAST_VERSION = '1.2'
@@ -4,13 +4,13 @@ from typing import List, Optional
4
4
  from pychpp.models.ht_model import HTField, HTInitVar, HTModel
5
5
 
6
6
 
7
- class BaseTeamDetails(HTModel):
7
+ class RequestTeamDetails(HTModel):
8
8
  """
9
- Base Team Details
9
+ Team Details - Request arguments
10
10
  """
11
11
 
12
- SOURCE_FILE = "teamdetails"
13
- LAST_VERSION = "3.6"
12
+ SOURCE_FILE = 'teamdetails'
13
+ LAST_VERSION = '3.7'
14
14
 
15
15
  _r_team_id: Optional[int] = HTInitVar('teamID', init_arg='team_id')
16
16
  _r_user_id: Optional[int] = HTInitVar('userID', init_arg='user_id')
@@ -21,7 +21,7 @@ class BaseTeamDetails(HTModel):
21
21
  init_arg='include_supporters')
22
22
 
23
23
 
24
- class TeamDetails(BaseTeamDetails):
24
+ class TeamDetails(RequestTeamDetails):
25
25
  """
26
26
  Team Details
27
27
  """
@@ -73,6 +73,7 @@ class TeamItem(HTModel):
73
73
  short_name: str = HTField('ShortTeamName')
74
74
  is_primary_club: bool = HTField('IsPrimaryClub')
75
75
  founded_date: datetime = HTField('FoundedDate')
76
+ is_deactivated: bool = HTField('IsDeactivated', version='>=3.7')
76
77
  arena: 'TeamItemArena' = HTField('Arena')
77
78
  league: 'TeamItemLeague' = HTField('League')
78
79
  country: 'TeamItemCountry' = HTField('Country')
@@ -6,7 +6,7 @@ from pychpp.models.ht_init_var import HTInitVar
6
6
  from pychpp.models.ht_model import HTModel
7
7
 
8
8
 
9
- class BaseTraining(HTModel):
9
+ class BaseRequestTraining(HTModel):
10
10
  """
11
11
  Base Training
12
12
  """
@@ -17,14 +17,14 @@ class BaseTraining(HTModel):
17
17
  _r_team_id: int = HTInitVar('teamId', init_arg='team_id')
18
18
 
19
19
 
20
- class BaseTrainingView(HTModel):
20
+ class RequestTrainingView(HTModel):
21
21
  """
22
22
  Base Training - View
23
23
  """
24
24
  _r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
25
25
 
26
26
 
27
- class BaseTrainingSetTraining(HTModel):
27
+ class RequestTrainingSetTraining(HTModel):
28
28
  """
29
29
  Base Training - Set training
30
30
  """
@@ -34,11 +34,10 @@ class BaseTrainingSetTraining(HTModel):
34
34
  init_arg='training_level_stamina')
35
35
 
36
36
 
37
- class CommonTrainingViewSetTraining(BaseTraining):
37
+ class CommonTrainingViewSetTraining(BaseRequestTraining):
38
38
  """
39
39
  Training View or Set Training
40
40
  """
41
-
42
41
  XML_PREFIX = 'Team/'
43
42
 
44
43
  user_supporter_tier: str = HTField('../UserSupporterTier')
@@ -107,28 +106,31 @@ class Experience(HTModel):
107
106
  _253: int = HTField('Experience253')
108
107
 
109
108
 
110
- class TrainingView(CommonTrainingViewSetTraining,
111
- BaseTraining):
109
+ class TrainingView(CommonTrainingViewSetTraining):
112
110
  """
113
111
  Training - View
114
112
  """
115
113
  pass
116
114
 
117
115
 
118
- class TrainingSetTraining(CommonTrainingViewSetTraining,
119
- BaseTraining):
116
+ class TrainingSetTraining(CommonTrainingViewSetTraining):
120
117
  """
121
118
  Training - Set training
122
119
  """
123
120
  training_set: bool = HTField('TrainingSet')
124
121
 
125
122
 
126
- class TrainingStats(BaseTraining):
123
+ class RequestTrainingStats(BaseRequestTraining):
127
124
  """
128
- Training - Stats
125
+ Training - Stats - Request arguments
129
126
  """
130
127
  _r_league_id: int = HTInitVar('leagueID', init_arg='league_id')
131
128
 
129
+
130
+ class TrainingStats(RequestTrainingStats):
131
+ """
132
+ Training - Stats
133
+ """
132
134
  league_id: int = HTField('LeagueID')
133
135
  league_name: str = HTField('LeagueName')
134
136
  training_stats: List['TrainingStatItem'] = HTField('TrainingStatList')
@@ -6,11 +6,10 @@ from pychpp.models.ht_init_var import HTInitVar
6
6
  from pychpp.models.ht_model import HTModel
7
7
 
8
8
 
9
- class BaseWorldCup(HTModel):
9
+ class RequestBaseWorldCup(HTModel):
10
10
  """
11
- BaseWorld Cup
11
+ Base World Cup - Request arguments
12
12
  """
13
-
14
13
  SOURCE_FILE = 'worldcup'
15
14
  LAST_VERSION = '1.1'
16
15
 
@@ -18,18 +17,28 @@ class BaseWorldCup(HTModel):
18
17
  _r_cup_id: Optional[int] = HTInitVar('cupID', init_arg='cup_id')
19
18
  _r_season: int = HTInitVar('season', init_arg='season')
20
19
 
20
+
21
+ class BaseWorldCup(RequestBaseWorldCup):
22
+ """
23
+ Base World Cup
24
+ """
21
25
  cup_id: int = HTField('CupID')
22
26
  season: int = HTField('Season')
23
27
  match_round: int = HTField('MatchRound')
24
28
 
25
29
 
26
- class WorldCupViewMatches(BaseWorldCup):
30
+ class RequestWorldCupViewMatches(RequestBaseWorldCup):
27
31
  """
28
- World Cup - View matches
32
+ World Cup - View matches - Request arguments
29
33
  """
30
34
  _r_match_round: Optional[int] = HTInitVar('matchRound', init_arg='match_round')
31
35
  _r_cup_series_unit_id: int = HTInitVar('cupSeriesUnitID', init_arg='cup_series_unit_id')
32
36
 
37
+
38
+ class WorldCupViewMatches(RequestWorldCupViewMatches, BaseWorldCup):
39
+ """
40
+ World Cup - View matches
41
+ """
33
42
  cup_series_unit_id: int = HTField('CupSeriesUnitID')
34
43
  matches: Optional[List['ViewMatchesMatchItem']] = HTField('Matches', items='Match')
35
44
  rounds: List['ViewMatchesRoundItem'] = HTField('Rounds', items='Round')
@@ -64,7 +73,13 @@ class ViewMatchesRoundItem(HTModel):
64
73
  start_date: datetime = HTField('StartDate')
65
74
 
66
75
 
67
- class WorldCupViewGroups(BaseWorldCup):
76
+ class RequestWorldCupViewGroups(RequestBaseWorldCup):
77
+ """
78
+ World Cup - View groups - Request arguments
79
+ """
80
+
81
+
82
+ class WorldCupViewGroups(RequestWorldCupViewGroups, BaseWorldCup):
68
83
  """
69
84
  World Cup - View groups
70
85
  """
@@ -8,7 +8,7 @@ from pychpp.models.ht_model import HTModel
8
8
 
9
9
  class RequestWorldDetails(HTModel):
10
10
  """
11
- Request arguments for world details
11
+ World Details - Request arguments
12
12
  """
13
13
  SOURCE_FILE = 'worlddetails'
14
14
  LAST_VERSION = '1.9'
@@ -8,7 +8,7 @@ from pychpp.models.ht_model import HTModel
8
8
 
9
9
  class RequestYouthPlayerDetails(HTModel):
10
10
  """
11
- Requests args for Youth Player Details
11
+ Youth Player Details - Request arguments
12
12
  """
13
13
  SOURCE_FILE = 'youthplayerdetails'
14
14
  LAST_VERSION = '1.2'
@@ -8,7 +8,7 @@ from pychpp.models.ht_model import HTModel
8
8
 
9
9
  class RequestYouthPlayerList(HTModel):
10
10
  """
11
- Youth Player List - Request args
11
+ Youth Player List - Request arguments
12
12
  """
13
13
  SOURCE_FILE = 'youthplayerlist'
14
14
  LAST_VERSION = '1.2'
@@ -6,9 +6,9 @@ from pychpp.models.ht_init_var import HTInitVar
6
6
  from pychpp.models.ht_model import HTModel
7
7
 
8
8
 
9
- class BaseYouthTeamDetails(HTModel):
9
+ class RequestYouthTeamDetails(HTModel):
10
10
  """
11
- Base Youth Team Details
11
+ Youth Team Details - Request arguments
12
12
  """
13
13
  SOURCE_FILE = 'youthteamdetails'
14
14
  LAST_VERSION = '1.2'
@@ -19,7 +19,7 @@ class BaseYouthTeamDetails(HTModel):
19
19
  XML_PREFIX = 'YouthTeam/'
20
20
 
21
21
 
22
- class YouthTeamDetails(BaseYouthTeamDetails):
22
+ class YouthTeamDetails(RequestYouthTeamDetails):
23
23
  """
24
24
  Youth Team Details
25
25
  """
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pychpp"
3
- version = "0.4.0b1"
3
+ version = "0.4.0b2"
4
4
  description = "framework created to use the API provided by the online game Hattrick"
5
5
  license = "Apache-2.0"
6
6
  authors = ["Pierre Gobin <p.dev@gobin.cc>"]
File without changes
File without changes