pychpp 0.5.0__tar.gz → 0.5.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.5.0 → pychpp-0.5.2}/PKG-INFO +9 -10
- {pychpp-0.5.0 → pychpp-0.5.2}/README.md +2 -2
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/chpp.py +28 -42
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/match_details.py +33 -33
- {pychpp-0.5.0 → pychpp-0.5.2}/pyproject.toml +6 -6
- {pychpp-0.5.0 → pychpp-0.5.2}/LICENSE +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/__init__.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/fixtures/__init__.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/fixtures/ht_datetime.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/fixtures/ht_error.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/__init__.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/__init__.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/__init__.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_arena.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_country.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_league.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_league_unit.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_match.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_player.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_region.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_team.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/base/ht_user.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_arena.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_challenge.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_league.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_league_unit.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_match.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_match_lineup.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_matches_archive.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_player.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_region.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_team.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_transfer_history.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_user.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_youth_player.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/custom/ht_youth_team.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/ht_field.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/ht_init_var.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/ht_model.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/ht_version.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/ht_xml.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/__init__.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/achievements.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/alliance_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/alliances.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/arena_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/avatars.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/bookmarks.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/challenges.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/club.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/cup_matches.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/current_bids.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/economy.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/fans.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/hof_players.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/ladder_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/ladder_list.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/league_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/league_fixtures.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/league_levels.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/live.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/manager_compendium.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/match_lineup.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/match_orders.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/matches.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/matches_archive.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/national_players.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/national_team_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/national_team_matches.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/national_teams.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/player_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/player_events.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/players.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/region_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/search.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/staff_avatars.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/staff_list.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/supporters.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/team_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/tournament_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/tournament_fixtures.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/tournament_league_tables.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/tournament_list.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/training.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/training_events.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/transfer_search.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/transfers_player.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/transfers_team.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/translations.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/world_cup.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/world_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/world_languages.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/youth_avatars.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/youth_league_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/youth_league_fixtures.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/youth_player_details.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/youth_player_list.py +0 -0
- {pychpp-0.5.0 → pychpp-0.5.2}/pychpp/models/xml/youth_team_details.py +0 -0
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: pychpp
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: framework created to use the API provided by the online game Hattrick
|
|
5
|
-
Home-page: https://framagit.org/Pierre86/pychpp
|
|
6
5
|
License: Apache-2.0
|
|
7
6
|
Author: Pierre Gobin
|
|
8
7
|
Author-email: p.dev@gobin.cc
|
|
9
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.9,<4.0
|
|
10
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
10
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
-
Requires-Dist: Werkzeug (>=
|
|
19
|
-
Requires-Dist: pytz (>=
|
|
20
|
-
Requires-Dist:
|
|
16
|
+
Requires-Dist: Werkzeug (>=3.1.3,<4.0.0)
|
|
17
|
+
Requires-Dist: pytz (>=2025.1,<2026.0)
|
|
18
|
+
Requires-Dist: requests-oauthlib (>=2.0.0,<3.0.0)
|
|
19
|
+
Project-URL: Homepage, https://framagit.org/Pierre86/pychpp
|
|
21
20
|
Description-Content-Type: text/markdown
|
|
22
21
|
|
|
23
22
|
# pyCHPP
|
|
@@ -57,8 +56,8 @@ pyCHPP can be installed using pip :
|
|
|
57
56
|
# access_token['key'] and access_token['secret'] have to be stored
|
|
58
57
|
# in order to be used later by the app
|
|
59
58
|
>>> access_token = chpp.get_access_token(
|
|
60
|
-
request_token=auth["
|
|
61
|
-
request_token_secret=auth["
|
|
59
|
+
request_token=auth["oauth_token"],
|
|
60
|
+
request_token_secret=auth["oauth_token_secret"],
|
|
62
61
|
code=code,
|
|
63
62
|
)
|
|
64
63
|
```
|
|
@@ -35,8 +35,8 @@ pyCHPP can be installed using pip :
|
|
|
35
35
|
# access_token['key'] and access_token['secret'] have to be stored
|
|
36
36
|
# in order to be used later by the app
|
|
37
37
|
>>> access_token = chpp.get_access_token(
|
|
38
|
-
request_token=auth["
|
|
39
|
-
request_token_secret=auth["
|
|
38
|
+
request_token=auth["oauth_token"],
|
|
39
|
+
request_token_secret=auth["oauth_token_secret"],
|
|
40
40
|
code=code,
|
|
41
41
|
)
|
|
42
42
|
```
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from typing import Union, Optional
|
|
3
3
|
|
|
4
|
-
from rauth import OAuth1Service
|
|
5
|
-
from rauth import OAuth1Session
|
|
6
|
-
from rauth.oauth import HmacSha1Signature
|
|
7
4
|
import xml.etree.ElementTree
|
|
8
5
|
|
|
6
|
+
from requests_oauthlib import OAuth1Session
|
|
7
|
+
|
|
9
8
|
from pychpp.models.xml import (manager_compendium, team_details, achievements, arena_details,
|
|
10
9
|
challenges, region_details, league_details, league_fixtures,
|
|
11
10
|
match_lineup, national_teams, national_team_details, player_details,
|
|
@@ -74,15 +73,7 @@ class CHPPBase:
|
|
|
74
73
|
self.invalidate_token_url = (
|
|
75
74
|
"https://chpp.hattrick.org/oauth/invalidate_token.ashx")
|
|
76
75
|
|
|
77
|
-
self.
|
|
78
|
-
consumer_key=self.consumer_key,
|
|
79
|
-
consumer_secret=self.consumer_secret,
|
|
80
|
-
request_token_url=self.request_token_url,
|
|
81
|
-
access_token_url=self.access_token_url,
|
|
82
|
-
authorize_url=self.authorize_url,
|
|
83
|
-
base_url=self.base_url,
|
|
84
|
-
signature_obj=HmacSha1Signature,
|
|
85
|
-
)
|
|
76
|
+
self.session = None
|
|
86
77
|
|
|
87
78
|
@staticmethod
|
|
88
79
|
def _analyze_error(xml_data):
|
|
@@ -174,7 +165,7 @@ class CHPPBase:
|
|
|
174
165
|
Get url, request_token and request_token_secret
|
|
175
166
|
to get authentification tokens from Hattrick for this user
|
|
176
167
|
|
|
177
|
-
:param callback_url: url that have to be
|
|
168
|
+
:param callback_url: url that have to be requested by Hattrick
|
|
178
169
|
after the user have fill his credentials
|
|
179
170
|
:param scope: authorization granted by user to the application
|
|
180
171
|
can be one or more from "", "manage_challenges",
|
|
@@ -218,16 +209,12 @@ class CHPPBase:
|
|
|
218
209
|
else:
|
|
219
210
|
raise ValueError("Scope parameter must be a string a or list")
|
|
220
211
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
auth["request_token"] = request_token
|
|
228
|
-
auth["request_token_secret"] = request_token_secret
|
|
229
|
-
auth["url"] = (
|
|
230
|
-
self.service.get_authorize_url(request_token, scope=scope))
|
|
212
|
+
oauth = OAuth1Session(client_key=self.consumer_key,
|
|
213
|
+
client_secret=self.consumer_secret,
|
|
214
|
+
callback_uri=callback_url,
|
|
215
|
+
)
|
|
216
|
+
auth = oauth.fetch_request_token(self.request_token_url)
|
|
217
|
+
auth["url"] = oauth.authorization_url(self.authorize_url, scope=scope)
|
|
231
218
|
|
|
232
219
|
return auth
|
|
233
220
|
|
|
@@ -254,28 +241,26 @@ class CHPPBase:
|
|
|
254
241
|
elif not isinstance(code, str):
|
|
255
242
|
raise ValueError("code must be a string")
|
|
256
243
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
access_token = dict()
|
|
244
|
+
oauth = OAuth1Session(client_key=self.consumer_key,
|
|
245
|
+
client_secret=self.consumer_secret,
|
|
246
|
+
resource_owner_key=request_token,
|
|
247
|
+
resource_owner_secret=request_token_secret,
|
|
248
|
+
verifier=code,
|
|
249
|
+
)
|
|
264
250
|
|
|
265
|
-
|
|
266
|
-
access_token["secret"] = access_token_query[1]
|
|
251
|
+
tokens = oauth.fetch_access_token(self.access_token_url)
|
|
267
252
|
|
|
268
|
-
return
|
|
253
|
+
return dict(key=tokens['oauth_token'], secret=tokens['oauth_token_secret'])
|
|
269
254
|
|
|
270
255
|
def open_session(self):
|
|
271
256
|
"""
|
|
272
257
|
Open OAuth session
|
|
273
258
|
"""
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
259
|
+
self.session = OAuth1Session(client_key=self.consumer_key,
|
|
260
|
+
client_secret=self.consumer_secret,
|
|
261
|
+
resource_owner_key=self.access_token_key,
|
|
262
|
+
resource_owner_secret=self.access_token_secret,
|
|
263
|
+
)
|
|
279
264
|
|
|
280
265
|
def _base_request(
|
|
281
266
|
self, url, parse_data=True, method='GET', **kwargs,
|
|
@@ -287,12 +272,13 @@ class CHPPBase:
|
|
|
287
272
|
:param parse_data: parse or not returned data as xml
|
|
288
273
|
:return: xml data fetched on Hattrick
|
|
289
274
|
"""
|
|
290
|
-
session
|
|
275
|
+
if self.session is None:
|
|
276
|
+
self.open_session()
|
|
291
277
|
|
|
292
278
|
if method == 'GET':
|
|
293
|
-
query = session.get(url, params=kwargs)
|
|
279
|
+
query = self.session.get(url, params=kwargs)
|
|
294
280
|
elif method == 'POST':
|
|
295
|
-
query = session.post(url, data=kwargs)
|
|
281
|
+
query = self.session.post(url, data=kwargs)
|
|
296
282
|
else:
|
|
297
283
|
raise ValueError(f"Unknown method '{method}'")
|
|
298
284
|
|
|
@@ -302,7 +288,7 @@ class CHPPBase:
|
|
|
302
288
|
if query.status_code == 401:
|
|
303
289
|
raise ht_error.HTUnauthorizedAction(
|
|
304
290
|
"The requested action seems to be unauthorized "
|
|
305
|
-
"(401 error code). Please
|
|
291
|
+
"(401 error code). Please check your credentials scope.")
|
|
306
292
|
|
|
307
293
|
if not parse_data:
|
|
308
294
|
return query.text
|
|
@@ -39,15 +39,15 @@ class Match(HTModel):
|
|
|
39
39
|
cup_level: int = HTField('CupLevel')
|
|
40
40
|
cup_level_index: int = HTField('CupLevelIndex')
|
|
41
41
|
date: datetime = HTField('MatchDate')
|
|
42
|
-
finished_date: datetime = HTField('FinishedDate')
|
|
43
|
-
added_minutes: int = HTField('AddedMinutes')
|
|
42
|
+
finished_date: Optional[datetime] = HTField('FinishedDate')
|
|
43
|
+
added_minutes: Optional[int] = HTField('AddedMinutes')
|
|
44
44
|
home_team: 'MatchHomeTeam' = HTField('HomeTeam')
|
|
45
45
|
away_team: 'MatchAwayTeam' = HTField('AwayTeam')
|
|
46
46
|
arena: 'MatchArena' = HTField('Arena')
|
|
47
47
|
officials: 'MatchOfficials' = HTField('MatchOfficials')
|
|
48
|
-
goals: List['MatchGoalItem'] = HTField('Scorers', items='Goal')
|
|
49
|
-
bookings: List['MatchBookingItem'] = HTField('Bookings', items='Booking')
|
|
50
|
-
injuries: List['MatchInjuryItem'] = HTField('Injuries', items='Injury')
|
|
48
|
+
goals: Optional[List['MatchGoalItem']] = HTField('Scorers', items='Goal')
|
|
49
|
+
bookings: Optional[List['MatchBookingItem']] = HTField('Bookings', items='Booking')
|
|
50
|
+
injuries: Optional[List['MatchInjuryItem']] = HTField('Injuries', items='Injury')
|
|
51
51
|
possession: 'MatchPossession' = HTField('.')
|
|
52
52
|
events: Optional[List['MatchEventItem']] = HTField('EventList', items='Event')
|
|
53
53
|
|
|
@@ -56,10 +56,10 @@ class BaseMatchTeam(HTModel):
|
|
|
56
56
|
"""
|
|
57
57
|
Match Details -> Match -> Base Home/Away team
|
|
58
58
|
"""
|
|
59
|
-
dress_uri: str = HTField('DressURI')
|
|
60
|
-
formation: str = HTField('Formation')
|
|
61
|
-
tactic_type: int = HTField('TacticType')
|
|
62
|
-
tactic_skill: int = HTField('TacticSkill')
|
|
59
|
+
dress_uri: Optional[str] = HTField('DressURI')
|
|
60
|
+
formation: Optional[str] = HTField('Formation')
|
|
61
|
+
tactic_type: Optional[int] = HTField('TacticType')
|
|
62
|
+
tactic_skill: Optional[int] = HTField('TacticSkill')
|
|
63
63
|
ratings: 'MatchTeamRatings' = HTField('.')
|
|
64
64
|
team_attitude: Optional[int] = HTField('TeamAttitude')
|
|
65
65
|
chances: 'MatchTeamChances' = HTField('.')
|
|
@@ -71,7 +71,7 @@ class MatchHomeTeam(BaseMatchTeam):
|
|
|
71
71
|
"""
|
|
72
72
|
id: int = HTField('HomeTeamID')
|
|
73
73
|
name: str = HTField('HomeTeamName')
|
|
74
|
-
goals: int = HTField('HomeGoals')
|
|
74
|
+
goals: Optional[int] = HTField('HomeGoals')
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
class MatchAwayTeam(BaseMatchTeam):
|
|
@@ -80,20 +80,20 @@ class MatchAwayTeam(BaseMatchTeam):
|
|
|
80
80
|
"""
|
|
81
81
|
id: int = HTField('AwayTeamID')
|
|
82
82
|
name: str = HTField('AwayTeamName')
|
|
83
|
-
goals: int = HTField('AwayGoals')
|
|
83
|
+
goals: Optional[int] = HTField('AwayGoals')
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
class MatchTeamRatings(HTModel):
|
|
87
87
|
"""
|
|
88
88
|
Match Details -> Match -> Home/Away team -> Ratings
|
|
89
89
|
"""
|
|
90
|
-
midfield: int = HTField('RatingMidfield')
|
|
91
|
-
right_defense: int = HTField('RatingRightDef')
|
|
92
|
-
mid_defense: int = HTField('RatingMidDef')
|
|
93
|
-
left_defense: int = HTField('RatingLeftDef')
|
|
94
|
-
right_attack: int = HTField('RatingRightDef')
|
|
95
|
-
mid_attack: int = HTField('RatingMidDef')
|
|
96
|
-
left_attack: int = HTField('RatingLeftDef')
|
|
90
|
+
midfield: Optional[int] = HTField('RatingMidfield')
|
|
91
|
+
right_defense: Optional[int] = HTField('RatingRightDef')
|
|
92
|
+
mid_defense: Optional[int] = HTField('RatingMidDef')
|
|
93
|
+
left_defense: Optional[int] = HTField('RatingLeftDef')
|
|
94
|
+
right_attack: Optional[int] = HTField('RatingRightDef')
|
|
95
|
+
mid_attack: Optional[int] = HTField('RatingMidDef')
|
|
96
|
+
left_attack: Optional[int] = HTField('RatingLeftDef')
|
|
97
97
|
indirect_set_pieces_defense: Optional[int] = HTField('RatingIndirectSetPiecesDef')
|
|
98
98
|
indirect_set_pieces_attack: Optional[int] = HTField('RatingIndirectSetPiecesAtt')
|
|
99
99
|
|
|
@@ -102,11 +102,11 @@ class MatchTeamChances(HTModel):
|
|
|
102
102
|
"""
|
|
103
103
|
Match Details -> Match -> Home/Away team -> Chances
|
|
104
104
|
"""
|
|
105
|
-
left: int = HTField('NrOfChancesLeft')
|
|
106
|
-
center: int = HTField('NrOfChancesCenter')
|
|
107
|
-
right: int = HTField('NrOfChancesRight')
|
|
108
|
-
special_events: int = HTField('NrOfChancesSpecialEvents')
|
|
109
|
-
other: int = HTField('NrOfChancesOther')
|
|
105
|
+
left: Optional[int] = HTField('NrOfChancesLeft')
|
|
106
|
+
center: Optional[int] = HTField('NrOfChancesCenter')
|
|
107
|
+
right: Optional[int] = HTField('NrOfChancesRight')
|
|
108
|
+
special_events: Optional[int] = HTField('NrOfChancesSpecialEvents')
|
|
109
|
+
other: Optional[int] = HTField('NrOfChancesOther')
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
class MatchArena(HTModel):
|
|
@@ -115,7 +115,7 @@ class MatchArena(HTModel):
|
|
|
115
115
|
"""
|
|
116
116
|
id: int = HTField('ArenaID')
|
|
117
117
|
name: str = HTField('ArenaName')
|
|
118
|
-
weather_id: int = HTField('WeatherID')
|
|
118
|
+
weather_id: Optional[int] = HTField('WeatherID')
|
|
119
119
|
sold: 'MatchArenaSold' = HTField('.')
|
|
120
120
|
|
|
121
121
|
|
|
@@ -123,11 +123,11 @@ class MatchArenaSold(HTModel):
|
|
|
123
123
|
"""
|
|
124
124
|
Match Details -> Match -> Arena -> Sold
|
|
125
125
|
"""
|
|
126
|
-
total: int = HTField('SoldTotal')
|
|
127
|
-
terraces: int = HTField('SoldTerraces')
|
|
128
|
-
basic: int = HTField('SoldBasic')
|
|
129
|
-
roof: int = HTField('SoldRoof')
|
|
130
|
-
vip: int = HTField('SoldVIP')
|
|
126
|
+
total: Optional[int] = HTField('SoldTotal')
|
|
127
|
+
terraces: Optional[int] = HTField('SoldTerraces')
|
|
128
|
+
basic: Optional[int] = HTField('SoldBasic')
|
|
129
|
+
roof: Optional[int] = HTField('SoldRoof')
|
|
130
|
+
vip: Optional[int] = HTField('SoldVIP')
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
class MatchOfficials(HTModel):
|
|
@@ -206,10 +206,10 @@ class MatchPossession(HTModel):
|
|
|
206
206
|
"""
|
|
207
207
|
Match Details -> Match -> Possession
|
|
208
208
|
"""
|
|
209
|
-
first_half_home: int = HTField('PossessionFirstHalfHome')
|
|
210
|
-
first_half_away: int = HTField('PossessionFirstHalfAway')
|
|
211
|
-
second_half_home: int = HTField('PossessionSecondHalfHome')
|
|
212
|
-
second_half_away: int = HTField('PossessionSecondHalfAway')
|
|
209
|
+
first_half_home: Optional[int] = HTField('PossessionFirstHalfHome')
|
|
210
|
+
first_half_away: Optional[int] = HTField('PossessionFirstHalfAway')
|
|
211
|
+
second_half_home: Optional[int] = HTField('PossessionSecondHalfHome')
|
|
212
|
+
second_half_away: Optional[int] = HTField('PossessionSecondHalfAway')
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
class MatchEventItem(HTModel):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pychpp"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.2"
|
|
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>"]
|
|
@@ -9,15 +9,15 @@ homepage = "https://framagit.org/Pierre86/pychpp"
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
[tool.poetry.dependencies]
|
|
12
|
-
python = "^3.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
python = "^3.9"
|
|
13
|
+
pytz = "^2025.1"
|
|
14
|
+
Werkzeug = "^3.1.3"
|
|
15
|
+
requests-oauthlib = "^2.0.0"
|
|
16
16
|
|
|
17
17
|
[tool.poetry.group.dev.dependencies]
|
|
18
18
|
pytest = "^8.3.3"
|
|
19
19
|
pytest-dotenv = "^0.5.2"
|
|
20
|
-
flake8 = "^
|
|
20
|
+
flake8 = "^7.1.2"
|
|
21
21
|
|
|
22
22
|
[build-system]
|
|
23
23
|
requires = ["poetry>=0.12"]
|
|
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
|
|
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
|