pychpp 0.5.7__tar.gz → 0.5.8__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.7 → pychpp-0.5.8}/PKG-INFO +4 -2
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/ht_xml.py +14 -8
- {pychpp-0.5.7 → pychpp-0.5.8}/pyproject.toml +1 -1
- {pychpp-0.5.7 → pychpp-0.5.8}/LICENSE +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/README.md +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/__init__.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/chpp.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/fixtures/__init__.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/fixtures/ht_datetime.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/fixtures/ht_error.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/__init__.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/__init__.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/__init__.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_arena.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_country.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_league.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_league_unit.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_match.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_player.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_region.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_team.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/base/ht_user.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_arena.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_challenge.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_league.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_league_unit.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_match.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_match_lineup.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_matches_archive.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_player.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_region.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_team.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_transfer_history.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_user.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_youth_player.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/custom/ht_youth_team.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/ht_field.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/ht_init_var.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/ht_model.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/ht_version.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/__init__.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/achievements.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/alliance_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/alliances.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/arena_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/avatars.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/bookmarks.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/challenges.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/club.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/cup_matches.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/current_bids.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/economy.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/fans.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/hof_players.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/ladder_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/ladder_list.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/league_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/league_fixtures.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/league_levels.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/live.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/manager_compendium.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/match_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/match_lineup.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/match_orders.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/matches.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/matches_archive.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/national_players.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/national_team_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/national_team_matches.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/national_teams.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/player_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/player_events.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/players.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/region_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/search.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/staff_avatars.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/staff_list.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/supporters.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/team_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/tournament_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/tournament_fixtures.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/tournament_league_tables.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/tournament_list.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/training.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/training_events.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/transfer_search.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/transfers_player.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/transfers_team.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/translations.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/world_cup.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/world_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/world_languages.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/youth_avatars.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/youth_league_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/youth_league_fixtures.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/youth_player_details.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/youth_player_list.py +0 -0
- {pychpp-0.5.7 → pychpp-0.5.8}/pychpp/models/xml/youth_team_details.py +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pychpp
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.8
|
|
4
4
|
Summary: framework created to use the API provided by the online game Hattrick
|
|
5
5
|
License: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Author: Pierre Gobin
|
|
7
8
|
Author-email: p.dev@gobin.cc
|
|
8
9
|
Requires-Python: >=3.9,<4.0
|
|
@@ -13,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
18
|
Requires-Dist: Werkzeug (>=3.1.3,<4.0.0)
|
|
17
19
|
Requires-Dist: pytz (>=2025.1,<2026.0)
|
|
18
20
|
Requires-Dist: requests-oauthlib (>=2.0.0,<3.0.0)
|
|
@@ -25,7 +25,10 @@ class HTXml:
|
|
|
25
25
|
if attrib is not None:
|
|
26
26
|
return int(data.attrib.get(attrib, None))
|
|
27
27
|
else:
|
|
28
|
-
|
|
28
|
+
if data.text == 'Not available' or data.text is None:
|
|
29
|
+
return None
|
|
30
|
+
else:
|
|
31
|
+
return int(data.text)
|
|
29
32
|
|
|
30
33
|
@staticmethod
|
|
31
34
|
def ht_float(data: ElementTree.Element, attrib: str = None):
|
|
@@ -112,25 +115,28 @@ class HTXml:
|
|
|
112
115
|
:rtype: ht_datetime.HTDatetime | None
|
|
113
116
|
"""
|
|
114
117
|
if attrib is not None:
|
|
115
|
-
|
|
118
|
+
data_ = data.attrib.get(attrib)
|
|
116
119
|
else:
|
|
117
|
-
|
|
120
|
+
data_ = data.text
|
|
118
121
|
|
|
119
|
-
if
|
|
122
|
+
if data_ is None:
|
|
120
123
|
return None
|
|
121
124
|
else:
|
|
122
|
-
|
|
125
|
+
if ':' in data_:
|
|
126
|
+
datetime_ = datetime.datetime.strptime(data_, "%Y-%m-%d %H:%M:%S")
|
|
127
|
+
else:
|
|
128
|
+
datetime_ = datetime.datetime.strptime(data_, "%Y-%m-%d")
|
|
123
129
|
|
|
124
130
|
# ValueError happens if text cannot be serialized
|
|
125
131
|
# OverflowError happens with special datetimes
|
|
126
132
|
# as 0001-01-01 9999-12-31 due to pytz limitations
|
|
127
133
|
# In these cases, return None
|
|
128
134
|
try:
|
|
129
|
-
|
|
135
|
+
ht_date_ = ht_datetime.HTDatetime(datetime=datetime_)
|
|
130
136
|
except (ValueError, OverflowError):
|
|
131
|
-
|
|
137
|
+
ht_date_ = None
|
|
132
138
|
|
|
133
|
-
return
|
|
139
|
+
return ht_date_
|
|
134
140
|
|
|
135
141
|
@staticmethod
|
|
136
142
|
def ht_datetime_to_text(_datetime):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|