pychpp 0.4.4__tar.gz → 0.4.5__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.
- {pychpp-0.4.4 → pychpp-0.4.5}/PKG-INFO +41 -39
- {pychpp-0.4.4 → pychpp-0.4.5}/README.md +40 -38
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/chpp.py +24 -1
- pychpp-0.4.5/pychpp/models/xml/live.py +108 -0
- pychpp-0.4.5/pychpp/models/xml/matches.py +82 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pyproject.toml +1 -1
- {pychpp-0.4.4 → pychpp-0.4.5}/LICENSE +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/__init__.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/fixtures/__init__.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/fixtures/ht_datetime.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/fixtures/ht_error.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/__init__.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/__init__.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/__init__.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_arena.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_country.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_league.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_league_unit.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_match.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_player.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_region.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_team.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/base/ht_user.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_arena.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_challenge.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_league.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_league_unit.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_match.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_match_lineup.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_matches_archive.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_player.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_region.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_team.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_transfer_history.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_user.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_youth_player.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/custom/ht_youth_team.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/ht_field.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/ht_init_var.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/ht_model.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/ht_version.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/ht_xml.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/__init__.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/achievements.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/alliance_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/alliances.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/arena_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/avatars.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/bookmarks.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/challenges.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/club.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/cup_matches.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/current_bids.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/economy.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/fans.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/hof_players.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/ladder_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/ladder_list.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/league_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/league_fixtures.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/league_levels.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/manager_compendium.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/match_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/match_lineup.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/matches_archive.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/national_team_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/national_teams.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/player_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/players.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/region_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/team_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/training.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/transfers_team.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/world_cup.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/world_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/youth_player_details.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/youth_player_list.py +0 -0
- {pychpp-0.4.4 → pychpp-0.4.5}/pychpp/models/xml/youth_team_details.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pychpp
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.5
|
|
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
|
|
@@ -165,47 +165,49 @@ Then, to use this new class:
|
|
|
165
165
|
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.
|
|
166
166
|
|
|
167
167
|
## List of supported CHPP XML files
|
|
168
|
-

|
|
169
169
|
|
|
170
170
|
The following table shows the CHPP XML files that are currently supported:
|
|
171
171
|
|
|
172
|
-
|
|
|
173
|
-
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
172
|
+
| pyCHPP class | CHPP XML files |
|
|
173
|
+
|:-------------------:|:-------------------------:|
|
|
174
|
+
| Achievements | `achievements.xml` |
|
|
175
|
+
| Alliances | `alliances.xml` |
|
|
176
|
+
| AllianceDetails | `alliancedetails.xml` |
|
|
177
|
+
| Arena | `arenadetails.xml` |
|
|
178
|
+
| Avatars | `avatars.xml` |
|
|
179
|
+
| Bookmarks | `bookmarks.xml` |
|
|
180
|
+
| Challenges | `challenges.xml` |
|
|
181
|
+
| Club | `club.xml` |
|
|
182
|
+
| CupMatches | `cupmatches.xml` |
|
|
183
|
+
| CurrentBids | `currentbids.xml` |
|
|
184
|
+
| Economy | `economy.xml` |
|
|
185
|
+
| Fans | `fans.xml` |
|
|
186
|
+
| HallOfFamePlayers | `hofplayers.xml` |
|
|
187
|
+
| LadderDetails | `ladderdetails.xml` |
|
|
188
|
+
| LadderList | `ladderlist.xml` |
|
|
189
|
+
| LeagueDetails | `leaguedetails.xml` |
|
|
190
|
+
| LeagueFixtures | `leaguefixtures.xml` |
|
|
191
|
+
| LeagueLevels | `leaguelevels.xml` |
|
|
192
|
+
| Live | `live.xml` |
|
|
193
|
+
| ManagerCompendium | `managercompendium.xml` |
|
|
194
|
+
| MatchDetails | `matchdetails.xml` |
|
|
195
|
+
| MatchLineup | `matchlineup.xml` |
|
|
196
|
+
| MatchesArchive | `matchesarchive.xml` |
|
|
197
|
+
| Matches | `matches.xml` |
|
|
198
|
+
| NationalTeamDetails | `nationalteamdetails.xml` |
|
|
199
|
+
| NationalTeams | `nationalteams.xml` |
|
|
200
|
+
| PlayerDetails | `playerdetails.xml` |
|
|
201
|
+
| Players | `players.xml` |
|
|
202
|
+
| RegionDetails | `regiondetails.xml` |
|
|
203
|
+
| TeamDetails | `teamdetails.xml` |
|
|
204
|
+
| Training | `training.xml` |
|
|
205
|
+
| TransfersTeam | `transfersteam.xml` |
|
|
206
|
+
| WorldCup | `worldcup.xml` |
|
|
207
|
+
| WorldDetails | `worlddetails.xml` |
|
|
208
|
+
| YouthPlayerDetails | `youthplayerdetails.xml` |
|
|
209
|
+
| YouthPlayerList | `youthplayerlist.xml` |
|
|
210
|
+
| YouthTeamDetails | `youthteamdetails.xml` |
|
|
209
211
|
|
|
210
212
|
## License
|
|
211
213
|
pyCHPP is licensed under the Apache License 2.0.
|
|
@@ -143,47 +143,49 @@ 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
|
-

|
|
147
147
|
|
|
148
148
|
The following table shows the CHPP XML files that are currently supported:
|
|
149
149
|
|
|
150
|
-
|
|
|
151
|
-
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
|
|
|
182
|
-
|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
150
|
+
| pyCHPP class | CHPP XML files |
|
|
151
|
+
|:-------------------:|:-------------------------:|
|
|
152
|
+
| Achievements | `achievements.xml` |
|
|
153
|
+
| Alliances | `alliances.xml` |
|
|
154
|
+
| AllianceDetails | `alliancedetails.xml` |
|
|
155
|
+
| Arena | `arenadetails.xml` |
|
|
156
|
+
| Avatars | `avatars.xml` |
|
|
157
|
+
| Bookmarks | `bookmarks.xml` |
|
|
158
|
+
| Challenges | `challenges.xml` |
|
|
159
|
+
| Club | `club.xml` |
|
|
160
|
+
| CupMatches | `cupmatches.xml` |
|
|
161
|
+
| CurrentBids | `currentbids.xml` |
|
|
162
|
+
| Economy | `economy.xml` |
|
|
163
|
+
| Fans | `fans.xml` |
|
|
164
|
+
| HallOfFamePlayers | `hofplayers.xml` |
|
|
165
|
+
| LadderDetails | `ladderdetails.xml` |
|
|
166
|
+
| LadderList | `ladderlist.xml` |
|
|
167
|
+
| LeagueDetails | `leaguedetails.xml` |
|
|
168
|
+
| LeagueFixtures | `leaguefixtures.xml` |
|
|
169
|
+
| LeagueLevels | `leaguelevels.xml` |
|
|
170
|
+
| Live | `live.xml` |
|
|
171
|
+
| ManagerCompendium | `managercompendium.xml` |
|
|
172
|
+
| MatchDetails | `matchdetails.xml` |
|
|
173
|
+
| MatchLineup | `matchlineup.xml` |
|
|
174
|
+
| MatchesArchive | `matchesarchive.xml` |
|
|
175
|
+
| Matches | `matches.xml` |
|
|
176
|
+
| NationalTeamDetails | `nationalteamdetails.xml` |
|
|
177
|
+
| NationalTeams | `nationalteams.xml` |
|
|
178
|
+
| PlayerDetails | `playerdetails.xml` |
|
|
179
|
+
| Players | `players.xml` |
|
|
180
|
+
| RegionDetails | `regiondetails.xml` |
|
|
181
|
+
| TeamDetails | `teamdetails.xml` |
|
|
182
|
+
| Training | `training.xml` |
|
|
183
|
+
| TransfersTeam | `transfersteam.xml` |
|
|
184
|
+
| WorldCup | `worldcup.xml` |
|
|
185
|
+
| WorldDetails | `worlddetails.xml` |
|
|
186
|
+
| YouthPlayerDetails | `youthplayerdetails.xml` |
|
|
187
|
+
| YouthPlayerList | `youthplayerlist.xml` |
|
|
188
|
+
| YouthTeamDetails | `youthteamdetails.xml` |
|
|
187
189
|
|
|
188
190
|
## License
|
|
189
191
|
pyCHPP is licensed under the Apache License 2.0.
|
|
@@ -13,7 +13,8 @@ from pychpp.models.xml import (manager_compendium, team_details, achievements, a
|
|
|
13
13
|
youth_player_details, youth_team_details, youth_player_list,
|
|
14
14
|
matches_archive, match_details, cup_matches, alliances,
|
|
15
15
|
alliance_details, avatars, bookmarks, club, current_bids, economy,
|
|
16
|
-
fans, hof_players, ladder_details, ladder_list, league_levels
|
|
16
|
+
fans, hof_players, ladder_details, ladder_list, league_levels, live,
|
|
17
|
+
matches)
|
|
17
18
|
from pychpp.models.custom import (ht_team, ht_arena, ht_user, ht_region, ht_youth_team, ht_player,
|
|
18
19
|
ht_league_unit, ht_youth_player, ht_league, ht_matches_archive,
|
|
19
20
|
ht_match, ht_challenge, ht_match_lineup, ht_transfer_history)
|
|
@@ -640,6 +641,20 @@ class CHPPXml(CHPPBase):
|
|
|
640
641
|
chpp=self, league_id=league_id, **kwargs,
|
|
641
642
|
)
|
|
642
643
|
|
|
644
|
+
def xml_live(
|
|
645
|
+
self, action_type: str = 'view', match_id: int = None,
|
|
646
|
+
source_system: str = 'hattrick', include_starting_lineup: bool = False,
|
|
647
|
+
use_live_events_and_texts: bool = False, last_shown_indexes: str = None,
|
|
648
|
+
**kwargs,
|
|
649
|
+
) -> live.Live:
|
|
650
|
+
|
|
651
|
+
return live.Live(
|
|
652
|
+
chpp=self, action_type=action_type, match_id=match_id,
|
|
653
|
+
source_system=source_system, include_starting_lineup=include_starting_lineup,
|
|
654
|
+
use_live_events_and_texts=use_live_events_and_texts,
|
|
655
|
+
last_shown_indexes=last_shown_indexes, **kwargs,
|
|
656
|
+
)
|
|
657
|
+
|
|
643
658
|
def xml_manager_compendium(
|
|
644
659
|
self, user_id: int = None, **kwargs,
|
|
645
660
|
) -> manager_compendium.ManagerCompendium:
|
|
@@ -668,6 +683,14 @@ class CHPPXml(CHPPBase):
|
|
|
668
683
|
source_system=source_system, **kwargs,
|
|
669
684
|
)
|
|
670
685
|
|
|
686
|
+
def xml_matches(
|
|
687
|
+
self, team_id: int = None, is_youth: bool = None, **kwargs,
|
|
688
|
+
) -> matches.Matches:
|
|
689
|
+
|
|
690
|
+
return matches.Matches(
|
|
691
|
+
chpp=self, team_id=team_id, is_youth=is_youth, **kwargs,
|
|
692
|
+
)
|
|
693
|
+
|
|
671
694
|
def xml_matches_archive(
|
|
672
695
|
self, team_id: int = None, is_youth: bool = None,
|
|
673
696
|
first_match_date: datetime = None, last_match_date: datetime = None,
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
|
|
4
|
+
from pychpp.models.ht_field import HTField
|
|
5
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
6
|
+
from pychpp.models.ht_model import HTModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RequestLive(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Live - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'live'
|
|
14
|
+
LAST_VERSION = '2.3'
|
|
15
|
+
|
|
16
|
+
_r_action_type: Optional[str] = HTInitVar('actionType', init_arg='action_type')
|
|
17
|
+
_r_match_id: Optional[int] = HTInitVar('matchID', init_arg='match_id')
|
|
18
|
+
_r_source_system: Optional[str] = HTInitVar('sourceSystem', init_arg='source_system')
|
|
19
|
+
_r_include_starting_lineup: Optional[bool] = HTInitVar('includeStartingLineup',
|
|
20
|
+
init_arg='include_starting_lineup')
|
|
21
|
+
_r_use_live_events_and_textx: Optional[bool] = HTInitVar('useLiveEventsAndTexts',
|
|
22
|
+
init_arg='use_live_events_and_texts')
|
|
23
|
+
_r_last_shown_indexes: Optional[str] = HTInitVar('lastShownIndexes',
|
|
24
|
+
init_arg='last_shown_indexes')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Live(RequestLive):
|
|
28
|
+
"""
|
|
29
|
+
Live
|
|
30
|
+
"""
|
|
31
|
+
matches: Optional[List['MatchItem']] = HTField('MatchList', items='Match')
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class MatchItem(HTModel):
|
|
35
|
+
"""
|
|
36
|
+
Live -> Matches -> Match item
|
|
37
|
+
"""
|
|
38
|
+
id: int = HTField('MatchID')
|
|
39
|
+
type: int = HTField('MatchType')
|
|
40
|
+
source_system: str = HTField('SourceSystem')
|
|
41
|
+
date: datetime = HTField('MatchDate')
|
|
42
|
+
home_team: 'HomeTeam' = HTField('HomeTeam')
|
|
43
|
+
away_team: 'AwayTeam' = HTField('AwayTeam')
|
|
44
|
+
substitutions: Optional[List['SubstitutionItem']] = HTField('Substitutions',
|
|
45
|
+
items='Substitution')
|
|
46
|
+
events: List['EventItem'] = HTField('EventList', items='Event')
|
|
47
|
+
home_goals: int = HTField('HomeGoals')
|
|
48
|
+
away_goals: int = HTField('AwayGoals')
|
|
49
|
+
last_shown_event_index: int = HTField('LastShownEventIndex')
|
|
50
|
+
next_event_minute: int = HTField('NextEventMinute')
|
|
51
|
+
next_event_match_part: int = HTField('NextEventMatchPart')
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class HomeTeam(HTModel):
|
|
55
|
+
"""
|
|
56
|
+
Live -> Matches -> Match item -> Home team
|
|
57
|
+
"""
|
|
58
|
+
id: int = HTField('HomeTeamID')
|
|
59
|
+
name: str = HTField('HomeTeamName')
|
|
60
|
+
short_name: str = HTField('HomeTeamShortName')
|
|
61
|
+
starting_lineup: Optional[List['PlayerItem']] = HTField('StartingLineup', items='Player')
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class AwayTeam(HTModel):
|
|
65
|
+
"""
|
|
66
|
+
Live -> Matches -> Match item -> Away team
|
|
67
|
+
"""
|
|
68
|
+
id: int = HTField('AwayTeamID')
|
|
69
|
+
name: str = HTField('AwayTeamName')
|
|
70
|
+
short_name: str = HTField('AwayTeamShortName')
|
|
71
|
+
starting_lineup: Optional[List['PlayerItem']] = HTField('StartingLineup', items='Player')
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class PlayerItem(HTModel):
|
|
75
|
+
"""
|
|
76
|
+
Live -> Matches -> Match item -> Home/Away team -> Starting Lineup -> Player item
|
|
77
|
+
"""
|
|
78
|
+
id: int = HTField('PlayerID')
|
|
79
|
+
role_id: int = HTField('RoleID')
|
|
80
|
+
name: str = HTField('PlayerName')
|
|
81
|
+
behaviour: Optional[int] = HTField('Behaviour')
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class SubstitutionItem(HTModel):
|
|
85
|
+
"""
|
|
86
|
+
Live -> Matches -> Match item -> Substitutions -> Substitution item
|
|
87
|
+
"""
|
|
88
|
+
team_id: int = HTField('TeamID')
|
|
89
|
+
subject_player_id: int = HTField('SubjectPlayerID')
|
|
90
|
+
object_player_id: int = HTField('ObjectPlayerID')
|
|
91
|
+
order_type: int = HTField('OrderType')
|
|
92
|
+
new_position_id: int = HTField('NewPositionId')
|
|
93
|
+
new_position_behaviour: int = HTField('NewPositionBehaviour')
|
|
94
|
+
match_minute: int = HTField('MatchMinute')
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class EventItem(HTModel):
|
|
98
|
+
"""
|
|
99
|
+
Live -> Matches -> Match item -> Event -> Event item
|
|
100
|
+
"""
|
|
101
|
+
index: int = HTField('.', attrib='Index')
|
|
102
|
+
minute: int = HTField('Minute')
|
|
103
|
+
match_part: int = HTField('MatchPart')
|
|
104
|
+
key: str = HTField('EventKey')
|
|
105
|
+
text: str = HTField('EventText')
|
|
106
|
+
subject_team_id: int = HTField('SubjectTeamID')
|
|
107
|
+
subject_player_id: int = HTField('SubjectPlayerID')
|
|
108
|
+
object_player_id: int = HTField('ObjectPlayerID')
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
|
|
4
|
+
from pychpp.models.ht_field import HTField
|
|
5
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
6
|
+
from pychpp.models.ht_model import HTModel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RequestMatches(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Matches - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'matches'
|
|
14
|
+
LAST_VERSION = '2.9'
|
|
15
|
+
|
|
16
|
+
_r_team_id: Optional[int] = HTInitVar('teamID', init_arg='team_id')
|
|
17
|
+
_r_is_youth: Optional[bool] = HTInitVar('isYouth', init_arg='is_youth')
|
|
18
|
+
_r_last_match_date: Optional[datetime] = HTInitVar('LastMatchDate', init_arg='last_match_date')
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Matches(RequestMatches):
|
|
22
|
+
"""
|
|
23
|
+
Matches
|
|
24
|
+
"""
|
|
25
|
+
team: 'Team' = HTField('Team')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Team(HTModel):
|
|
29
|
+
"""
|
|
30
|
+
Matches -> Team
|
|
31
|
+
"""
|
|
32
|
+
id: int = HTField('TeamID')
|
|
33
|
+
name: str = HTField('TeamName')
|
|
34
|
+
short_name: str = HTField('ShortTeamName')
|
|
35
|
+
league: 'League' = HTField('League')
|
|
36
|
+
league_level_unit: 'LeagueLevelUnit' = HTField('LeagueLevelUnit')
|
|
37
|
+
matches: Optional[List['MatchItem']] = HTField('MatchList', items='Match')
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class League(HTModel):
|
|
41
|
+
"""
|
|
42
|
+
Matches -> Team -> League
|
|
43
|
+
"""
|
|
44
|
+
id: int = HTField('LeagueID')
|
|
45
|
+
name: str = HTField('LeagueName')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class LeagueLevelUnit(HTModel):
|
|
49
|
+
"""
|
|
50
|
+
Matches -> Team -> League -> League Level Unit
|
|
51
|
+
"""
|
|
52
|
+
id: int = HTField('LeagueLevelUnitID')
|
|
53
|
+
name: str = HTField('LeagueLevelUnitName')
|
|
54
|
+
level: int = HTField('LeagueLevel')
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class MatchItem(HTModel):
|
|
58
|
+
"""
|
|
59
|
+
Matches -> Team -> Matches -> Match item
|
|
60
|
+
"""
|
|
61
|
+
id: int = HTField('MatchID')
|
|
62
|
+
home_team: 'MatchItemTeam' = HTField('HomeTeam', xml_prefix='Home')
|
|
63
|
+
away_team: 'MatchItemTeam' = HTField('AwayTeam', xml_prefix='Away')
|
|
64
|
+
date: datetime = HTField('MatchDate')
|
|
65
|
+
source_system: str = HTField('SourceSystem')
|
|
66
|
+
type: int = HTField('MatchType')
|
|
67
|
+
context_id: int = HTField('MatchContextId')
|
|
68
|
+
cup_level: int = HTField('CupLevel')
|
|
69
|
+
cup_level_index: int = HTField('CupLevelIndex')
|
|
70
|
+
home_goals: Optional[int] = HTField('HomeGoals')
|
|
71
|
+
away_goals: Optional[int] = HTField('AwayGoals')
|
|
72
|
+
status: str = HTField('Status')
|
|
73
|
+
orders_given: Optional[bool] = HTField('OrdersGiven')
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class MatchItemTeam(HTModel):
|
|
77
|
+
"""
|
|
78
|
+
Matches -> Team -> Matches -> Match item -> Home/Away team
|
|
79
|
+
"""
|
|
80
|
+
id: int = HTField('TeamID')
|
|
81
|
+
name: str = HTField('TeamName')
|
|
82
|
+
short_name: str = HTField('TeamNameShortName')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|