pychpp 0.4.1__tar.gz → 0.4.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.
- {pychpp-0.4.1 → pychpp-0.4.2}/PKG-INFO +14 -7
- {pychpp-0.4.1 → pychpp-0.4.2}/README.md +13 -6
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/chpp.py +51 -1
- pychpp-0.4.2/pychpp/models/xml/bookmarks.py +36 -0
- pychpp-0.4.2/pychpp/models/xml/club.py +54 -0
- pychpp-0.4.2/pychpp/models/xml/current_bids.py +62 -0
- pychpp-0.4.2/pychpp/models/xml/economy.py +66 -0
- pychpp-0.4.2/pychpp/models/xml/fans.py +74 -0
- pychpp-0.4.2/pychpp/models/xml/hof_players.py +40 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pyproject.toml +1 -1
- {pychpp-0.4.1 → pychpp-0.4.2}/LICENSE +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/__init__.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/fixtures/__init__.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/fixtures/ht_datetime.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/fixtures/ht_error.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/__init__.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/__init__.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/__init__.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_arena.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_country.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_league.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_league_unit.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_match.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_player.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_region.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_team.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/base/ht_user.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_arena.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_challenge.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_league.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_league_unit.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_match.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_match_lineup.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_matches_archive.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_player.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_region.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_team.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_transfer_history.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_user.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_youth_player.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/custom/ht_youth_team.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/ht_field.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/ht_init_var.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/ht_model.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/ht_version.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/ht_xml.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/__init__.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/achievements.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/alliance_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/alliances.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/arena_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/avatars.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/challenges.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/cup_matches.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/league_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/league_fixtures.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/manager_compendium.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/match_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/match_lineup.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/matches_archive.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/national_team_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/national_teams.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/player_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/players.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/region_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/team_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/training.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/transfers_team.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/world_cup.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/world_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/youth_player_details.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/pychpp/models/xml/youth_player_list.py +0 -0
- {pychpp-0.4.1 → pychpp-0.4.2}/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.2
|
|
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
|
|
@@ -134,14 +134,14 @@ However, for more advanced use, it is also possible to customize the framework's
|
|
|
134
134
|
|
|
135
135
|
For example, if you need to perform a query on the arenadetails.xml file, but in reality only need the Arena/ArenaID, Arena/ArenaName and Arena/ArenaImage data, one way to proceed is to create a custom class inheriting from the RequestArenaDetails class, and use HTProxyField as follows:
|
|
136
136
|
```python
|
|
137
|
-
from pychpp.models.xml.arena_details import
|
|
137
|
+
from pychpp.models.xml.arena_details import RequestArenaDetailsDefault, ArenaDetailsDefault
|
|
138
138
|
from pychpp.models.ht_field import HTProxyField
|
|
139
139
|
|
|
140
140
|
|
|
141
|
-
class MyCustomArenaClass(
|
|
142
|
-
id: int = HTProxyField(
|
|
143
|
-
name: str = HTProxyField(
|
|
144
|
-
image: str = HTProxyField(
|
|
141
|
+
class MyCustomArenaClass(RequestArenaDetailsDefault):
|
|
142
|
+
id: int = HTProxyField(ArenaDetailsDefault)
|
|
143
|
+
name: str = HTProxyField(ArenaDetailsDefault)
|
|
144
|
+
image: str = HTProxyField(ArenaDetailsDefault)
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
Then, to use this new class:
|
|
@@ -165,7 +165,7 @@ 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
|
|
|
@@ -175,8 +175,15 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
175
175
|
| Alliances | `alliances.xml` |
|
|
176
176
|
| AllianceDetails | `alliancedetails.xml` |
|
|
177
177
|
| Arena | `arenadetails.xml` |
|
|
178
|
+
| Avatars | `avatars.xml` |
|
|
179
|
+
| Bookmarks | `bookmarks.xml` |
|
|
178
180
|
| Challenges | `challenges.xml` |
|
|
181
|
+
| Club | `club.xml` |
|
|
179
182
|
| CupMatches | `cupmatches.xml` |
|
|
183
|
+
| CurrentBids | `currentbids.xml` |
|
|
184
|
+
| Economy | `economy.xml` |
|
|
185
|
+
| Fans | `fans.xml` |
|
|
186
|
+
| HallOfFamePlayers | `hofplayers.xml` |
|
|
180
187
|
| LeagueDetails | `leaguedetails.xml` |
|
|
181
188
|
| LeagueFixtures | `leaguefixtures.xml` |
|
|
182
189
|
| ManagerCompendium | `managercompendium.xml` |
|
|
@@ -112,14 +112,14 @@ However, for more advanced use, it is also possible to customize the framework's
|
|
|
112
112
|
|
|
113
113
|
For example, if you need to perform a query on the arenadetails.xml file, but in reality only need the Arena/ArenaID, Arena/ArenaName and Arena/ArenaImage data, one way to proceed is to create a custom class inheriting from the RequestArenaDetails class, and use HTProxyField as follows:
|
|
114
114
|
```python
|
|
115
|
-
from pychpp.models.xml.arena_details import
|
|
115
|
+
from pychpp.models.xml.arena_details import RequestArenaDetailsDefault, ArenaDetailsDefault
|
|
116
116
|
from pychpp.models.ht_field import HTProxyField
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
class MyCustomArenaClass(
|
|
120
|
-
id: int = HTProxyField(
|
|
121
|
-
name: str = HTProxyField(
|
|
122
|
-
image: str = HTProxyField(
|
|
119
|
+
class MyCustomArenaClass(RequestArenaDetailsDefault):
|
|
120
|
+
id: int = HTProxyField(ArenaDetailsDefault)
|
|
121
|
+
name: str = HTProxyField(ArenaDetailsDefault)
|
|
122
|
+
image: str = HTProxyField(ArenaDetailsDefault)
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
Then, to use this new class:
|
|
@@ -143,7 +143,7 @@ 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
|
|
|
@@ -153,8 +153,15 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
153
153
|
| Alliances | `alliances.xml` |
|
|
154
154
|
| AllianceDetails | `alliancedetails.xml` |
|
|
155
155
|
| Arena | `arenadetails.xml` |
|
|
156
|
+
| Avatars | `avatars.xml` |
|
|
157
|
+
| Bookmarks | `bookmarks.xml` |
|
|
156
158
|
| Challenges | `challenges.xml` |
|
|
159
|
+
| Club | `club.xml` |
|
|
157
160
|
| CupMatches | `cupmatches.xml` |
|
|
161
|
+
| CurrentBids | `currentbids.xml` |
|
|
162
|
+
| Economy | `economy.xml` |
|
|
163
|
+
| Fans | `fans.xml` |
|
|
164
|
+
| HallOfFamePlayers | `hofplayers.xml` |
|
|
158
165
|
| LeagueDetails | `leaguedetails.xml` |
|
|
159
166
|
| LeagueFixtures | `leaguefixtures.xml` |
|
|
160
167
|
| ManagerCompendium | `managercompendium.xml` |
|
|
@@ -12,7 +12,8 @@ from pychpp.models.xml import (manager_compendium, team_details, achievements, a
|
|
|
12
12
|
training, transfers_team, world_details, world_cup, players,
|
|
13
13
|
youth_player_details, youth_team_details, youth_player_list,
|
|
14
14
|
matches_archive, match_details, cup_matches, alliances,
|
|
15
|
-
alliance_details, avatars
|
|
15
|
+
alliance_details, avatars, bookmarks, club, current_bids, economy,
|
|
16
|
+
fans, hof_players)
|
|
16
17
|
from pychpp.models.custom import (ht_team, ht_arena, ht_user, ht_region, ht_youth_team, ht_player,
|
|
17
18
|
ht_league_unit, ht_youth_player, ht_league, ht_matches_archive,
|
|
18
19
|
ht_match, ht_challenge, ht_match_lineup, ht_transfer_history)
|
|
@@ -482,6 +483,17 @@ class CHPPXml(CHPPBase):
|
|
|
482
483
|
**kwargs,
|
|
483
484
|
)
|
|
484
485
|
|
|
486
|
+
def xml_bookmarks(
|
|
487
|
+
self, bookmark_type_id: int = None,
|
|
488
|
+
**kwargs,
|
|
489
|
+
) -> bookmarks.Bookmarks:
|
|
490
|
+
|
|
491
|
+
return bookmarks.Bookmarks(
|
|
492
|
+
chpp=self,
|
|
493
|
+
bookmark_type_id=bookmark_type_id,
|
|
494
|
+
**kwargs,
|
|
495
|
+
)
|
|
496
|
+
|
|
485
497
|
def xml_challenges(
|
|
486
498
|
self, action_type: str = 'view', team_id: Optional[int] = None,
|
|
487
499
|
is_weekend_friendly: int = 0, suggested_team_ids: str = None,
|
|
@@ -542,6 +554,11 @@ class CHPPXml(CHPPBase):
|
|
|
542
554
|
"'view', 'challengeable', 'challenge', "
|
|
543
555
|
"'accept', 'decline' or 'withdraw'")
|
|
544
556
|
|
|
557
|
+
def xml_club(self, team_id: int = None, **kwargs,
|
|
558
|
+
) -> club.Club:
|
|
559
|
+
|
|
560
|
+
return club.Club(chpp=self, team_id=team_id, **kwargs)
|
|
561
|
+
|
|
545
562
|
def xml_cup_matches(
|
|
546
563
|
self, cup_id: int, season: int = None, cup_round: int = None,
|
|
547
564
|
start_after_match_id: int = None, **kwargs,
|
|
@@ -552,6 +569,39 @@ class CHPPXml(CHPPBase):
|
|
|
552
569
|
start_after_match_id=start_after_match_id, **kwargs,
|
|
553
570
|
)
|
|
554
571
|
|
|
572
|
+
def xml_current_bids(
|
|
573
|
+
self,
|
|
574
|
+
action_type: str = 'view',
|
|
575
|
+
team_id: int = None,
|
|
576
|
+
transfer_id: int = None,
|
|
577
|
+
tracking_type_id: int = None,
|
|
578
|
+
**kwargs,
|
|
579
|
+
) -> current_bids.CurrentBids:
|
|
580
|
+
|
|
581
|
+
return current_bids.CurrentBids(
|
|
582
|
+
chpp=self,
|
|
583
|
+
action_type=action_type,
|
|
584
|
+
team_id=team_id,
|
|
585
|
+
transfer_id=transfer_id,
|
|
586
|
+
tracking_type_id=tracking_type_id,
|
|
587
|
+
**kwargs,
|
|
588
|
+
)
|
|
589
|
+
|
|
590
|
+
def xml_economy(self, team_id: int = None, **kwargs,
|
|
591
|
+
) -> economy.Economy:
|
|
592
|
+
|
|
593
|
+
return economy.Economy(chpp=self, team_id=team_id, **kwargs)
|
|
594
|
+
|
|
595
|
+
def xml_fans(self, team_id: int = None, **kwargs,
|
|
596
|
+
) -> fans.Fans:
|
|
597
|
+
|
|
598
|
+
return fans.Fans(chpp=self, team_id=team_id, **kwargs)
|
|
599
|
+
|
|
600
|
+
def xml_hof_players(self, team_id: int = None, **kwargs,
|
|
601
|
+
) -> hof_players.HallOfFamePlayers:
|
|
602
|
+
|
|
603
|
+
return hof_players.HallOfFamePlayers(chpp=self, team_id=team_id, **kwargs)
|
|
604
|
+
|
|
555
605
|
def xml_league_details(
|
|
556
606
|
self, league_level_unit_id: int = None, **kwargs,
|
|
557
607
|
) -> league_details.LeagueDetails:
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
|
|
3
|
+
from pychpp.models.ht_field import HTField
|
|
4
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
5
|
+
from pychpp.models.ht_model import HTModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RequestBookmarks(HTModel):
|
|
9
|
+
"""
|
|
10
|
+
Bookmarks - Request arguments
|
|
11
|
+
"""
|
|
12
|
+
SOURCE_FILE = 'bookmarks'
|
|
13
|
+
LAST_VERSION = '1.0'
|
|
14
|
+
|
|
15
|
+
_r_bookmark_type_id: Optional[int] = HTInitVar('bookmarkTypeID', init_arg='bookmark_type_id')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Bookmarks(RequestBookmarks):
|
|
19
|
+
"""
|
|
20
|
+
Bookmarks
|
|
21
|
+
"""
|
|
22
|
+
bookmark_list: List['BookmarkItem'] = HTField('BookmarkList', items='Bookmark')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class BookmarkItem(HTModel):
|
|
26
|
+
"""
|
|
27
|
+
Bookmarks -> Bookmark list -> Bookmark item
|
|
28
|
+
"""
|
|
29
|
+
id: str = HTField('BookmarkID')
|
|
30
|
+
type_id: int = HTField('BookmarkTypeID')
|
|
31
|
+
text: str = HTField('Text')
|
|
32
|
+
text_2: Optional[str] = HTField('Text2')
|
|
33
|
+
object_id: str = HTField('ObjectID')
|
|
34
|
+
object_id_2: Optional[str] = HTField('ObjectID2')
|
|
35
|
+
object_id_3: Optional[str] = HTField('ObjectID3')
|
|
36
|
+
comment: str = HTField('Comment')
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from pychpp.models.ht_field import HTField
|
|
4
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
5
|
+
from pychpp.models.ht_model import HTModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RequestClub(HTModel):
|
|
9
|
+
"""
|
|
10
|
+
Club - Request arguments
|
|
11
|
+
"""
|
|
12
|
+
SOURCE_FILE = 'club'
|
|
13
|
+
LAST_VERSION = '1.5'
|
|
14
|
+
|
|
15
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Club(RequestClub):
|
|
19
|
+
"""
|
|
20
|
+
Club
|
|
21
|
+
"""
|
|
22
|
+
team: 'Team' = HTField('Team')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Team(HTModel):
|
|
26
|
+
"""
|
|
27
|
+
Club -> Team
|
|
28
|
+
"""
|
|
29
|
+
id: int = HTField('TeamID')
|
|
30
|
+
name: str = HTField('TeamName')
|
|
31
|
+
staff: 'TeamStaff' = HTField('Staff')
|
|
32
|
+
youth_squad: 'TeamYouthSquad' = HTField('YouthSquad')
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class TeamStaff(HTModel):
|
|
36
|
+
"""
|
|
37
|
+
Club -> Team -> Staff
|
|
38
|
+
"""
|
|
39
|
+
assistant_trainer_levels: int = HTField('AssistantTrainerLevels')
|
|
40
|
+
financial_director_levels: int = HTField('FinancialDirectorLevels')
|
|
41
|
+
form_coach_levels: int = HTField('FormCoachLevels')
|
|
42
|
+
medic_levels: int = HTField('MedicLevels')
|
|
43
|
+
spokesperson_levels: int = HTField('SpokespersonLevels')
|
|
44
|
+
sport_psychologist_levels: int = HTField('SportPsychologistLevels')
|
|
45
|
+
tactical_assistant_levels: int = HTField('TacticalAssistantLevels')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class TeamYouthSquad(HTModel):
|
|
49
|
+
"""
|
|
50
|
+
Club -> Team -> Youth Squad
|
|
51
|
+
"""
|
|
52
|
+
investment: int = HTField('Investment')
|
|
53
|
+
has_promoted: bool = HTField('HasPromoted')
|
|
54
|
+
youth_level: int = HTField('YouthLevel')
|
|
@@ -0,0 +1,62 @@
|
|
|
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 RequestCurrentBids(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Current Bids - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'currentbids'
|
|
14
|
+
LAST_VERSION = '1.0'
|
|
15
|
+
|
|
16
|
+
_r_action_type: Optional[str] = HTInitVar('actionType', init_arg='action_type')
|
|
17
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
18
|
+
_r_transfer_id: Optional[int] = HTInitVar('transferId', init_arg='transfer_id')
|
|
19
|
+
_r_tracking_type_id: Optional[int] = HTInitVar('trackingTypeId', init_arg='tracking_type_id')
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class CurrentBids(RequestCurrentBids):
|
|
23
|
+
"""
|
|
24
|
+
Current Bids
|
|
25
|
+
"""
|
|
26
|
+
team_id: int = HTField('TeamId')
|
|
27
|
+
selling_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="1"]',
|
|
28
|
+
items='BidItem')
|
|
29
|
+
buying_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="2"]',
|
|
30
|
+
items='BidItem')
|
|
31
|
+
mother_club_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="3"]',
|
|
32
|
+
items='BidItem')
|
|
33
|
+
previous_team_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="4"]',
|
|
34
|
+
items='BidItem')
|
|
35
|
+
hot_listed_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="5"]',
|
|
36
|
+
items='BidItem')
|
|
37
|
+
losing_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="8"]',
|
|
38
|
+
items='BidItem')
|
|
39
|
+
finished_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="9"]',
|
|
40
|
+
items='BidItem')
|
|
41
|
+
prospects_bids: Optional[List['BidItem']] = HTField('BidItems[@TrackingTypeID="10"]',
|
|
42
|
+
items='BidItem')
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class BidItem(HTModel):
|
|
46
|
+
"""
|
|
47
|
+
Current Bids -> Bids -> Bid item
|
|
48
|
+
"""
|
|
49
|
+
transfer_id: int = HTField('TransferId')
|
|
50
|
+
player_id: int = HTField('PlayerId')
|
|
51
|
+
player_name: str = HTField('PlayerName')
|
|
52
|
+
highest_bid: 'HighestBid' = HTField('HighestBid')
|
|
53
|
+
deadline: datetime = HTField('Deadline')
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class HighestBid(HTModel):
|
|
57
|
+
"""
|
|
58
|
+
Current Bids -> Bids -> Bid item -> Highest Bid
|
|
59
|
+
"""
|
|
60
|
+
amount: int = HTField('Amount')
|
|
61
|
+
team_id: int = HTField('TeamId')
|
|
62
|
+
team_name: str = HTField('TeamName')
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from pychpp.models.ht_field import HTField
|
|
4
|
+
from pychpp.models.ht_init_var import HTInitVar
|
|
5
|
+
from pychpp.models.ht_model import HTModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RequestEconomy(HTModel):
|
|
9
|
+
"""
|
|
10
|
+
Economy - Request arguments
|
|
11
|
+
"""
|
|
12
|
+
SOURCE_FILE = 'economy'
|
|
13
|
+
LAST_VERSION = '1.4'
|
|
14
|
+
|
|
15
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Economy(RequestEconomy):
|
|
19
|
+
"""
|
|
20
|
+
Economy
|
|
21
|
+
"""
|
|
22
|
+
team: 'Team' = HTField('Team')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Team(HTModel):
|
|
26
|
+
"""
|
|
27
|
+
Economy -> Team
|
|
28
|
+
"""
|
|
29
|
+
id: int = HTField('TeamID')
|
|
30
|
+
name: str = HTField('TeamName')
|
|
31
|
+
cash: int = HTField('Cash')
|
|
32
|
+
expected_cash: int = HTField('ExpectedCash')
|
|
33
|
+
sponsors_popularity: Optional[int] = HTField('SponsorsPopularity')
|
|
34
|
+
supporters_popularity: Optional[int] = HTField('SupportersPopularity')
|
|
35
|
+
fan_club_size: int = HTField('FanClubSize')
|
|
36
|
+
income_spectators: int = HTField('IncomeSpectators')
|
|
37
|
+
income_sponsors: int = HTField('IncomeSponsors')
|
|
38
|
+
income_sponsors_bonus: int = HTField('IncomeSponsorBonuses')
|
|
39
|
+
income_financial: int = HTField('IncomeFinancial')
|
|
40
|
+
income_sold_players: int = HTField('IncomeSoldPlayers')
|
|
41
|
+
income_sold_players_commission: int = HTField('IncomeSoldPlayersCommission')
|
|
42
|
+
income_sum: int = HTField('IncomeSum')
|
|
43
|
+
costs_arena: int = HTField('CostsArena')
|
|
44
|
+
costs_players: int = HTField('CostsPlayers')
|
|
45
|
+
costs_financial: int = HTField('CostsFinancial')
|
|
46
|
+
costs_bought_players: int = HTField('CostsBoughtPlayers')
|
|
47
|
+
costs_arena_building: int = HTField('CostsArenaBuilding')
|
|
48
|
+
costs_staff: int = HTField('CostsStaff')
|
|
49
|
+
costs_youth: int = HTField('CostsYouth')
|
|
50
|
+
costs_sum: int = HTField('CostsSum')
|
|
51
|
+
expected_weeks_total: int = HTField('ExpectedWeeksTotal')
|
|
52
|
+
last_income_spectators: int = HTField('LastIncomeSpectators')
|
|
53
|
+
last_income_sponsors: int = HTField('LastIncomeSponsors')
|
|
54
|
+
last_income_financial: int = HTField('LastIncomeFinancial')
|
|
55
|
+
last_income_sold_players: int = HTField('LastIncomeSoldPlayers')
|
|
56
|
+
last_income_sold_players_commission: int = HTField('LastIncomeSoldPlayersCommission')
|
|
57
|
+
last_income_sum: int = HTField('LastIncomeSum')
|
|
58
|
+
last_costs_arena: int = HTField('LastCostsArena')
|
|
59
|
+
last_costs_players: int = HTField('LastCostsPlayers')
|
|
60
|
+
last_costs_financial: int = HTField('LastCostsFinancial')
|
|
61
|
+
last_costs_bought_players: int = HTField('LastCostsBoughtPlayers')
|
|
62
|
+
last_costs_arena_building: int = HTField('LastCostsArenaBuilding')
|
|
63
|
+
last_costs_staff: int = HTField('LastCostsStaff')
|
|
64
|
+
last_costs_youth: int = HTField('LastCostsYouth')
|
|
65
|
+
last_costs_sum: int = HTField('LastCostsSum')
|
|
66
|
+
last_weeks_total: int = HTField('LastWeeksTotal')
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import List, Optional
|
|
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 RequestFans(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Fans - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'fans'
|
|
14
|
+
LAST_VERSION = '1.3'
|
|
15
|
+
|
|
16
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Fans(RequestFans):
|
|
20
|
+
"""
|
|
21
|
+
Fans
|
|
22
|
+
"""
|
|
23
|
+
team: 'Team' = HTField('Team')
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Team(HTModel):
|
|
27
|
+
"""
|
|
28
|
+
Fans -> Team
|
|
29
|
+
"""
|
|
30
|
+
id: int = HTField('TeamID')
|
|
31
|
+
fan_club_id: int = HTField('FanclubId')
|
|
32
|
+
fan_club_name: str = HTField('FanclubName')
|
|
33
|
+
fan_mood: int = HTField('FanMood')
|
|
34
|
+
members: int = HTField('Members')
|
|
35
|
+
fan_season_expectation: int = HTField('FanSeasonExpectation')
|
|
36
|
+
played_matches: List['PlayedMatchItem'] = HTField('PlayedMatches', items='Match')
|
|
37
|
+
upcoming_matches: List['UpcomingMatchItem'] = HTField('UpcomingMatches', items='Match')
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class BaseMatchItem(HTModel):
|
|
41
|
+
"""
|
|
42
|
+
Fans -> Team -> Played/Upcoming matches -> Match item
|
|
43
|
+
"""
|
|
44
|
+
id: int = HTField('MatchID')
|
|
45
|
+
home_team: 'BaseMatchItemTeam' = HTField('HomeTeam', xml_prefix='Home')
|
|
46
|
+
away_team: 'BaseMatchItemTeam' = HTField('AwayTeam', xml_prefix='Away')
|
|
47
|
+
date: datetime = HTField('MatchDate')
|
|
48
|
+
type: int = HTField('MatchType')
|
|
49
|
+
fan_match_expectation: int = HTField('FanMatchExpectation')
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class BaseMatchItemTeam(HTModel):
|
|
53
|
+
"""
|
|
54
|
+
Fans -> Team -> Played/Upcoming matches -> Match item -> Home/Away team
|
|
55
|
+
"""
|
|
56
|
+
id: int = HTField('TeamID')
|
|
57
|
+
name: str = HTField('TeamName')
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class PlayedMatchItem(BaseMatchItem):
|
|
61
|
+
"""
|
|
62
|
+
Fans -> Team -> Played matches -> Match item
|
|
63
|
+
"""
|
|
64
|
+
home_goals: int = HTField('HomeGoals')
|
|
65
|
+
away_goals: int = HTField('AwayGoals')
|
|
66
|
+
fan_mood_after_match: int = HTField('FanMoodAfterMatch')
|
|
67
|
+
weather: int = HTField('Weather')
|
|
68
|
+
sold_seats: int = HTField('SoldSeats')
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class UpcomingMatchItem(BaseMatchItem):
|
|
72
|
+
"""
|
|
73
|
+
Fans -> Team -> Upcoming matches -> Match item
|
|
74
|
+
"""
|
|
@@ -0,0 +1,40 @@
|
|
|
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 RequestHallOfFamePlayers(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Hall of Fame Players - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'hofplayers'
|
|
14
|
+
LAST_VERSION = '1.2'
|
|
15
|
+
|
|
16
|
+
_r_team_id: Optional[int] = HTInitVar('teamID', init_arg='team_id')
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class HallOfFamePlayers(RequestHallOfFamePlayers):
|
|
20
|
+
"""
|
|
21
|
+
Hall of Fame Players
|
|
22
|
+
"""
|
|
23
|
+
players: Optional[List['PlayerItem']] = HTField('PlayerList', items='Player')
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class PlayerItem(HTModel):
|
|
27
|
+
"""
|
|
28
|
+
Hall of Fame Players -> Players -> Player item
|
|
29
|
+
"""
|
|
30
|
+
id: int = HTField('PlayerId')
|
|
31
|
+
first_name: str = HTField('FirstName')
|
|
32
|
+
nick_name: Optional[str] = HTField('NickName')
|
|
33
|
+
last_name: str = HTField('LastName')
|
|
34
|
+
age: int = HTField('Age')
|
|
35
|
+
next_birthday: datetime = HTField('NextBirthday')
|
|
36
|
+
country_id: int = HTField('CountryID')
|
|
37
|
+
arrival_date: datetime = HTField('ArrivalDate')
|
|
38
|
+
expert_type: int = HTField('ExpertType')
|
|
39
|
+
hof_date: datetime = HTField('HofDate')
|
|
40
|
+
hof_age: int = HTField('HofAge')
|
|
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
|