pychpp 0.6.0__tar.gz → 0.6.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.
Files changed (353) hide show
  1. pychpp-0.6.2/.gitignore +8 -0
  2. pychpp-0.6.2/.gitlab-ci.yml +42 -0
  3. pychpp-0.6.2/.python-version +1 -0
  4. {pychpp-0.6.0 → pychpp-0.6.2}/PKG-INFO +18 -19
  5. {pychpp-0.6.0 → pychpp-0.6.2}/README.md +9 -0
  6. pychpp-0.6.2/docs/api/chpp.md +3 -0
  7. pychpp-0.6.2/docs/api/fixtures.md +5 -0
  8. pychpp-0.6.2/docs/api/index.md +5 -0
  9. pychpp-0.6.2/docs/api/models.md +23 -0
  10. pychpp-0.6.2/docs/guide/authentication.md +50 -0
  11. pychpp-0.6.2/docs/guide/errors.md +26 -0
  12. pychpp-0.6.2/docs/guide/examples.md +40 -0
  13. pychpp-0.6.2/docs/guide/installation.md +22 -0
  14. pychpp-0.6.2/docs/index.md +28 -0
  15. pychpp-0.6.2/public/404.html +695 -0
  16. pychpp-0.6.2/public/api/chpp/index.html +24279 -0
  17. pychpp-0.6.2/public/api/fixtures/index.html +3144 -0
  18. pychpp-0.6.2/public/api/index.html +773 -0
  19. pychpp-0.6.2/public/api/models/index.html +36529 -0
  20. pychpp-0.6.2/public/assets/images/favicon.png +0 -0
  21. pychpp-0.6.2/public/assets/javascripts/LICENSE +29 -0
  22. pychpp-0.6.2/public/assets/javascripts/bundle.9e76c64c.min.js +10 -0
  23. pychpp-0.6.2/public/assets/javascripts/git-revision-date-localized.592bf61f.min.js +1 -0
  24. pychpp-0.6.2/public/assets/javascripts/workers/search.719e0d91.min.js +1 -0
  25. pychpp-0.6.2/public/assets/stylesheets/classic/main.0006804e.min.css +6 -0
  26. pychpp-0.6.2/public/assets/stylesheets/classic/palette.813d4b3f.min.css +4 -0
  27. pychpp-0.6.2/public/assets/stylesheets/git-revision-date-localized.50f6a369.min.css +1 -0
  28. pychpp-0.6.2/public/assets/stylesheets/modern/main.e2cf241e.min.css +6 -0
  29. pychpp-0.6.2/public/assets/stylesheets/modern/palette.b60ce83d.min.css +4 -0
  30. pychpp-0.6.2/public/guide/authentication/index.html +945 -0
  31. pychpp-0.6.2/public/guide/errors/index.html +799 -0
  32. pychpp-0.6.2/public/guide/examples/index.html +902 -0
  33. pychpp-0.6.2/public/guide/installation/index.html +862 -0
  34. pychpp-0.6.2/public/index.html +877 -0
  35. pychpp-0.6.2/public/objects.inv +0 -0
  36. pychpp-0.6.2/public/search.json +1 -0
  37. pychpp-0.6.2/public/sitemap.xml +30 -0
  38. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/__init__.py +2 -0
  39. pychpp-0.6.2/pychpp/chpp.py +2387 -0
  40. pychpp-0.6.2/pychpp/fixtures/__init__.py +2 -0
  41. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/fixtures/ht_datetime.py +60 -42
  42. pychpp-0.6.2/pychpp/fixtures/ht_error.py +92 -0
  43. pychpp-0.6.2/pychpp/models/__init__.py +2 -0
  44. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/__init__.py +4 -4
  45. pychpp-0.6.2/pychpp/models/custom/base/__init__.py +2 -0
  46. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_arena.py +5 -6
  47. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_country.py +7 -7
  48. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_league.py +5 -6
  49. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_league_unit.py +5 -6
  50. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_match.py +9 -7
  51. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_player.py +26 -26
  52. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_region.py +5 -6
  53. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_team.py +17 -20
  54. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/base/ht_user.py +5 -6
  55. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_arena.py +6 -3
  56. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_challenge.py +58 -10
  57. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_league.py +5 -3
  58. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_league_unit.py +5 -9
  59. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_match.py +18 -5
  60. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_match_lineup.py +51 -36
  61. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_matches_archive.py +6 -12
  62. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_player.py +13 -5
  63. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_region.py +4 -6
  64. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_team.py +32 -5
  65. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_transfer_history.py +6 -3
  66. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_user.py +8 -3
  67. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_youth_player.py +3 -3
  68. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/custom/ht_youth_team.py +8 -6
  69. pychpp-0.6.2/pychpp/models/ht_field.py +61 -0
  70. pychpp-0.6.2/pychpp/models/ht_init_var.py +21 -0
  71. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/ht_model.py +63 -29
  72. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/ht_version.py +23 -0
  73. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/ht_xml.py +123 -35
  74. pychpp-0.6.2/pychpp/models/xml/__init__.py +2 -0
  75. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/achievements.py +6 -12
  76. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/alliance_details.py +16 -42
  77. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/alliances.py +5 -9
  78. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/arena_details.py +17 -45
  79. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/avatars.py +8 -18
  80. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/bookmarks.py +5 -9
  81. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/challenges.py +16 -42
  82. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/club.py +7 -15
  83. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/cup_matches.py +9 -21
  84. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/current_bids.py +6 -12
  85. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/economy.py +5 -9
  86. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/fans.py +9 -21
  87. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/hof_players.py +5 -9
  88. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/ladder_details.py +6 -12
  89. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/ladder_list.py +5 -9
  90. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/league_details.py +6 -12
  91. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/league_fixtures.py +7 -15
  92. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/league_levels.py +5 -9
  93. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/live.py +10 -24
  94. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/manager_compendium.py +18 -48
  95. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/match_details.py +28 -78
  96. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/match_lineup.py +11 -27
  97. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/match_orders.py +20 -54
  98. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/matches.py +9 -21
  99. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/matches_archive.py +8 -18
  100. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/national_players.py +10 -24
  101. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/national_prospect_players.py +7 -15
  102. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/national_team_details.py +9 -21
  103. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/national_team_matches.py +6 -12
  104. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/national_teams.py +7 -15
  105. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/player_details.py +14 -36
  106. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/player_events.py +6 -12
  107. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/player_stats.py +9 -21
  108. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/players.py +19 -51
  109. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/region_details.py +6 -12
  110. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/search.py +6 -12
  111. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/staff_avatars.py +9 -21
  112. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/staff_list.py +6 -12
  113. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/supporters.py +12 -30
  114. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/team_details.py +35 -99
  115. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/team_history.py +7 -15
  116. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/tournament_details.py +5 -9
  117. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/tournament_fixtures.py +5 -9
  118. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/tournament_league_tables.py +8 -11
  119. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/tournament_list.py +6 -12
  120. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/training.py +19 -51
  121. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/training_events.py +6 -12
  122. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/transfer_search.py +8 -18
  123. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/transfers_player.py +7 -15
  124. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/transfers_team.py +11 -27
  125. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/translations.py +14 -36
  126. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/world_cup.py +13 -33
  127. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/world_details.py +9 -21
  128. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/world_languages.py +5 -9
  129. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/youth_avatars.py +7 -15
  130. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/youth_league_details.py +5 -9
  131. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/youth_league_fixtures.py +6 -12
  132. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/youth_player_details.py +15 -39
  133. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/youth_player_list.py +17 -45
  134. {pychpp-0.6.0 → pychpp-0.6.2}/pychpp/models/xml/youth_team_details.py +12 -30
  135. pychpp-0.6.2/pyproject.toml +51 -0
  136. pychpp-0.6.2/tests/__init__.py +2 -0
  137. pychpp-0.6.2/tests/conftest.py +60 -0
  138. pychpp-0.6.2/tests/test_chpp_access.py +18 -0
  139. pychpp-0.6.2/tests/test_custom_ht_arena.py +39 -0
  140. pychpp-0.6.2/tests/test_custom_ht_challenge.py +23 -0
  141. pychpp-0.6.2/tests/test_custom_ht_league.py +25 -0
  142. pychpp-0.6.2/tests/test_custom_ht_league_unit.py +29 -0
  143. pychpp-0.6.2/tests/test_custom_ht_match.py +34 -0
  144. pychpp-0.6.2/tests/test_custom_ht_match_lineup.py +148 -0
  145. pychpp-0.6.2/tests/test_custom_ht_matches_archive.py +37 -0
  146. pychpp-0.6.2/tests/test_custom_ht_region.py +38 -0
  147. pychpp-0.6.2/tests/test_custom_ht_team.py +50 -0
  148. pychpp-0.6.2/tests/test_custom_ht_user.py +19 -0
  149. pychpp-0.6.2/tests/test_custom_ht_youth_team.py +26 -0
  150. pychpp-0.6.2/tests/test_ht_datetime.py +33 -0
  151. pychpp-0.6.2/tests/test_resources/file=achievements&version=1.2&userID=1728698.xml +516 -0
  152. pychpp-0.6.2/tests/test_resources/file=achievements&version=1.3&userID=1728698.xml +859 -0
  153. pychpp-0.6.2/tests/test_resources/file=achievements&version=1.4&userID=1728698.xml +905 -0
  154. pychpp-0.6.2/tests/test_resources/file=alliancedetails&version=1.5&actionType=view&allianceID=118840.xml +42 -0
  155. pychpp-0.6.2/tests/test_resources/file=alliances&version=1.4&searchFor=flag&searchType=1.xml +217 -0
  156. pychpp-0.6.2/tests/test_resources/file=alliances&version=1.5&searchFor=&searchType=5&userId=1728698.xml +10 -0
  157. pychpp-0.6.2/tests/test_resources/file=alliances&version=1.5&searchFor=&searchType=5.xml +10 -0
  158. pychpp-0.6.2/tests/test_resources/file=alliances&version=1.5&searchFor=flag&searchType=1.xml +217 -0
  159. pychpp-0.6.2/tests/test_resources/file=arenadetails&version=1.7&arenaID=1420520.xml +33 -0
  160. pychpp-0.6.2/tests/test_resources/file=arenadetails&version=1.7&arenaID=1751912.xml +33 -0
  161. pychpp-0.6.2/tests/test_resources/file=arenadetails&version=1.7&arenaID=295023.xml +33 -0
  162. pychpp-0.6.2/tests/test_resources/file=avatars&version=1.1&actionType=players&teamId=960935.xml +677 -0
  163. pychpp-0.6.2/tests/test_resources/file=bookmarks&version=1.0.xml +498 -0
  164. pychpp-0.6.2/tests/test_resources/file=club&version=1.5.xml +24 -0
  165. pychpp-0.6.2/tests/test_resources/file=cupmatches&version=1.4&CupID=183&CupRound=6&Season=88.xml +190 -0
  166. pychpp-0.6.2/tests/test_resources/file=currentbids&version=1.0&actionType=view.xml +20 -0
  167. pychpp-0.6.2/tests/test_resources/file=economy&version=1.4.xml +50 -0
  168. pychpp-0.6.2/tests/test_resources/file=fans&version=1.3.xml +174 -0
  169. pychpp-0.6.2/tests/test_resources/file=hofplayers&version=1.2&teamID=1750803.xml +99 -0
  170. pychpp-0.6.2/tests/test_resources/file=hofplayers&version=1.3&teamID=1750803.xml +188 -0
  171. pychpp-0.6.2/tests/test_resources/file=ladderdetails&version=1.0&ladderid=1257867&pageindex=0.xml +61 -0
  172. pychpp-0.6.2/tests/test_resources/file=ladderlist&version=1.0&teamId=964324.xml +40 -0
  173. pychpp-0.6.2/tests/test_resources/file=leaguefixtures&version=1.2&leagueLevelUnitID=36378&season=76.xml +849 -0
  174. pychpp-0.6.2/tests/test_resources/file=leaguefixtures&version=1.2.xml +761 -0
  175. pychpp-0.6.2/tests/test_resources/file=leaguelevels&version=1.0&LeagueID=5.xml +77 -0
  176. pychpp-0.6.2/tests/test_resources/file=live&version=2.3&actionType=view&includeStartingLineup=True&sourceSystem=hattrick&useLiveEventsAndTexts=True.xml +351 -0
  177. pychpp-0.6.2/tests/test_resources/file=live&version=2.4&actionType=view&includeStartingLineup=True&matchID=773342689&sourceSystem=hattrick&useLiveEventsAndTexts=True.xml +391 -0
  178. pychpp-0.6.2/tests/test_resources/file=managercompendium&version=1.5&userID=9638716.xml +83 -0
  179. pychpp-0.6.2/tests/test_resources/file=managercompendium&version=1.8&userID=9638716.xml +86 -0
  180. pychpp-0.6.2/tests/test_resources/file=managercompendium&version=1.8.xml +95 -0
  181. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=36370661&sourceSystem=htointegrated.xml +29 -0
  182. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=547513790.xml +389 -0
  183. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=685566813.xml +566 -0
  184. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=685860616.xml +664 -0
  185. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=690094305.xml +577 -0
  186. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=690183773.xml +743 -0
  187. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=690328642.xml +624 -0
  188. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=693127128.xml +756 -0
  189. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchEvents=True&matchID=695301077.xml +564 -0
  190. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchID=660688698&sourceSystem=Hattrick.xml +171 -0
  191. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.1&matchID=744337584.xml +55 -0
  192. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=547513790.xml +391 -0
  193. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=685566813.xml +568 -0
  194. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=685860616.xml +664 -0
  195. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=690094305.xml +577 -0
  196. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=690183773.xml +743 -0
  197. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=690328642.xml +624 -0
  198. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=693127128.xml +756 -0
  199. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=695301077.xml +564 -0
  200. pychpp-0.6.2/tests/test_resources/file=matchdetails&version=3.2&matchEvents=True&matchID=775863574.xml +497 -0
  201. pychpp-0.6.2/tests/test_resources/file=matches&version=2.9.xml +283 -0
  202. pychpp-0.6.2/tests/test_resources/file=matches&version=3.0.xml +240 -0
  203. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=136016609&sourceSystem=Youth&teamID=499165.xml +267 -0
  204. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=660688698&teamID=86324.xml +349 -0
  205. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=685566813&teamID=1750803.xml +360 -0
  206. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=685860616&teamID=113143.xml +368 -0
  207. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=690094305&teamID=296272.xml +321 -0
  208. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=690183773&teamID=2053693.xml +261 -0
  209. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=690328642&teamID=773670.xml +318 -0
  210. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=693127128&teamID=291394.xml +367 -0
  211. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.1&matchID=695301077&teamID=294798.xml +332 -0
  212. pychpp-0.6.2/tests/test_resources/file=matchlineup&version=2.2&matchID=773342689&teamID=649632.xml +391 -0
  213. pychpp-0.6.2/tests/test_resources/file=matchorders&version=3.1&actionType=view&matchID=739349000&sourceSystem=Hattrick.xml +278 -0
  214. pychpp-0.6.2/tests/test_resources/file=nationalplayers&version=1.5&actionType=view&teamID=3004.xml +885 -0
  215. pychpp-0.6.2/tests/test_resources/file=nationalprospectplayers&version=1.0&teamID=3001.xml +7064 -0
  216. pychpp-0.6.2/tests/test_resources/file=nationalteamdetails&version=1.9&teamID=3014.xml +41 -0
  217. pychpp-0.6.2/tests/test_resources/file=nationalteamdetails&version=2.0&teamID=3014.xml +67 -0
  218. pychpp-0.6.2/tests/test_resources/file=nationalteammatches&version=1.4.xml +2858 -0
  219. pychpp-0.6.2/tests/test_resources/file=nationalteams&version=1.6&LeagueOfficeTypeID=2.xml +2876 -0
  220. pychpp-0.6.2/tests/test_resources/file=playerdetails&version=3.0&playerID=432002549.xml +66 -0
  221. pychpp-0.6.2/tests/test_resources/file=playerdetails&version=3.0&playerID=453276953.xml +63 -0
  222. pychpp-0.6.2/tests/test_resources/file=playerdetails&version=3.0&playerID=473582922.xml +75 -0
  223. pychpp-0.6.2/tests/test_resources/file=playerdetails&version=3.3&playerID=430759322.xml +79 -0
  224. pychpp-0.6.2/tests/test_resources/file=playerdetails&version=3.3&playerID=432002549.xml +182 -0
  225. pychpp-0.6.2/tests/test_resources/file=playerdetails&version=3.3&playerID=453276953.xml +68 -0
  226. pychpp-0.6.2/tests/test_resources/file=playerevents&version=1.3&playerID=445879103.xml +97 -0
  227. pychpp-0.6.2/tests/test_resources/file=players&version=2.8&actionType=view&teamID=1165592.xml +1370 -0
  228. pychpp-0.6.2/tests/test_resources/file=players&version=2.8&actionType=viewOldies&teamID=1165592.xml +62 -0
  229. pychpp-0.6.2/tests/test_resources/file=playerstats&version=1.0&playerID=430759322.xml +1030 -0
  230. pychpp-0.6.2/tests/test_resources/file=regiondetails&version=1.2&regionID=149.xml +18 -0
  231. pychpp-0.6.2/tests/test_resources/file=search&version=1.2&searchLeagueID=-1&searchString=Bob&searchString2=Sunesson&searchType=0.xml +37 -0
  232. pychpp-0.6.2/tests/test_resources/file=staffavatars&version=1.1.xml +146 -0
  233. pychpp-0.6.2/tests/test_resources/file=stafflist&version=1.2.xml +61 -0
  234. pychpp-0.6.2/tests/test_resources/file=stafflist&version=1.3.xml +65 -0
  235. pychpp-0.6.2/tests/test_resources/file=supporters&version=1.0&actionType=supportedteams&userId=13481763.xml +773 -0
  236. pychpp-0.6.2/tests/test_resources/file=supporters&version=1.1&actionType=mysupporters&teamId=1165592.xml +60 -0
  237. pychpp-0.6.2/tests/test_resources/file=supporters&version=1.1&actionType=supportedteams&userId=13481763.xml +823 -0
  238. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.6&teamID=1755350.xml +625 -0
  239. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.6&teamID=295023.xml +344 -0
  240. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.6&teamID=326336.xml +285 -0
  241. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.6&teamID=987765.xml +670 -0
  242. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.7&teamID=1755350.xml +557 -0
  243. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.7&teamID=2513478.xml +91 -0
  244. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.7&teamID=295023.xml +251 -0
  245. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.8&teamID=1755350.xml +84 -0
  246. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=3.9&teamID=1755350.xml +85 -0
  247. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=4.0&teamID=1755350.xml +85 -0
  248. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=4.0&teamID=2513478.xml +86 -0
  249. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=4.0&teamID=295023.xml +253 -0
  250. pychpp-0.6.2/tests/test_resources/file=teamdetails&version=4.0.xml +137 -0
  251. pychpp-0.6.2/tests/test_resources/file=teamhistory&version=1.0&teamId=1165592.xml +415 -0
  252. pychpp-0.6.2/tests/test_resources/file=tournamentdetails&version=1.0&season=23&tournamentId=3116071.xml +24 -0
  253. pychpp-0.6.2/tests/test_resources/file=tournamentfixtures&version=1.0&tournamentId=3116071.xml +1142 -0
  254. pychpp-0.6.2/tests/test_resources/file=tournamentfixtures&version=1.1&matchRound=9&tournamentId=3116071.xml +584 -0
  255. pychpp-0.6.2/tests/test_resources/file=tournamentleaguetables&version=1.1&tournamentId=5292015.xml +176 -0
  256. pychpp-0.6.2/tests/test_resources/file=tournamentlist&version=1.0&teamId=1758305.xml +26 -0
  257. pychpp-0.6.2/tests/test_resources/file=training&version=2.2&actionType=view&teamId=1165592.xml +37 -0
  258. pychpp-0.6.2/tests/test_resources/file=training&version=2.3&actionType=view&teamId=1165592.xml +36 -0
  259. pychpp-0.6.2/tests/test_resources/file=trainingevents&version=1.3&playerID=456732884.xml +48 -0
  260. pychpp-0.6.2/tests/test_resources/file=transfersearch&version=1.1&ageMax=22&ageMin=20&maxSkillValue1=9&minSkillValue1=7&skillType1=8.xml +937 -0
  261. pychpp-0.6.2/tests/test_resources/file=transfersearch&version=1.2&ageMax=22&ageMin=20&maxSkillValue1=9&minSkillValue1=7&salaryMax=10000&skillType1=8.xml +923 -0
  262. pychpp-0.6.2/tests/test_resources/file=transfersplayer&version=1.1&playerID=427947863.xml +43 -0
  263. pychpp-0.6.2/tests/test_resources/file=transfersteam&version=1.2&pageIndex=1&teamID=940.xml +498 -0
  264. pychpp-0.6.2/tests/test_resources/file=translations&version=1.2&languageId=5.xml +993 -0
  265. pychpp-0.6.2/tests/test_resources/file=worldcup&version=1.1&actionType=viewGroups&season=76.xml +125 -0
  266. pychpp-0.6.2/tests/test_resources/file=worldcup&version=1.1&actionType=viewMatches&cupSeriesUnitID=1697&season=76.xml +128 -0
  267. pychpp-0.6.2/tests/test_resources/file=worlddetails&version=1.9&includeRegions=True&leagueID=25.xml +239 -0
  268. pychpp-0.6.2/tests/test_resources/file=worlddetails&version=1.9.xml +14527 -0
  269. pychpp-0.6.2/tests/test_resources/file=worlddetails&version=2.1&leagueID=25.xml +141 -0
  270. pychpp-0.6.2/tests/test_resources/file=worldlanguages&version=1.2.xml +228 -0
  271. pychpp-0.6.2/tests/test_resources/file=youthavatars&version=1.2.xml +497 -0
  272. pychpp-0.6.2/tests/test_resources/file=youthleaguedetails&version=1.0.xml +66 -0
  273. pychpp-0.6.2/tests/test_resources/file=youthleaguedetails&version=1.1.xml +67 -0
  274. pychpp-0.6.2/tests/test_resources/file=youthleaguefixtures&version=1.0&youthleagueid=251460.xml +2030 -0
  275. pychpp-0.6.2/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=301741211.xml +52 -0
  276. pychpp-0.6.2/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=384579961.xml +36 -0
  277. pychpp-0.6.2/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=395385356.xml +36 -0
  278. pychpp-0.6.2/tests/test_resources/file=youthplayerdetails&version=1.2&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=395583001.xml +36 -0
  279. pychpp-0.6.2/tests/test_resources/file=youthplayerdetails&version=1.4&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=301741224.xml +54 -0
  280. pychpp-0.6.2/tests/test_resources/file=youthplayerdetails&version=1.4&actionType=details&showLastMatch=False&showScoutCall=False&youthPlayerID=449911155.xml +38 -0
  281. pychpp-0.6.2/tests/test_resources/file=youthplayerlist&version=1.4&actionType=details.xml +680 -0
  282. pychpp-0.6.2/tests/test_resources/file=youthplayerlist&version=1.4&actionType=list.xml +106 -0
  283. pychpp-0.6.2/tests/test_resources/file=youthteamdetails&version=1.2&youthTeamID=2745926.xml +38 -0
  284. pychpp-0.6.2/tests/test_resources/file=youthteamdetails&version=1.2&youthTeamID=3147468.xml +34 -0
  285. pychpp-0.6.2/tests/test_resources/file=youthteamdetails&version=1.5&youthTeamID=2942691.xml +41 -0
  286. pychpp-0.6.2/tests/test_xml_achievements.py +89 -0
  287. pychpp-0.6.2/tests/test_xml_alliance_details.py +42 -0
  288. pychpp-0.6.2/tests/test_xml_alliances.py +52 -0
  289. pychpp-0.6.2/tests/test_xml_avatars.py +21 -0
  290. pychpp-0.6.2/tests/test_xml_bookmarks.py +16 -0
  291. pychpp-0.6.2/tests/test_xml_club.py +21 -0
  292. pychpp-0.6.2/tests/test_xml_cup_matches.py +29 -0
  293. pychpp-0.6.2/tests/test_xml_current_bids.py +29 -0
  294. pychpp-0.6.2/tests/test_xml_economy.py +51 -0
  295. pychpp-0.6.2/tests/test_xml_fans.py +46 -0
  296. pychpp-0.6.2/tests/test_xml_hof_players.py +57 -0
  297. pychpp-0.6.2/tests/test_xml_ladder_details.py +29 -0
  298. pychpp-0.6.2/tests/test_xml_ladder_list.py +18 -0
  299. pychpp-0.6.2/tests/test_xml_league_fixtures.py +23 -0
  300. pychpp-0.6.2/tests/test_xml_league_levels.py +23 -0
  301. pychpp-0.6.2/tests/test_xml_live.py +132 -0
  302. pychpp-0.6.2/tests/test_xml_manager_compendium.py +54 -0
  303. pychpp-0.6.2/tests/test_xml_match_details.py +103 -0
  304. pychpp-0.6.2/tests/test_xml_match_lineup.py +66 -0
  305. pychpp-0.6.2/tests/test_xml_match_orders.py +41 -0
  306. pychpp-0.6.2/tests/test_xml_matches.py +87 -0
  307. pychpp-0.6.2/tests/test_xml_matches_archive.py +39 -0
  308. pychpp-0.6.2/tests/test_xml_national_players.py +19 -0
  309. pychpp-0.6.2/tests/test_xml_national_prospect_players.py +24 -0
  310. pychpp-0.6.2/tests/test_xml_national_team_details.py +40 -0
  311. pychpp-0.6.2/tests/test_xml_national_team_matches.py +23 -0
  312. pychpp-0.6.2/tests/test_xml_national_teams.py +17 -0
  313. pychpp-0.6.2/tests/test_xml_player_events.py +19 -0
  314. pychpp-0.6.2/tests/test_xml_player_stats.py +53 -0
  315. pychpp-0.6.2/tests/test_xml_players.py +39 -0
  316. pychpp-0.6.2/tests/test_xml_players_details.py +85 -0
  317. pychpp-0.6.2/tests/test_xml_search.py +21 -0
  318. pychpp-0.6.2/tests/test_xml_staff_avatars.py +17 -0
  319. pychpp-0.6.2/tests/test_xml_staff_list.py +51 -0
  320. pychpp-0.6.2/tests/test_xml_supporters.py +84 -0
  321. pychpp-0.6.2/tests/test_xml_team_details.py +220 -0
  322. pychpp-0.6.2/tests/test_xml_team_history.py +52 -0
  323. pychpp-0.6.2/tests/test_xml_tournament_details.py +22 -0
  324. pychpp-0.6.2/tests/test_xml_tournament_fixtures.py +46 -0
  325. pychpp-0.6.2/tests/test_xml_tournament_league_tables.py +22 -0
  326. pychpp-0.6.2/tests/test_xml_tournament_list.py +24 -0
  327. pychpp-0.6.2/tests/test_xml_training.py +75 -0
  328. pychpp-0.6.2/tests/test_xml_training_events.py +19 -0
  329. pychpp-0.6.2/tests/test_xml_transfer_search.py +85 -0
  330. pychpp-0.6.2/tests/test_xml_transfers_player.py +21 -0
  331. pychpp-0.6.2/tests/test_xml_transfers_team.py +46 -0
  332. pychpp-0.6.2/tests/test_xml_translations.py +49 -0
  333. pychpp-0.6.2/tests/test_xml_world_cup.py +40 -0
  334. pychpp-0.6.2/tests/test_xml_world_details.py +36 -0
  335. pychpp-0.6.2/tests/test_xml_world_languages.py +7 -0
  336. pychpp-0.6.2/tests/test_xml_youth_avatars.py +13 -0
  337. pychpp-0.6.2/tests/test_xml_youth_league_details.py +39 -0
  338. pychpp-0.6.2/tests/test_xml_youth_league_fixtures.py +29 -0
  339. pychpp-0.6.2/tests/test_xml_youth_player_details.py +133 -0
  340. pychpp-0.6.2/tests/test_xml_youth_player_list.py +26 -0
  341. pychpp-0.6.2/tests/test_xml_youth_team_details.py +25 -0
  342. pychpp-0.6.2/uv.lock +979 -0
  343. pychpp-0.6.2/zensical.toml +64 -0
  344. pychpp-0.6.0/pychpp/chpp.py +0 -1365
  345. pychpp-0.6.0/pychpp/fixtures/__init__.py +0 -0
  346. pychpp-0.6.0/pychpp/fixtures/ht_error.py +0 -87
  347. pychpp-0.6.0/pychpp/models/__init__.py +0 -0
  348. pychpp-0.6.0/pychpp/models/custom/base/__init__.py +0 -0
  349. pychpp-0.6.0/pychpp/models/ht_field.py +0 -32
  350. pychpp-0.6.0/pychpp/models/ht_init_var.py +0 -10
  351. pychpp-0.6.0/pychpp/models/xml/__init__.py +0 -0
  352. pychpp-0.6.0/pyproject.toml +0 -24
  353. {pychpp-0.6.0 → pychpp-0.6.2}/LICENSE +0 -0
@@ -0,0 +1,8 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .env
6
+ .idea/
7
+ dist/
8
+ site/
@@ -0,0 +1,42 @@
1
+ image: "python:3.11"
2
+
3
+ before_script:
4
+ - echo PYCHPP_CONSUMER_KEY=$PYCHPP_CONSUMER_KEY >> .env
5
+ - echo PYCHPP_CONSUMER_SECRET=$PYCHPP_CONSUMER_SECRET >> .env
6
+ - echo PYCHPP_ACCESS_TOKEN_KEY=$PYCHPP_ACCESS_TOKEN_KEY >> .env
7
+ - echo PYCHPP_ACCESS_TOKEN_SECRET=$PYCHPP_ACCESS_TOKEN_SECRET >> .env
8
+ - echo PYCHPP_SCOPE=$PYCHPP_SCOPE >> .env
9
+ - pip install uv
10
+ - uv sync --frozen
11
+
12
+ stages:
13
+ - test
14
+ - docs
15
+ - deploy
16
+
17
+ style:
18
+ stage: test
19
+ script: uv run ruff check
20
+
21
+ test:
22
+ stage: test
23
+ script: uv run pytest
24
+
25
+ pages:
26
+ stage: docs
27
+ only: [master]
28
+ script:
29
+ - uv sync --group docs --frozen
30
+ - uv run zensical build
31
+ - rm -rf public
32
+ - mv site public
33
+ artifacts:
34
+ paths:
35
+ - public
36
+
37
+ deploy:
38
+ stage: deploy
39
+ only: [master]
40
+ script:
41
+ - uv build
42
+ - uv publish --token $PYCHPP_PYPI_TOKEN
@@ -0,0 +1 @@
1
+ 3.11
@@ -1,24 +1,15 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: pychpp
3
- Version: 0.6.0
3
+ Version: 0.6.2
4
4
  Summary: framework created to use the API provided by the online game Hattrick
5
- License: Apache-2.0
6
- License-File: LICENSE
7
- Author: Pierre Gobin
8
- Author-email: p.dev@gobin.cc
9
- Requires-Python: >=3.9,<4.0
10
- Classifier: License :: OSI Approved :: Apache Software License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Programming Language :: Python :: 3.13
17
- Classifier: Programming Language :: Python :: 3.14
18
- Requires-Dist: Werkzeug (>=3.1.3,<4.0.0)
19
- Requires-Dist: pytz (>=2025.1,<2026.0)
20
- Requires-Dist: requests-oauthlib (>=2.0.0,<3.0.0)
21
5
  Project-URL: Homepage, https://framagit.org/Pierre86/pychpp
6
+ Author-email: Pierre Gobin <p.dev@gobin.cc>
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Requires-Python: >=3.11
10
+ Requires-Dist: pytz>=2025.1
11
+ Requires-Dist: requests-oauthlib>=2.0.0
12
+ Requires-Dist: werkzeug>=3.1.3
22
13
  Description-Content-Type: text/markdown
23
14
 
24
15
  # pyCHPP
@@ -233,6 +224,14 @@ The following table shows the CHPP XML files that are currently supported:
233
224
  | YouthPlayerList | `youthplayerlist.xml` |
234
225
  | YouthTeamDetails | `youthteamdetails.xml` |
235
226
 
227
+ ## Development
228
+
229
+ This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies and the virtual environment:
230
+
231
+ uv sync # create .venv and install dependencies (Python version from .python-version)
232
+ uv run pytest tests/
233
+ uv run ruff check
234
+ uv lock --upgrade && uv sync # update all dependencies to their latest compatible versions
235
+
236
236
  ## License
237
237
  pyCHPP is licensed under the Apache License 2.0.
238
-
@@ -210,5 +210,14 @@ The following table shows the CHPP XML files that are currently supported:
210
210
  | YouthPlayerList | `youthplayerlist.xml` |
211
211
  | YouthTeamDetails | `youthteamdetails.xml` |
212
212
 
213
+ ## Development
214
+
215
+ This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies and the virtual environment:
216
+
217
+ uv sync # create .venv and install dependencies (Python version from .python-version)
218
+ uv run pytest tests/
219
+ uv run ruff check
220
+ uv lock --upgrade && uv sync # update all dependencies to their latest compatible versions
221
+
213
222
  ## License
214
223
  pyCHPP is licensed under the Apache License 2.0.
@@ -0,0 +1,3 @@
1
+ # CHPP client
2
+
3
+ ::: pychpp.chpp
@@ -0,0 +1,5 @@
1
+ # Fixtures
2
+
3
+ ::: pychpp.fixtures.ht_datetime
4
+
5
+ ::: pychpp.fixtures.ht_error
@@ -0,0 +1,5 @@
1
+ # API reference
2
+
3
+ - [CHPP client](chpp.md): the `CHPP` class, entry point of pyCHPP, with all `xml_*()` methods
4
+ - [Models](models.md): base classes (`HTModel`, `HTField`, ...), XML models and custom models
5
+ - [Fixtures](fixtures.md): `HTDatetime` and the `ht_error` exceptions
@@ -0,0 +1,23 @@
1
+ # Models
2
+
3
+ ## Base classes
4
+
5
+ ::: pychpp.models.ht_model
6
+
7
+ ::: pychpp.models.ht_field
8
+
9
+ ::: pychpp.models.ht_xml
10
+
11
+ ::: pychpp.models.ht_init_var
12
+
13
+ ::: pychpp.models.ht_version
14
+
15
+ ## Custom models
16
+
17
+ ::: pychpp.models.custom.ht_team
18
+
19
+ ::: pychpp.models.custom.ht_player
20
+
21
+ ::: pychpp.models.custom.ht_match
22
+
23
+ ::: pychpp.models.custom.ht_user
@@ -0,0 +1,50 @@
1
+ # Authentication
2
+
3
+ pyCHPP uses the OAuth 1.0a flow of the Hattrick CHPP API.
4
+
5
+ ## First connection: obtain an access token
6
+
7
+ ```python
8
+ from pychpp import CHPP
9
+
10
+ chpp = CHPP(consumer_key, consumer_secret)
11
+
12
+ # Get the authorization url and the request token
13
+ auth = chpp.get_auth(callback_url="www.mycallbackurl.com", scope="")
14
+
15
+ # Redirect the user to auth["url"] so they can grant your app access.
16
+ # Once they have entered their credentials, Hattrick returns a code
17
+ # (directly or to the callback url).
18
+ code = "..."
19
+
20
+ # Exchange the request token + code for an access token
21
+ access_token = chpp.get_access_token(
22
+ request_token=auth["oauth_token"],
23
+ request_token_secret=auth["oauth_token_secret"],
24
+ code=code,
25
+ )
26
+
27
+ # access_token["key"] and access_token["secret"] must be stored
28
+ # to be reused for this user later.
29
+ ```
30
+
31
+ ### Scopes
32
+
33
+ `scope` can be a string or a list, among:
34
+ `"manage_challenges"`, `"set_matchorder"`, `"manage_youthplayers"`,
35
+ `"set_training"`, `"place_bid"`. An empty scope gives read-only access.
36
+
37
+ ## Further connections
38
+
39
+ Once you have stored the access token of a user:
40
+
41
+ ```python
42
+ chpp = CHPP(consumer_key, consumer_secret,
43
+ access_token["key"], access_token["secret"])
44
+
45
+ # Check that the token is still valid
46
+ chpp.check_token()
47
+
48
+ # Invalidate the token when the user disconnects
49
+ chpp.invalidate_token()
50
+ ```
@@ -0,0 +1,26 @@
1
+ # Error handling
2
+
3
+ When the CHPP API returns an error (`chpperror.xml`), pyCHPP raises a dedicated
4
+ exception from `pychpp.fixtures.ht_error`, subclass of `HTError`:
5
+
6
+ ```python
7
+ from pychpp import CHPP
8
+ from pychpp.fixtures import ht_error
9
+
10
+ chpp = CHPP(consumer_key, consumer_secret, token_key, token_secret)
11
+
12
+ try:
13
+ team = chpp.team(1165592)
14
+ except ht_error.HTUnauthorizedAction:
15
+ # 401: missing/invalid scope or credentials
16
+ ...
17
+ except ht_error.HTUnknownTeamIdError:
18
+ # error code 50: unknown team id
19
+ ...
20
+ except ht_error.HTError as e:
21
+ # any other CHPP error (HTAccessDeniedError, HTChallengeError, ...)
22
+ ...
23
+ ```
24
+
25
+ Invalid arguments (wrong types, unknown `action_type`, ...) raise a plain
26
+ `ValueError`.
@@ -0,0 +1,40 @@
1
+ # Examples
2
+
3
+ ## High-level custom models
4
+
5
+ ```python
6
+ >>> current_user = chpp.user()
7
+ >>> all_teams = current_user.teams
8
+
9
+ >>> team = chpp.team(1165592)
10
+ >>> team
11
+ <HTTeam object - Les Poitevins de La Chapelle (1165592)>
12
+
13
+ >>> team.arena.details()
14
+ <HTArena object - Stade de La Chapelle (1162154)>
15
+
16
+ >>> player = chpp.player(6993859)
17
+ >>> player.career_goals
18
+ 1167
19
+
20
+ >>> match = chpp.match(68599186)
21
+ >>> match.date
22
+ <HTDatetime object - 2006-02-23 20:00:00 CET+0100 (S28, W8, D4)>
23
+ ```
24
+
25
+ Custom models allow navigating between objects, e.g. `team.players()` returns
26
+ the team's players.
27
+
28
+ ## Raw XML models
29
+
30
+ Each CHPP XML file has a matching model under `pychpp.models.xml`, fetched
31
+ through the `xml_*()` methods of the `CHPP` instance:
32
+
33
+ ```python
34
+ >>> xml_arena = chpp.xml_arena_details(arena_id=294762)
35
+ >>> xml_arena
36
+ <ArenaDetails object - Stade Dimitri Liénard (294762)>
37
+ ```
38
+
39
+ See the [CHPP client API reference](../api/chpp.md) for the full list of
40
+ `xml_*()` methods and their parameters.
@@ -0,0 +1,22 @@
1
+ # Installation
2
+
3
+ pyCHPP requires **Python >= 3.11**.
4
+
5
+ With pip:
6
+
7
+ ```bash
8
+ pip install pychpp
9
+ ```
10
+
11
+ With [uv](https://docs.astral.sh/uv/):
12
+
13
+ ```bash
14
+ uv add pychpp
15
+ ```
16
+
17
+ ## CHPP application credentials
18
+
19
+ To use the CHPP API, you first need to register an application on Hattrick
20
+ (CHPP portal) to obtain a **consumer key** and a **consumer secret**.
21
+ These are passed to the `CHPP` constructor together with the user access token
22
+ (see [Authentication](authentication.md)).
@@ -0,0 +1,28 @@
1
+ # pyCHPP
2
+
3
+ pyCHPP is an object-oriented Python framework for the [Hattrick](https://www.hattrick.org) CHPP API.
4
+
5
+ It provides:
6
+
7
+ - a `CHPP` client class with one `xml_*()` method per CHPP XML file (e.g. `xml_arena_details()` fetches `arenadetails.xml`),
8
+ - high-level custom models (`HTTeam`, `HTPlayer`, `HTMatch`, ...) that allow navigating between objects (e.g. `team.players()`).
9
+
10
+ ## Quick start
11
+
12
+ ```python
13
+ from pychpp import CHPP
14
+
15
+ chpp = CHPP(consumer_key, consumer_secret, access_token_key, access_token_secret)
16
+
17
+ user = chpp.user() # the authenticated user
18
+ team = chpp.team() # the user's primary team
19
+ players = chpp.xml_players(team_id=team.team_id)
20
+ ```
21
+
22
+ ## Next steps
23
+
24
+ - [Installation](guide/installation.md)
25
+ - [Authentication (OAuth flow)](guide/authentication.md)
26
+ - [Error handling](guide/errors.md)
27
+ - [Examples](guide/examples.md)
28
+ - [API reference](api/index.md)