ffbb-data-client 2.0.0__py3-none-any.whl

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 (207) hide show
  1. ffbb_api_client_v3/__init__.py +25 -0
  2. ffbb_data_client/__init__.py +175 -0
  3. ffbb_data_client/clients/__init__.py +13 -0
  4. ffbb_data_client/clients/api_ffbb_app_client.py +2475 -0
  5. ffbb_data_client/clients/ffbb_data_client.py +2789 -0
  6. ffbb_data_client/clients/meilisearch_client.py +218 -0
  7. ffbb_data_client/clients/meilisearch_ffbb_client.py +647 -0
  8. ffbb_data_client/config.py +153 -0
  9. ffbb_data_client/data/__init__.py +25 -0
  10. ffbb_data_client/data/collections.json +1364 -0
  11. ffbb_data_client/data/endpoint_discovery.json +1875 -0
  12. ffbb_data_client/data/indexes.json +501 -0
  13. ffbb_data_client/data/openapi.json +35713 -0
  14. ffbb_data_client/data/openapi_full.json +37622 -0
  15. ffbb_data_client/helpers/__init__.py +27 -0
  16. ffbb_data_client/helpers/http_requests_helper.py +73 -0
  17. ffbb_data_client/helpers/http_requests_utils.py +502 -0
  18. ffbb_data_client/helpers/meilisearch_client_extension.py +153 -0
  19. ffbb_data_client/helpers/multi_search_query_helper.py +35 -0
  20. ffbb_data_client/models/__init__.py +241 -0
  21. ffbb_data_client/models/affiche.py +45 -0
  22. ffbb_data_client/models/cartographie.py +82 -0
  23. ffbb_data_client/models/categorie.py +55 -0
  24. ffbb_data_client/models/categorie_type.py +42 -0
  25. ffbb_data_client/models/clock.py +38 -0
  26. ffbb_data_client/models/club_contacts.py +77 -0
  27. ffbb_data_client/models/code.py +7 -0
  28. ffbb_data_client/models/commune.py +66 -0
  29. ffbb_data_client/models/competition_fields.py +309 -0
  30. ffbb_data_client/models/competition_id.py +116 -0
  31. ffbb_data_client/models/competition_id_categorie.py +31 -0
  32. ffbb_data_client/models/competition_id_sexe.py +31 -0
  33. ffbb_data_client/models/competition_id_type_competition.py +27 -0
  34. ffbb_data_client/models/competition_id_type_competition_generique.py +24 -0
  35. ffbb_data_client/models/competition_origine.py +69 -0
  36. ffbb_data_client/models/competition_origine_categorie.py +23 -0
  37. ffbb_data_client/models/competition_origine_type_competition.py +14 -0
  38. ffbb_data_client/models/competition_origine_type_competition_generique.py +24 -0
  39. ffbb_data_client/models/competition_type.py +6 -0
  40. ffbb_data_client/models/competitions_facet_distribution.py +65 -0
  41. ffbb_data_client/models/competitions_facet_stats.py +14 -0
  42. ffbb_data_client/models/competitions_hit.py +232 -0
  43. ffbb_data_client/models/competitions_multi_search_query.py +40 -0
  44. ffbb_data_client/models/competitions_query.py +11 -0
  45. ffbb_data_client/models/configuration_models.py +5 -0
  46. ffbb_data_client/models/contact_info.py +18 -0
  47. ffbb_data_client/models/content_multi_search_query.py +93 -0
  48. ffbb_data_client/models/coordonnees.py +27 -0
  49. ffbb_data_client/models/coordonnees_type.py +5 -0
  50. ffbb_data_client/models/document_flyer.py +205 -0
  51. ffbb_data_client/models/document_flyer_type.py +6 -0
  52. ffbb_data_client/models/engagement_contacts.py +97 -0
  53. ffbb_data_client/models/engagements_facet_distribution.py +59 -0
  54. ffbb_data_client/models/engagements_facet_stats.py +14 -0
  55. ffbb_data_client/models/engagements_hit.py +192 -0
  56. ffbb_data_client/models/engagements_multi_search_query.py +41 -0
  57. ffbb_data_client/models/etat.py +6 -0
  58. ffbb_data_client/models/external_competition_id.py +42 -0
  59. ffbb_data_client/models/external_id.py +72 -0
  60. ffbb_data_client/models/facet_distribution.py +13 -0
  61. ffbb_data_client/models/facet_stats.py +13 -0
  62. ffbb_data_client/models/field_set.py +10 -0
  63. ffbb_data_client/models/folder.py +35 -0
  64. ffbb_data_client/models/formation_session.py +60 -0
  65. ffbb_data_client/models/formations_facet_distribution.py +61 -0
  66. ffbb_data_client/models/formations_facet_stats.py +14 -0
  67. ffbb_data_client/models/formations_hit.py +277 -0
  68. ffbb_data_client/models/formations_multi_search_query.py +41 -0
  69. ffbb_data_client/models/game_stats_model.py +57 -0
  70. ffbb_data_client/models/game_stats_models.py +5 -0
  71. ffbb_data_client/models/generic_search.py +92 -0
  72. ffbb_data_client/models/geo.py +27 -0
  73. ffbb_data_client/models/geo_sort_order.py +6 -0
  74. ffbb_data_client/models/get_commune_response.py +18 -0
  75. ffbb_data_client/models/get_competition_response.py +523 -0
  76. ffbb_data_client/models/get_configuration_response.py +45 -0
  77. ffbb_data_client/models/get_engagement_response.py +23 -0
  78. ffbb_data_client/models/get_entraineur_response.py +18 -0
  79. ffbb_data_client/models/get_formation_response.py +28 -0
  80. ffbb_data_client/models/get_officiel_response.py +18 -0
  81. ffbb_data_client/models/get_organisme_response.py +476 -0
  82. ffbb_data_client/models/get_poule_response.py +68 -0
  83. ffbb_data_client/models/get_pratique_response.py +18 -0
  84. ffbb_data_client/models/get_rencontre_response.py +93 -0
  85. ffbb_data_client/models/get_saisons_response.py +56 -0
  86. ffbb_data_client/models/get_salle_response.py +20 -0
  87. ffbb_data_client/models/get_terrain_response.py +16 -0
  88. ffbb_data_client/models/get_tournoi_response.py +16 -0
  89. ffbb_data_client/models/gradient_color.py +27 -0
  90. ffbb_data_client/models/hit.py +16 -0
  91. ffbb_data_client/models/id_engagement_equipe.py +32 -0
  92. ffbb_data_client/models/id_organisme_equipe.py +51 -0
  93. ffbb_data_client/models/id_organisme_equipe1_logo.py +28 -0
  94. ffbb_data_client/models/id_poule.py +27 -0
  95. ffbb_data_client/models/jour.py +11 -0
  96. ffbb_data_client/models/label.py +15 -0
  97. ffbb_data_client/models/labellisation.py +30 -0
  98. ffbb_data_client/models/live.py +192 -0
  99. ffbb_data_client/models/lives.py +6 -0
  100. ffbb_data_client/models/logo.py +28 -0
  101. ffbb_data_client/models/multi_search_queries.py +24 -0
  102. ffbb_data_client/models/multi_search_query.py +96 -0
  103. ffbb_data_client/models/multi_search_result_competitions.py +14 -0
  104. ffbb_data_client/models/multi_search_result_engagements.py +14 -0
  105. ffbb_data_client/models/multi_search_result_formations.py +12 -0
  106. ffbb_data_client/models/multi_search_result_organismes.py +12 -0
  107. ffbb_data_client/models/multi_search_result_pratiques.py +12 -0
  108. ffbb_data_client/models/multi_search_result_rencontres.py +12 -0
  109. ffbb_data_client/models/multi_search_result_salles.py +12 -0
  110. ffbb_data_client/models/multi_search_result_terrains.py +12 -0
  111. ffbb_data_client/models/multi_search_result_tournois.py +12 -0
  112. ffbb_data_client/models/multi_search_results.py +103 -0
  113. ffbb_data_client/models/multi_search_results_class.py +96 -0
  114. ffbb_data_client/models/nature_sol.py +57 -0
  115. ffbb_data_client/models/niveau.py +10 -0
  116. ffbb_data_client/models/niveau_class.py +27 -0
  117. ffbb_data_client/models/niveau_extractor.py +214 -0
  118. ffbb_data_client/models/niveau_info.py +64 -0
  119. ffbb_data_client/models/niveau_models.py +14 -0
  120. ffbb_data_client/models/niveau_type.py +10 -0
  121. ffbb_data_client/models/objectif.py +7 -0
  122. ffbb_data_client/models/organisateur.py +197 -0
  123. ffbb_data_client/models/organisateur_type.py +6 -0
  124. ffbb_data_client/models/organisme_fields.py +327 -0
  125. ffbb_data_client/models/organisme_id_pere.py +177 -0
  126. ffbb_data_client/models/organismes_facet_distribution.py +46 -0
  127. ffbb_data_client/models/organismes_facet_stats.py +14 -0
  128. ffbb_data_client/models/organismes_hit.py +196 -0
  129. ffbb_data_client/models/organismes_multi_search_query.py +41 -0
  130. ffbb_data_client/models/organismes_query.py +8 -0
  131. ffbb_data_client/models/phase_code.py +23 -0
  132. ffbb_data_client/models/poule.py +35 -0
  133. ffbb_data_client/models/poule_fields.py +261 -0
  134. ffbb_data_client/models/poule_rencontre_item_model.py +69 -0
  135. ffbb_data_client/models/poules_models.py +6 -0
  136. ffbb_data_client/models/poules_query.py +9 -0
  137. ffbb_data_client/models/pratique.py +7 -0
  138. ffbb_data_client/models/pratiques_facet_distribution.py +29 -0
  139. ffbb_data_client/models/pratiques_facet_stats.py +14 -0
  140. ffbb_data_client/models/pratiques_hit.py +310 -0
  141. ffbb_data_client/models/pratiques_hit_type.py +9 -0
  142. ffbb_data_client/models/pratiques_multi_search_query.py +41 -0
  143. ffbb_data_client/models/pratiques_type_class.py +45 -0
  144. ffbb_data_client/models/publication_internet.py +6 -0
  145. ffbb_data_client/models/purple_logo.py +24 -0
  146. ffbb_data_client/models/query_fields_manager.py +75 -0
  147. ffbb_data_client/models/ranking_engagement.py +41 -0
  148. ffbb_data_client/models/rankings_models.py +6 -0
  149. ffbb_data_client/models/rencontres_engagement.py +23 -0
  150. ffbb_data_client/models/rencontres_facet_distribution.py +65 -0
  151. ffbb_data_client/models/rencontres_facet_stats.py +14 -0
  152. ffbb_data_client/models/rencontres_hit.py +271 -0
  153. ffbb_data_client/models/rencontres_multi_search_query.py +41 -0
  154. ffbb_data_client/models/saison.py +23 -0
  155. ffbb_data_client/models/saison_fields.py +36 -0
  156. ffbb_data_client/models/saisons_models.py +6 -0
  157. ffbb_data_client/models/saisons_query.py +9 -0
  158. ffbb_data_client/models/salle.py +56 -0
  159. ffbb_data_client/models/salles_facet_distribution.py +14 -0
  160. ffbb_data_client/models/salles_facet_stats.py +14 -0
  161. ffbb_data_client/models/salles_hit.py +153 -0
  162. ffbb_data_client/models/salles_multi_search_query.py +40 -0
  163. ffbb_data_client/models/sexe.py +9 -0
  164. ffbb_data_client/models/sexe_class.py +31 -0
  165. ffbb_data_client/models/source.py +5 -0
  166. ffbb_data_client/models/status.py +5 -0
  167. ffbb_data_client/models/team_engagement.py +56 -0
  168. ffbb_data_client/models/team_ranking.py +108 -0
  169. ffbb_data_client/models/terrains_categorie_championnat_3x3_libelle.py +5 -0
  170. ffbb_data_client/models/terrains_facet_distribution.py +41 -0
  171. ffbb_data_client/models/terrains_facet_stats.py +14 -0
  172. ffbb_data_client/models/terrains_hit.py +223 -0
  173. ffbb_data_client/models/terrains_multi_search_query.py +42 -0
  174. ffbb_data_client/models/terrains_name.py +5 -0
  175. ffbb_data_client/models/terrains_sexe_enum.py +7 -0
  176. ffbb_data_client/models/terrains_storage.py +5 -0
  177. ffbb_data_client/models/tournoi_type_class.py +35 -0
  178. ffbb_data_client/models/tournoi_type_enum.py +7 -0
  179. ffbb_data_client/models/tournoi_types_3x3.py +43 -0
  180. ffbb_data_client/models/tournoi_types_3x3_libelle.py +60 -0
  181. ffbb_data_client/models/tournoi_types_3x3_libelle_enum.py +10 -0
  182. ffbb_data_client/models/tournois_facet_distribution.py +41 -0
  183. ffbb_data_client/models/tournois_facet_stats.py +14 -0
  184. ffbb_data_client/models/tournois_hit.py +132 -0
  185. ffbb_data_client/models/tournois_hit_type.py +5 -0
  186. ffbb_data_client/models/tournois_libelle.py +7 -0
  187. ffbb_data_client/models/tournois_multi_search_query.py +40 -0
  188. ffbb_data_client/models/type_association.py +23 -0
  189. ffbb_data_client/models/type_association_libelle.py +30 -0
  190. ffbb_data_client/models/type_class.py +23 -0
  191. ffbb_data_client/models/type_competition.py +8 -0
  192. ffbb_data_client/models/type_competition_generique.py +31 -0
  193. ffbb_data_client/models/type_enum.py +7 -0
  194. ffbb_data_client/models/type_league.py +6 -0
  195. ffbb_data_client/py.typed +0 -0
  196. ffbb_data_client/utils/__init__.py +27 -0
  197. ffbb_data_client/utils/cache_manager.py +393 -0
  198. ffbb_data_client/utils/converter_utils.py +329 -0
  199. ffbb_data_client/utils/input_validation.py +360 -0
  200. ffbb_data_client/utils/retry_utils.py +478 -0
  201. ffbb_data_client/utils/secure_logging.py +153 -0
  202. ffbb_data_client/utils/token_manager.py +115 -0
  203. ffbb_data_client-2.0.0.dist-info/METADATA +339 -0
  204. ffbb_data_client-2.0.0.dist-info/RECORD +207 -0
  205. ffbb_data_client-2.0.0.dist-info/WHEEL +5 -0
  206. ffbb_data_client-2.0.0.dist-info/licenses/LICENSE.txt +201 -0
  207. ffbb_data_client-2.0.0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,196 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass, field
4
+ from datetime import datetime
5
+ from typing import Any
6
+
7
+ from ..utils.converter_utils import (
8
+ from_bool,
9
+ from_datetime,
10
+ from_list,
11
+ from_obj,
12
+ from_str,
13
+ )
14
+ from .cartographie import Cartographie
15
+ from .commune import Commune
16
+ from .geo import Geo
17
+ from .hit import Hit
18
+ from .logo import Logo
19
+ from .organisme_id_pere import OrganismeIDPere
20
+ from .type_association import TypeAssociation
21
+
22
+
23
+ @dataclass
24
+ class OrganismesHit(Hit):
25
+ nom_club_pro: str | None = None
26
+ nom: str | None = None
27
+ adresse: str | None = None
28
+ adresse_club_pro: str | None = None
29
+ code: str | None = None
30
+ id: str | None = None
31
+ engagements_noms: str | None = None
32
+ mail: str | None = None
33
+ telephone: str | None = None
34
+ type: str | None = None
35
+ url_site_web: str | None = None
36
+ nom_simple: str | None = None
37
+ date_affiliation: datetime | None = None
38
+ saison_en_cours: bool | None = None
39
+ offres_pratiques: list[str] | None = None
40
+ labellisation: list[str] | None = None
41
+ cartographie: Cartographie | None = None
42
+ organisme_id_pere: OrganismeIDPere | None = None
43
+ commune: Commune | None = None
44
+ commune_club_pro: Commune | None = None
45
+ type_association: TypeAssociation | None = None
46
+ logo: Logo | None = None
47
+ geo: Geo | None = None
48
+ thumbnail: str | None = None
49
+ lower_nom_club_pro: str | None = field(init=False, default=None, repr=False)
50
+ lower_nom: str | None = field(init=False, default=None, repr=False)
51
+ lower_engagements_noms: str | None = field(init=False, default=None, repr=False)
52
+
53
+ @property
54
+ def name(self) -> str | None:
55
+ """Alias for .nom — unified name accessor across all Hit types."""
56
+ return self.nom
57
+
58
+ def __post_init__(self) -> None:
59
+ self.lower_nom_club_pro = (
60
+ self.nom_club_pro.lower() if self.nom_club_pro else None
61
+ )
62
+ self.lower_nom = self.nom.lower() if self.nom else None
63
+ self.lower_engagements_noms = (
64
+ self.engagements_noms.lower() if self.engagements_noms else None
65
+ )
66
+
67
+ @staticmethod
68
+ def from_dict(obj: Any) -> OrganismesHit:
69
+ try:
70
+ assert isinstance(obj, dict)
71
+ nom_club_pro = from_str(obj, "nomClubPro")
72
+ nom = from_str(obj, "nom")
73
+ adresse = from_str(obj, "adresse")
74
+ adresse_club_pro = from_str(obj, "adresseClubPro")
75
+ code = from_str(obj, "code")
76
+ id = from_str(obj, "id")
77
+ engagements_noms = from_str(obj, "engagements_noms")
78
+ mail = from_str(obj, "mail")
79
+ telephone = from_str(obj, "telephone")
80
+ type = from_str(obj, "type")
81
+ url_site_web = from_str(obj, "urlSiteWeb")
82
+ nom_simple = from_str(obj, "nom_simple")
83
+ date_affiliation = from_datetime(obj, "dateAffiliation")
84
+ saison_en_cours = from_bool(obj, "saison_en_cours")
85
+ offres_pratiques = from_list(str, obj, "offresPratiques")
86
+ labellisation = from_list(str, obj, "labellisation")
87
+ cartographie = from_obj(Cartographie.from_dict, obj, "cartographie")
88
+ organisme_id_pere = from_obj(
89
+ OrganismeIDPere.from_dict, obj, "organisme_id_pere"
90
+ )
91
+ commune = from_obj(Commune.from_dict, obj, "commune")
92
+ commune_club_pro = from_obj(Commune.from_dict, obj, "communeClubPro")
93
+ type_association = from_obj(
94
+ TypeAssociation.from_dict, obj, "type_association"
95
+ )
96
+ logo = from_obj(Logo.from_dict, obj, "logo")
97
+ geo = from_obj(Geo.from_dict, obj, "_geo")
98
+ thumbnail = from_str(obj, "thumbnail")
99
+ return OrganismesHit(
100
+ nom_club_pro=nom_club_pro,
101
+ nom=nom,
102
+ adresse=adresse,
103
+ adresse_club_pro=adresse_club_pro,
104
+ code=code,
105
+ id=id,
106
+ engagements_noms=engagements_noms,
107
+ mail=mail,
108
+ telephone=telephone,
109
+ type=type,
110
+ url_site_web=url_site_web,
111
+ nom_simple=nom_simple,
112
+ date_affiliation=date_affiliation,
113
+ saison_en_cours=saison_en_cours,
114
+ offres_pratiques=offres_pratiques,
115
+ labellisation=labellisation,
116
+ cartographie=cartographie,
117
+ organisme_id_pere=organisme_id_pere,
118
+ commune=commune,
119
+ commune_club_pro=commune_club_pro,
120
+ type_association=type_association,
121
+ logo=logo,
122
+ geo=geo,
123
+ thumbnail=thumbnail,
124
+ )
125
+ except Exception as e:
126
+ raise ValueError(f"Invalid `OrganismesHit` object: {e}") from e
127
+
128
+ def to_dict(self) -> dict:
129
+ result: dict = {}
130
+ if self.nom_club_pro is not None:
131
+ result["nomClubPro"] = self.nom_club_pro
132
+ if self.nom is not None:
133
+ result["nom"] = self.nom
134
+ if self.adresse is not None:
135
+ result["adresse"] = self.adresse
136
+ if self.adresse_club_pro is not None:
137
+ result["adresseClubPro"] = self.adresse_club_pro
138
+ if self.code is not None:
139
+ result["code"] = self.code
140
+ if self.id is not None:
141
+ result["id"] = self.id
142
+ if self.engagements_noms is not None:
143
+ result["engagements_noms"] = self.engagements_noms
144
+ if self.mail is not None:
145
+ result["mail"] = self.mail
146
+ if self.telephone is not None:
147
+ result["telephone"] = self.telephone
148
+ if self.type is not None:
149
+ result["type"] = self.type
150
+ if self.url_site_web is not None:
151
+ result["urlSiteWeb"] = self.url_site_web
152
+ if self.nom_simple is not None:
153
+ result["nom_simple"] = self.nom_simple
154
+ if self.date_affiliation is not None:
155
+ result["dateAffiliation"] = self.date_affiliation.isoformat()
156
+ if self.saison_en_cours is not None:
157
+ result["saison_en_cours"] = self.saison_en_cours
158
+ if self.offres_pratiques is not None:
159
+ result["offresPratiques"] = self.offres_pratiques
160
+ if self.labellisation is not None:
161
+ result["labellisation"] = self.labellisation
162
+ if self.cartographie is not None:
163
+ result["cartographie"] = self.cartographie.to_dict()
164
+ if self.organisme_id_pere is not None:
165
+ result["organisme_id_pere"] = self.organisme_id_pere.to_dict()
166
+ if self.commune is not None:
167
+ result["commune"] = self.commune.to_dict()
168
+ if self.commune_club_pro is not None:
169
+ result["communeClubPro"] = self.commune_club_pro.to_dict()
170
+ if self.type_association is not None:
171
+ result["type_association"] = self.type_association.to_dict()
172
+ if self.logo is not None:
173
+ result["logo"] = self.logo.to_dict()
174
+ if self.geo is not None:
175
+ result["_geo"] = self.geo.to_dict()
176
+ if self.thumbnail is not None:
177
+ result["thumbnail"] = self.thumbnail
178
+ return result
179
+
180
+ def is_valid_for_query(self, query: str) -> bool:
181
+ return bool(
182
+ not query
183
+ or (self.lower_nom and query in self.lower_nom)
184
+ or (self.lower_nom_club_pro and query in self.lower_nom_club_pro)
185
+ or (self.lower_engagements_noms and query in self.lower_engagements_noms)
186
+ or (
187
+ self.commune
188
+ and (
189
+ (self.commune.lower_libelle and query in self.commune.lower_libelle)
190
+ or (
191
+ self.commune.lower_departement
192
+ and query in self.commune.lower_departement
193
+ )
194
+ )
195
+ )
196
+ )
@@ -0,0 +1,41 @@
1
+ from __future__ import annotations
2
+
3
+ from ..config import MEILISEARCH_FACETS_ORGANISMES, MEILISEARCH_INDEX_ORGANISMES
4
+ from .multi_search_query import MultiSearchQuery
5
+ from .multi_search_result_organismes import OrganismesMultiSearchResult
6
+ from .multi_search_results import MultiSearchResult
7
+ from .organismes_facet_distribution import OrganismesFacetDistribution
8
+ from .organismes_facet_stats import OrganismesFacetStats
9
+
10
+
11
+ class OrganismesMultiSearchQuery(MultiSearchQuery):
12
+ def __init__(
13
+ self,
14
+ q: str | None,
15
+ limit: int | None = 10,
16
+ offset: int | None = 0,
17
+ filter: list[str] | None = None,
18
+ sort: list[str] | None = None,
19
+ ):
20
+ super().__init__(
21
+ index_uid=MEILISEARCH_INDEX_ORGANISMES,
22
+ q=q,
23
+ facets=MEILISEARCH_FACETS_ORGANISMES,
24
+ limit=limit,
25
+ offset=offset,
26
+ filter=filter,
27
+ sort=sort,
28
+ )
29
+
30
+ def is_valid_result(self, result: MultiSearchResult):
31
+ return result and (
32
+ isinstance(result, OrganismesMultiSearchResult)
33
+ and (
34
+ result.facet_distribution is None
35
+ or isinstance(result.facet_distribution, OrganismesFacetDistribution)
36
+ )
37
+ and (
38
+ result.facet_stats is None
39
+ or isinstance(result.facet_stats, OrganismesFacetStats)
40
+ )
41
+ )
@@ -0,0 +1,8 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass, field
4
+
5
+
6
+ @dataclass
7
+ class OrganismesQuery:
8
+ fields_: list[str] | None = field(default=None) # Original: fields[]
@@ -0,0 +1,23 @@
1
+ from enum import Enum
2
+
3
+
4
+ class PhaseCode(Enum):
5
+ B1 = "B1"
6
+ B2 = "B2"
7
+ F = "F"
8
+ J1 = "J1"
9
+ P1 = "P1"
10
+ P2 = "P2"
11
+ P3 = "P3"
12
+ P4 = "P4"
13
+ P5 = "P5"
14
+ T1 = "T1"
15
+ T2 = "T2"
16
+ T3 = "T3"
17
+ THE_116 = "1/16"
18
+ THE_12 = "1/2"
19
+ THE_132 = "1/32"
20
+ THE_14 = "1/4"
21
+ THE_164 = "1/64"
22
+ THE_18 = "1/8"
23
+ TP = "TP"
@@ -0,0 +1,35 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Any
5
+
6
+ from ..utils.converter_utils import (
7
+ from_list,
8
+ from_str,
9
+ )
10
+ from .rencontres_engagement import Engagement
11
+
12
+
13
+ @dataclass
14
+ class Poule:
15
+ nom: str | None = None
16
+ id: str | None = None
17
+ engagements: list[Engagement] | None = None
18
+
19
+ @staticmethod
20
+ def from_dict(obj: Any) -> Poule:
21
+ assert isinstance(obj, dict)
22
+ nom = from_str(obj, "nom")
23
+ id = from_str(obj, "id")
24
+ engagements = from_list(Engagement.from_dict, obj, "engagements")
25
+ return Poule(nom=nom, id=id, engagements=engagements)
26
+
27
+ def to_dict(self) -> dict:
28
+ result: dict = {}
29
+ if self.nom is not None:
30
+ result["nom"] = self.nom
31
+ if self.id is not None:
32
+ result["id"] = self.id
33
+ if self.engagements is not None:
34
+ result["engagements"] = [e.to_dict() for e in self.engagements]
35
+ return result
@@ -0,0 +1,261 @@
1
+ class PouleFields:
2
+ """Default fields for poule queries."""
3
+
4
+ # Basic fields
5
+ ID = "id"
6
+ NOM = "nom"
7
+ LOGO_ID = "logo.id"
8
+
9
+ # ID Competition fields
10
+ ID_COMPETITION_ORGANISATEUR_CODE = "id_competition.organisateur.code"
11
+ ID_COMPETITION_ORGANISATEUR_NOM = "id_competition.organisateur.nom"
12
+ ID_COMPETITION_ORGANISATEUR_SAISON = "id_competition.organisateur.saison"
13
+ ID_COMPETITION_ORGANISATEUR_COMMUNE_DEPARTEMENT_CODE = (
14
+ "id_competition.organisateur.commune.departement.code"
15
+ )
16
+ ID_COMPETITION_ORGANISATEUR_COMMUNE_DEPARTEMENT_CODE_INSEE = (
17
+ "id_competition.organisateur.commune.departement.codeInsee"
18
+ )
19
+ ID_COMPETITION_ORGANISATEUR_COMMUNE_DEPARTEMENT_LIBELLE = (
20
+ "id_competition.organisateur.commune.departement.libelle"
21
+ )
22
+
23
+ # Rencontres fields
24
+ RENCONTRES_ID = "rencontres.id"
25
+ RENCONTRES_NUMERO = "rencontres.numero"
26
+ RENCONTRES_NUMERO_JOURNEE = "rencontres.numeroJournee"
27
+ RENCONTRES_ID_POULE = "rencontres.idPoule"
28
+ RENCONTRES_COMPETITION_ID = "rencontres.competitionId"
29
+ RENCONTRES_RESULTAT_EQUIPE1 = "rencontres.resultatEquipe1"
30
+ RENCONTRES_RESULTAT_EQUIPE2 = "rencontres.resultatEquipe2"
31
+ RENCONTRES_JOUE = "rencontres.joue"
32
+ RENCONTRES_NOM_EQUIPE1 = "rencontres.nomEquipe1"
33
+ RENCONTRES_NOM_EQUIPE2 = "rencontres.nomEquipe2"
34
+ RENCONTRES_DATE_RENCONTRE = "rencontres.date_rencontre"
35
+
36
+ # GameStats fields (live match data)
37
+ RENCONTRES_GSID_MATCH_ID = "rencontres.gsId.matchId"
38
+ RENCONTRES_GSID_CURRENT_STATUS = "rencontres.gsId.currentStatus"
39
+ RENCONTRES_GSID_CURRENT_PERIOD = "rencontres.gsId.currentPeriod"
40
+ RENCONTRES_GSID_SCORE_Q1_HOME = "rencontres.gsId.score_q1_home"
41
+ RENCONTRES_GSID_SCORE_Q2_HOME = "rencontres.gsId.score_q2_home"
42
+ RENCONTRES_GSID_SCORE_Q3_HOME = "rencontres.gsId.score_q3_home"
43
+ RENCONTRES_GSID_SCORE_Q4_HOME = "rencontres.gsId.score_q4_home"
44
+ RENCONTRES_GSID_SCORE_OT1_HOME = "rencontres.gsId.score_ot1_home"
45
+ RENCONTRES_GSID_SCORE_OT2_HOME = "rencontres.gsId.score_ot2_home"
46
+ RENCONTRES_GSID_SCORE_Q1_OUT = "rencontres.gsId.score_q1_out"
47
+ RENCONTRES_GSID_SCORE_Q2_OUT = "rencontres.gsId.score_q2_out"
48
+ RENCONTRES_GSID_SCORE_Q3_OUT = "rencontres.gsId.score_q3_out"
49
+ RENCONTRES_GSID_SCORE_Q4_OUT = "rencontres.gsId.score_q4_out"
50
+ RENCONTRES_GSID_SCORE_OT1_OUT = "rencontres.gsId.score_ot1_out"
51
+ RENCONTRES_GSID_SCORE_OT2_OUT = "rencontres.gsId.score_ot2_out"
52
+
53
+ # Classements fields
54
+ CLASSEMENTS_ID = "classements.id"
55
+ CLASSEMENTS_ID_ENGAGEMENT_ID = "classements.idEngagement.id"
56
+ CLASSEMENTS_ID_ENGAGEMENT_NOM = "classements.idEngagement.nom"
57
+ CLASSEMENTS_ID_ENGAGEMENT_NOM_USUEL = "classements.idEngagement.nomUsuel"
58
+ CLASSEMENTS_ID_ENGAGEMENT_CODE_ABREGE = "classements.idEngagement.codeAbrege"
59
+ CLASSEMENTS_ID_ENGAGEMENT_NUMERO_EQU = "classements.idEngagement.numeroEqu"
60
+ CLASSEMENTS_ID_ENGAGEMENT_LOGO_ID = "classements.idEngagement.logo.id"
61
+ CLASSEMENTS_ID_ENGAGEMENT_LOGO_GRADIENT = (
62
+ "classements.idEngagement.logo.gradient_color"
63
+ )
64
+ CLASSEMENTS_ORGANISME_ID = "classements.organisme.id"
65
+ CLASSEMENTS_ORGANISME_NOM = "classements.organisme.nom"
66
+ CLASSEMENTS_ORGANISME_LOGO_ID = "classements.organisme.logo.id"
67
+ CLASSEMENTS_ORGANISME_NOM_SIMPLE = "classements.organisme_nom"
68
+ CLASSEMENTS_ID_COMPETITION = "classements.idCompetition"
69
+ CLASSEMENTS_ID_POULE = "classements.idPoule"
70
+ CLASSEMENTS_ID_POULE_ID = "classements.idPoule.id"
71
+ CLASSEMENTS_POSITION = "classements.position"
72
+ CLASSEMENTS_POINTS = "classements.points"
73
+ CLASSEMENTS_MATCH_JOUES = "classements.matchJoues"
74
+ CLASSEMENTS_GAGNES = "classements.gagnes"
75
+ CLASSEMENTS_PERDUS = "classements.perdus"
76
+ CLASSEMENTS_NULS = "classements.nuls"
77
+ CLASSEMENTS_NOMBRE_FORFAITS = "classements.nombreForfaits"
78
+ CLASSEMENTS_NOMBRE_DEFAUTS = "classements.nombreDefauts"
79
+ CLASSEMENTS_PANIERS_MARQUES = "classements.paniersMarques"
80
+ CLASSEMENTS_PANIERS_ENCAISSES = "classements.paniersEncaisses"
81
+ CLASSEMENTS_DIFFERENCE = "classements.difference"
82
+ CLASSEMENTS_QUOTIENT = "classements.quotient"
83
+ CLASSEMENTS_POINT_INITIAUX = "classements.pointInitiaux"
84
+ CLASSEMENTS_PENALITES_ARBITRAGE = "classements.penalitesArbitrage"
85
+ CLASSEMENTS_PENALITES_ENTRAINEUR = "classements.penalitesEntraineur"
86
+ CLASSEMENTS_PENALITES_DIVERSES = "classements.penalitesDiverses"
87
+ CLASSEMENTS_HORS_CLASSEMENT = "classements.horsClassement"
88
+
89
+ @classmethod
90
+ def get_default_fields(cls) -> list[str]:
91
+ """Get default fields for poule queries based on real API usage."""
92
+ return [
93
+ # Basic fields
94
+ cls.ID,
95
+ cls.NOM,
96
+ cls.LOGO_ID,
97
+ # ID Competition fields
98
+ cls.ID_COMPETITION_ORGANISATEUR_CODE,
99
+ cls.ID_COMPETITION_ORGANISATEUR_NOM,
100
+ cls.ID_COMPETITION_ORGANISATEUR_SAISON,
101
+ cls.ID_COMPETITION_ORGANISATEUR_COMMUNE_DEPARTEMENT_CODE,
102
+ cls.ID_COMPETITION_ORGANISATEUR_COMMUNE_DEPARTEMENT_CODE_INSEE,
103
+ cls.ID_COMPETITION_ORGANISATEUR_COMMUNE_DEPARTEMENT_LIBELLE,
104
+ # Rencontres - champs essentiels
105
+ cls.RENCONTRES_ID,
106
+ cls.RENCONTRES_NUMERO,
107
+ cls.RENCONTRES_NUMERO_JOURNEE,
108
+ cls.RENCONTRES_ID_POULE,
109
+ "rencontres.competitionId.id",
110
+ "rencontres.competitionId.competition_origine",
111
+ "rencontres.idOrganismeEquipe1.logo.id",
112
+ "rencontres.idOrganismeEquipe1.id",
113
+ "rencontres.idOrganismeEquipe2.logo.id",
114
+ "rencontres.idOrganismeEquipe2.id",
115
+ cls.RENCONTRES_RESULTAT_EQUIPE1,
116
+ cls.RENCONTRES_RESULTAT_EQUIPE2,
117
+ cls.RENCONTRES_JOUE,
118
+ cls.RENCONTRES_NOM_EQUIPE1,
119
+ cls.RENCONTRES_NOM_EQUIPE2,
120
+ cls.RENCONTRES_GSID_MATCH_ID,
121
+ cls.RENCONTRES_GSID_CURRENT_STATUS,
122
+ cls.RENCONTRES_GSID_SCORE_Q1_HOME,
123
+ cls.RENCONTRES_GSID_SCORE_Q2_HOME,
124
+ cls.RENCONTRES_GSID_SCORE_Q3_HOME,
125
+ cls.RENCONTRES_GSID_SCORE_Q4_HOME,
126
+ cls.RENCONTRES_GSID_SCORE_OT1_HOME,
127
+ cls.RENCONTRES_GSID_SCORE_OT2_HOME,
128
+ cls.RENCONTRES_GSID_SCORE_Q1_OUT,
129
+ cls.RENCONTRES_GSID_SCORE_Q2_OUT,
130
+ cls.RENCONTRES_GSID_SCORE_Q3_OUT,
131
+ cls.RENCONTRES_GSID_SCORE_Q4_OUT,
132
+ cls.RENCONTRES_GSID_SCORE_OT1_OUT,
133
+ cls.RENCONTRES_GSID_SCORE_OT2_OUT,
134
+ cls.RENCONTRES_GSID_CURRENT_PERIOD,
135
+ "rencontres.idEngagementEquipe1.id",
136
+ "rencontres.idEngagementEquipe1.nom",
137
+ "rencontres.idEngagementEquipe1.nomOfficiel",
138
+ "rencontres.idEngagementEquipe1.nomUsuel",
139
+ "rencontres.idEngagementEquipe1.logo.id",
140
+ "rencontres.idEngagementEquipe1.logo.gradient_color",
141
+ "rencontres.idEngagementEquipe1.codeAbrege",
142
+ "rencontres.idEngagementEquipe1.idOrganisme.code",
143
+ "rencontres.idEngagementEquipe1.numeroEquipe",
144
+ "rencontres.idEngagementEquipe2.id",
145
+ "rencontres.idEngagementEquipe2.nom",
146
+ "rencontres.idEngagementEquipe2.nomOfficiel",
147
+ "rencontres.idEngagementEquipe2.nomUsuel",
148
+ "rencontres.idEngagementEquipe2.logo.id",
149
+ "rencontres.idEngagementEquipe2.logo.gradient_color",
150
+ "rencontres.idEngagementEquipe2.codeAbrege",
151
+ "rencontres.idEngagementEquipe2.idOrganisme.code",
152
+ "rencontres.idEngagementEquipe2.numeroEquipe",
153
+ "rencontres.salle.id",
154
+ "rencontres.salle.numero",
155
+ "rencontres.salle.libelle",
156
+ "rencontres.salle.libelle2",
157
+ "rencontres.salle.adresse",
158
+ "rencontres.salle.adresseComplement",
159
+ "rencontres.salle.commune.codePostal",
160
+ "rencontres.salle.commune.libelle",
161
+ "rencontres.salle.cartographie.latitude",
162
+ "rencontres.salle.cartographie.longitude",
163
+ cls.RENCONTRES_DATE_RENCONTRE,
164
+ "rencontres.officiels.ordre",
165
+ "rencontres.officiels.fonction.libelle",
166
+ "rencontres.officiels.officiel.nom",
167
+ "rencontres.officiels.officiel.prenom",
168
+ # Classements - tous les champs
169
+ cls.CLASSEMENTS_ID,
170
+ cls.CLASSEMENTS_ID_ENGAGEMENT_NOM,
171
+ cls.CLASSEMENTS_ID_ENGAGEMENT_NOM_USUEL,
172
+ cls.CLASSEMENTS_ID_ENGAGEMENT_ID,
173
+ cls.CLASSEMENTS_ID_ENGAGEMENT_LOGO_ID,
174
+ cls.CLASSEMENTS_ID_ENGAGEMENT_LOGO_GRADIENT,
175
+ cls.CLASSEMENTS_ID_ENGAGEMENT_CODE_ABREGE,
176
+ "classements.idEngagement.numeroEquipe",
177
+ cls.CLASSEMENTS_ORGANISME_ID,
178
+ cls.CLASSEMENTS_ORGANISME_NOM,
179
+ cls.CLASSEMENTS_ORGANISME_LOGO_ID,
180
+ cls.CLASSEMENTS_ORGANISME_NOM_SIMPLE,
181
+ cls.CLASSEMENTS_ID_COMPETITION,
182
+ cls.CLASSEMENTS_ID_POULE,
183
+ cls.CLASSEMENTS_ID_POULE_ID,
184
+ cls.CLASSEMENTS_MATCH_JOUES,
185
+ cls.CLASSEMENTS_POINTS,
186
+ cls.CLASSEMENTS_POSITION,
187
+ cls.CLASSEMENTS_GAGNES,
188
+ cls.CLASSEMENTS_PERDUS,
189
+ cls.CLASSEMENTS_NULS,
190
+ cls.CLASSEMENTS_POINT_INITIAUX,
191
+ cls.CLASSEMENTS_PENALITES_ARBITRAGE,
192
+ cls.CLASSEMENTS_PENALITES_ENTRAINEUR,
193
+ cls.CLASSEMENTS_PENALITES_DIVERSES,
194
+ cls.CLASSEMENTS_NOMBRE_FORFAITS,
195
+ cls.CLASSEMENTS_NOMBRE_DEFAUTS,
196
+ cls.CLASSEMENTS_PANIERS_MARQUES,
197
+ cls.CLASSEMENTS_PANIERS_ENCAISSES,
198
+ cls.CLASSEMENTS_DIFFERENCE,
199
+ cls.CLASSEMENTS_QUOTIENT,
200
+ cls.CLASSEMENTS_HORS_CLASSEMENT,
201
+ ]
202
+
203
+ @classmethod
204
+ def get_detailed_fields(cls) -> list[str]:
205
+ """Get detailed fields (all fields now included in default)."""
206
+ return cls.get_default_fields()
207
+
208
+ @classmethod
209
+ def get_classement_fields(cls) -> list[str]:
210
+ """Get classement-only fields (no rencontres) for lightweight ranking queries."""
211
+ return [
212
+ # Basic fields
213
+ cls.ID,
214
+ cls.NOM,
215
+ cls.LOGO_ID,
216
+ # ID Competition fields
217
+ cls.ID_COMPETITION_ORGANISATEUR_CODE,
218
+ cls.ID_COMPETITION_ORGANISATEUR_NOM,
219
+ # Classements - all fields
220
+ cls.CLASSEMENTS_ID,
221
+ cls.CLASSEMENTS_ID_ENGAGEMENT_NOM,
222
+ cls.CLASSEMENTS_ID_ENGAGEMENT_NOM_USUEL,
223
+ cls.CLASSEMENTS_ID_ENGAGEMENT_ID,
224
+ cls.CLASSEMENTS_ID_ENGAGEMENT_LOGO_ID,
225
+ cls.CLASSEMENTS_ID_ENGAGEMENT_LOGO_GRADIENT,
226
+ cls.CLASSEMENTS_ID_ENGAGEMENT_CODE_ABREGE,
227
+ "classements.idEngagement.numeroEquipe",
228
+ cls.CLASSEMENTS_ORGANISME_ID,
229
+ cls.CLASSEMENTS_ORGANISME_NOM,
230
+ cls.CLASSEMENTS_ORGANISME_LOGO_ID,
231
+ cls.CLASSEMENTS_ORGANISME_NOM_SIMPLE,
232
+ cls.CLASSEMENTS_ID_COMPETITION,
233
+ cls.CLASSEMENTS_ID_POULE,
234
+ cls.CLASSEMENTS_ID_POULE_ID,
235
+ cls.CLASSEMENTS_MATCH_JOUES,
236
+ cls.CLASSEMENTS_POINTS,
237
+ cls.CLASSEMENTS_POSITION,
238
+ cls.CLASSEMENTS_GAGNES,
239
+ cls.CLASSEMENTS_PERDUS,
240
+ cls.CLASSEMENTS_NULS,
241
+ cls.CLASSEMENTS_POINT_INITIAUX,
242
+ cls.CLASSEMENTS_PENALITES_ARBITRAGE,
243
+ cls.CLASSEMENTS_PENALITES_ENTRAINEUR,
244
+ cls.CLASSEMENTS_PENALITES_DIVERSES,
245
+ cls.CLASSEMENTS_NOMBRE_FORFAITS,
246
+ cls.CLASSEMENTS_NOMBRE_DEFAUTS,
247
+ cls.CLASSEMENTS_PANIERS_MARQUES,
248
+ cls.CLASSEMENTS_PANIERS_ENCAISSES,
249
+ cls.CLASSEMENTS_DIFFERENCE,
250
+ cls.CLASSEMENTS_QUOTIENT,
251
+ cls.CLASSEMENTS_HORS_CLASSEMENT,
252
+ ]
253
+
254
+ @classmethod
255
+ def get_basic_fields(cls) -> list[str]:
256
+ """Get basic fields for simple poule queries."""
257
+ return [
258
+ cls.ID,
259
+ cls.NOM,
260
+ cls.RENCONTRES_ID,
261
+ ]
@@ -0,0 +1,69 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from datetime import datetime
5
+
6
+
7
+ @dataclass
8
+ class PouleRencontreItemModel:
9
+ id: str
10
+ numero: str
11
+ numeroJournee: str
12
+ idPoule: str
13
+ competitionId: str
14
+ resultatEquipe1: str
15
+ resultatEquipe2: str
16
+ joue: int
17
+ nomEquipe1: str
18
+ nomEquipe2: str
19
+ date_rencontre: datetime
20
+
21
+ @property
22
+ def team1_name(self) -> str:
23
+ """Alias for nomEquipe1."""
24
+ return self.nomEquipe1
25
+
26
+ @property
27
+ def equipe_locale(self) -> str:
28
+ """Alias for nomEquipe1."""
29
+ return self.nomEquipe1
30
+
31
+ @property
32
+ def team2_name(self) -> str:
33
+ """Alias for nomEquipe2."""
34
+ return self.nomEquipe2
35
+
36
+ @property
37
+ def equipe_visiteuse(self) -> str:
38
+ """Alias for nomEquipe2."""
39
+ return self.nomEquipe2
40
+
41
+ @property
42
+ def score1(self) -> str:
43
+ """Alias for resultatEquipe1."""
44
+ return self.resultatEquipe1
45
+
46
+ @property
47
+ def score2(self) -> str:
48
+ """Alias for resultatEquipe2."""
49
+ return self.resultatEquipe2
50
+
51
+ @property
52
+ def poule_id(self) -> str:
53
+ """Alias for idPoule."""
54
+ return self.idPoule
55
+
56
+ @property
57
+ def match_number(self) -> str:
58
+ """Alias for numero."""
59
+ return self.numero
60
+
61
+ @property
62
+ def round_number(self) -> str:
63
+ """Alias for numeroJournee."""
64
+ return self.numeroJournee
65
+
66
+ @property
67
+ def is_played(self) -> bool:
68
+ """Returns True if the match has been played."""
69
+ return bool(self.joue)
@@ -0,0 +1,6 @@
1
+ """Backward-compatibility re-export shim for poules models."""
2
+
3
+ from .get_poule_response import GetPouleResponse
4
+ from .poules_query import PoulesQuery
5
+
6
+ __all__ = ["GetPouleResponse", "PoulesQuery"]
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass, field
4
+
5
+
6
+ @dataclass
7
+ class PoulesQuery:
8
+ deep_rencontres__limit: str | None = "1000" # Original: deep[rencontres][_limit]
9
+ fields_: list[str] | None = field(default=None) # Original: fields[]
@@ -0,0 +1,7 @@
1
+ from enum import Enum
2
+
3
+
4
+ class Pratique(Enum):
5
+ THE_3_X3 = "3x3"
6
+ THE_5_X5 = "5x5"
7
+ HANDISPORT = "Handisport"