pychpp 0.4.2__tar.gz → 0.4.3__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.2 → pychpp-0.4.3}/PKG-INFO +4 -2
- {pychpp-0.4.2 → pychpp-0.4.3}/README.md +3 -1
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/chpp.py +16 -1
- pychpp-0.4.3/pychpp/models/xml/ladder_details.py +54 -0
- pychpp-0.4.3/pychpp/models/xml/ladder_list.py +35 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pyproject.toml +1 -1
- {pychpp-0.4.2 → pychpp-0.4.3}/LICENSE +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/__init__.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/fixtures/__init__.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/fixtures/ht_datetime.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/fixtures/ht_error.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/__init__.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/__init__.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/__init__.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_arena.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_country.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_league.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_league_unit.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_match.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_player.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_region.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_team.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/base/ht_user.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_arena.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_challenge.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_league.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_league_unit.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_match.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_match_lineup.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_matches_archive.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_player.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_region.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_team.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_transfer_history.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_user.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_youth_player.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/custom/ht_youth_team.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/ht_field.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/ht_init_var.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/ht_model.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/ht_version.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/ht_xml.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/__init__.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/achievements.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/alliance_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/alliances.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/arena_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/avatars.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/bookmarks.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/challenges.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/club.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/cup_matches.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/current_bids.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/economy.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/fans.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/hof_players.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/league_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/league_fixtures.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/manager_compendium.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/match_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/match_lineup.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/matches_archive.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/national_team_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/national_teams.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/player_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/players.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/region_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/team_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/training.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/transfers_team.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/world_cup.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/world_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/youth_player_details.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/pychpp/models/xml/youth_player_list.py +0 -0
- {pychpp-0.4.2 → pychpp-0.4.3}/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.3
|
|
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,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
|
|
|
@@ -184,6 +184,8 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
184
184
|
| Economy | `economy.xml` |
|
|
185
185
|
| Fans | `fans.xml` |
|
|
186
186
|
| HallOfFamePlayers | `hofplayers.xml` |
|
|
187
|
+
| LadderDetails | `ladderdetails.xml` |
|
|
188
|
+
| LadderList | `ladderlist.xml` |
|
|
187
189
|
| LeagueDetails | `leaguedetails.xml` |
|
|
188
190
|
| LeagueFixtures | `leaguefixtures.xml` |
|
|
189
191
|
| ManagerCompendium | `managercompendium.xml` |
|
|
@@ -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
|
|
|
@@ -162,6 +162,8 @@ The following table shows the CHPP XML files that are currently supported:
|
|
|
162
162
|
| Economy | `economy.xml` |
|
|
163
163
|
| Fans | `fans.xml` |
|
|
164
164
|
| HallOfFamePlayers | `hofplayers.xml` |
|
|
165
|
+
| LadderDetails | `ladderdetails.xml` |
|
|
166
|
+
| LadderList | `ladderlist.xml` |
|
|
165
167
|
| LeagueDetails | `leaguedetails.xml` |
|
|
166
168
|
| LeagueFixtures | `leaguefixtures.xml` |
|
|
167
169
|
| ManagerCompendium | `managercompendium.xml` |
|
|
@@ -13,7 +13,7 @@ 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)
|
|
16
|
+
fans, hof_players, ladder_details, ladder_list)
|
|
17
17
|
from pychpp.models.custom import (ht_team, ht_arena, ht_user, ht_region, ht_youth_team, ht_player,
|
|
18
18
|
ht_league_unit, ht_youth_player, ht_league, ht_matches_archive,
|
|
19
19
|
ht_match, ht_challenge, ht_match_lineup, ht_transfer_history)
|
|
@@ -602,6 +602,21 @@ class CHPPXml(CHPPBase):
|
|
|
602
602
|
|
|
603
603
|
return hof_players.HallOfFamePlayers(chpp=self, team_id=team_id, **kwargs)
|
|
604
604
|
|
|
605
|
+
def xml_ladder_details(
|
|
606
|
+
self, team_id: int = None, page_size: int = None,
|
|
607
|
+
page_index: int = None, **kwargs,
|
|
608
|
+
) -> ladder_details.LadderDetails:
|
|
609
|
+
|
|
610
|
+
return ladder_details.LadderDetails(
|
|
611
|
+
chpp=self, team_id=team_id, page_size=page_size,
|
|
612
|
+
page_index=page_index, **kwargs,
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
def xml_ladder_list(self, team_id: int = None, **kwargs,
|
|
616
|
+
) -> ladder_list.LadderList:
|
|
617
|
+
|
|
618
|
+
return ladder_list.LadderList(chpp=self, team_id=team_id, **kwargs)
|
|
619
|
+
|
|
605
620
|
def xml_league_details(
|
|
606
621
|
self, league_level_unit_id: int = None, **kwargs,
|
|
607
622
|
) -> league_details.LeagueDetails:
|
|
@@ -0,0 +1,54 @@
|
|
|
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 RequestLadderDetails(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Ladder Details - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'ladderdetails'
|
|
14
|
+
LAST_VERSION = '1.0'
|
|
15
|
+
|
|
16
|
+
_r_ladder_id: int = HTInitVar('ladderid', init_arg='ladder_id')
|
|
17
|
+
_r_team_id: Optional[int] = HTInitVar('teamid', init_arg='team_id')
|
|
18
|
+
_r_page_size: Optional[int] = HTInitVar('pagesize', init_arg='page_size')
|
|
19
|
+
_r_page_index: Optional[int] = HTInitVar('pageindex', init_arg='page_index')
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class LadderDetails(RequestLadderDetails):
|
|
23
|
+
"""
|
|
24
|
+
Ladder Details
|
|
25
|
+
"""
|
|
26
|
+
ladder: 'Ladder' = HTField('Ladder')
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Ladder(HTModel):
|
|
30
|
+
"""
|
|
31
|
+
Ladder Details -> Ladder
|
|
32
|
+
"""
|
|
33
|
+
id: int = HTField('LadderId')
|
|
34
|
+
name: str = HTField('Name')
|
|
35
|
+
num_of_teams: int = HTField('NumOfTeams')
|
|
36
|
+
page_size: int = HTField('PageSize')
|
|
37
|
+
page_index: int = HTField('PageIndex')
|
|
38
|
+
king_team_id: int = HTField('KingTeamId')
|
|
39
|
+
king_team_name: str = HTField('KingTeamName')
|
|
40
|
+
king_since: datetime = HTField('KingSince')
|
|
41
|
+
teams: Optional[List['Team']] = HTField('.', items='Team')
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class Team(HTModel):
|
|
45
|
+
"""
|
|
46
|
+
Ladder Details -> Ladder -> Teams -> Team item
|
|
47
|
+
"""
|
|
48
|
+
id: int = HTField('TeamId')
|
|
49
|
+
name: str = HTField('TeamName')
|
|
50
|
+
position: int = HTField('Position')
|
|
51
|
+
wins: int = HTField('Wins')
|
|
52
|
+
lost: int = HTField('Lost')
|
|
53
|
+
wins_in_a_row: int = HTField('WinsInARow')
|
|
54
|
+
lost_in_a_row: int = HTField('LostInARow')
|
|
@@ -0,0 +1,35 @@
|
|
|
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 RequestLadderList(HTModel):
|
|
10
|
+
"""
|
|
11
|
+
Ladder List - Request arguments
|
|
12
|
+
"""
|
|
13
|
+
SOURCE_FILE = 'ladderlist'
|
|
14
|
+
LAST_VERSION = '1.0'
|
|
15
|
+
|
|
16
|
+
_r_team_id: Optional[int] = HTInitVar('teamId', init_arg='team_id')
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class LadderList(RequestLadderList):
|
|
20
|
+
"""
|
|
21
|
+
Ladder List
|
|
22
|
+
"""
|
|
23
|
+
ladders: Optional[List['LadderItem']] = HTField('Ladders', items='Ladder')
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class LadderItem(HTModel):
|
|
27
|
+
"""
|
|
28
|
+
Ladder List -> Ladders -> Ladder item
|
|
29
|
+
"""
|
|
30
|
+
id: int = HTField('LadderId')
|
|
31
|
+
name: str = HTField('Name')
|
|
32
|
+
position: int = HTField('Position')
|
|
33
|
+
next_match_date: datetime = HTField('NextMatchDate')
|
|
34
|
+
wins: int = HTField('Wins')
|
|
35
|
+
lost: int = HTField('Lost')
|
|
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
|