impectPy 2.5.6__tar.gz → 2.5.7__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.
- {impectpy-2.5.6 → impectpy-2.5.7}/PKG-INFO +4 -4
- {impectpy-2.5.6 → impectpy-2.5.7}/README.md +3 -3
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/__init__.py +1 -1
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/events.py +4 -4
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/formations.py +2 -2
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/helpers.py +13 -3
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/matches.py +2 -2
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/player_iteration_averages.py +6 -6
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/player_iteration_scores.py +5 -5
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/player_match_scores.py +7 -7
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/player_matchsums.py +6 -6
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/player_profile_scores.py +5 -5
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/set_pieces.py +6 -6
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/squad_coefficients.py +1 -1
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/squad_iteration_averages.py +4 -4
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/squad_iteration_scores.py +4 -4
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/squad_match_scores.py +5 -5
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/squad_matchsums.py +3 -3
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/squad_ratings.py +1 -1
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/starting_positions.py +2 -2
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/substitutions.py +2 -2
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy.egg-info/PKG-INFO +4 -4
- {impectpy-2.5.6 → impectpy-2.5.7}/setup.py +1 -1
- {impectpy-2.5.6 → impectpy-2.5.7}/tests/test_package.py +2 -2
- {impectpy-2.5.6 → impectpy-2.5.7}/LICENSE.md +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/access_token.py +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/config.py +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/generate_xml.py +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/impect.py +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy/iterations.py +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy.egg-info/SOURCES.txt +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy.egg-info/dependency_links.txt +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy.egg-info/requires.txt +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/impectPy.egg-info/top_level.txt +0 -0
- {impectpy-2.5.6 → impectpy-2.5.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: impectPy
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.7
|
|
4
4
|
Summary: A Python package to facilitate interaction with the Impect customer API
|
|
5
5
|
Home-page: https://github.com/ImpectAPI/impectPy
|
|
6
6
|
Author: Impect
|
|
@@ -25,9 +25,9 @@ Dynamic: summary
|
|
|
25
25
|
|
|
26
26
|
A package provided by: Impect GmbH
|
|
27
27
|
|
|
28
|
-
Version: v2.5.
|
|
28
|
+
Version: v2.5.7
|
|
29
29
|
|
|
30
|
-
**Updated: February
|
|
30
|
+
**Updated: February 24th 2026**
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -58,7 +58,7 @@ pip install impectPy
|
|
|
58
58
|
You can also install it from [GitHub](https://github.com/) with:
|
|
59
59
|
|
|
60
60
|
```cmd
|
|
61
|
-
pip install git+https://github.com/ImpectAPI/impectPy.git@v2.5.
|
|
61
|
+
pip install git+https://github.com/ImpectAPI/impectPy.git@v2.5.7
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Usage
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A package provided by: Impect GmbH
|
|
4
4
|
|
|
5
|
-
Version: v2.5.
|
|
5
|
+
Version: v2.5.7
|
|
6
6
|
|
|
7
|
-
**Updated: February
|
|
7
|
+
**Updated: February 24th 2026**
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -35,7 +35,7 @@ pip install impectPy
|
|
|
35
35
|
You can also install it from [GitHub](https://github.com/) with:
|
|
36
36
|
|
|
37
37
|
```cmd
|
|
38
|
-
pip install git+https://github.com/ImpectAPI/impectPy.git@v2.5.
|
|
38
|
+
pip install git+https://github.com/ImpectAPI/impectPy.git@v2.5.7
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
## Usage
|
|
@@ -275,20 +275,20 @@ def getEventsFromHost(
|
|
|
275
275
|
left_on="matchId",
|
|
276
276
|
right_on="id",
|
|
277
277
|
how="left",
|
|
278
|
-
suffixes=("", "
|
|
278
|
+
suffixes=("", "_matchplan")
|
|
279
279
|
).merge(
|
|
280
280
|
match_data[["id", "squadHomeCoachId", "squadAwayCoachId"]].rename(
|
|
281
281
|
columns={"squadHomeCoachId": "homeSquadCoachId", "squadAwayCoachId": "awaySquadCoachId"}),
|
|
282
282
|
left_on="matchId",
|
|
283
283
|
right_on="id",
|
|
284
284
|
how="left",
|
|
285
|
-
suffixes=("", "
|
|
285
|
+
suffixes=("", "_matchData")
|
|
286
286
|
).merge(
|
|
287
287
|
iterations,
|
|
288
288
|
left_on="iterationId",
|
|
289
289
|
right_on="id",
|
|
290
290
|
how="left",
|
|
291
|
-
suffixes=("", "
|
|
291
|
+
suffixes=("", "_iterations")
|
|
292
292
|
)
|
|
293
293
|
|
|
294
294
|
if not coaches_blacklisted:
|
|
@@ -337,7 +337,7 @@ def getEventsFromHost(
|
|
|
337
337
|
left_on=["setPieceId", "setPieceSubPhaseId"],
|
|
338
338
|
right_on=["setPieceId", "setPieceSubPhaseId"],
|
|
339
339
|
how="left",
|
|
340
|
-
suffixes=("", "
|
|
340
|
+
suffixes=("", "_setPieces")
|
|
341
341
|
)
|
|
342
342
|
events["setPieceSubPhaseMainEventPlayerName"] = events.setPieceSubPhaseMainEventPlayerId.map(player_map)
|
|
343
343
|
events["setPieceSubPhasePassReceiverName"] = events.setPieceSubPhasePassReceiverId.map(player_map)
|
|
@@ -140,7 +140,7 @@ def getFormationsFromHost(matches: list, connection: RateLimitedAPI, host: str)
|
|
|
140
140
|
left_on="id",
|
|
141
141
|
right_on="id",
|
|
142
142
|
how="left",
|
|
143
|
-
suffixes=("", "
|
|
143
|
+
suffixes=("", "_matchplan")
|
|
144
144
|
)
|
|
145
145
|
|
|
146
146
|
# merge with competition info
|
|
@@ -149,7 +149,7 @@ def getFormationsFromHost(matches: list, connection: RateLimitedAPI, host: str)
|
|
|
149
149
|
left_on="iterationId",
|
|
150
150
|
right_on="id",
|
|
151
151
|
how="left",
|
|
152
|
-
suffixes=("", "
|
|
152
|
+
suffixes=("", "_iterations")
|
|
153
153
|
)
|
|
154
154
|
|
|
155
155
|
# rename some columns
|
|
@@ -134,7 +134,7 @@ class RateLimitedAPI:
|
|
|
134
134
|
|
|
135
135
|
def make_api_request(
|
|
136
136
|
self, url: str, method: str, data: Optional[Dict[str, Any]] = None,
|
|
137
|
-
max_retries: int = 3, retry_delay: int =
|
|
137
|
+
max_retries: int = 3, retry_delay: Optional[int] = None
|
|
138
138
|
) -> ImpectResponse:
|
|
139
139
|
"""
|
|
140
140
|
Executes an API call.
|
|
@@ -154,10 +154,20 @@ class RateLimitedAPI:
|
|
|
154
154
|
elif response.status_code == 429:
|
|
155
155
|
# check if last try
|
|
156
156
|
if i < max_retries - 1:
|
|
157
|
+
# calculate exact wait time based on token bucket refill time
|
|
158
|
+
if self.bucket and retry_delay is None:
|
|
159
|
+
wait_time = math.ceil(
|
|
160
|
+
self.bucket.refill_after * 100 - (
|
|
161
|
+
time.time() - self.bucket.last_refill_time
|
|
162
|
+
) * 100
|
|
163
|
+
) / 100
|
|
164
|
+
else:
|
|
165
|
+
wait_time = retry_delay if retry_delay is not None else 1
|
|
166
|
+
|
|
157
167
|
print(f"Received status code {response.status_code} "
|
|
158
168
|
f"({response.json().get('message', 'Rate Limit Exceeded')})"
|
|
159
|
-
f", retrying in {
|
|
160
|
-
time.sleep(
|
|
169
|
+
f", retrying in {wait_time} seconds...")
|
|
170
|
+
time.sleep(wait_time)
|
|
161
171
|
else:
|
|
162
172
|
raise HTTPError(f"Received status code {response.status_code} "
|
|
163
173
|
f"({response.json().get('message', 'Rate Limit Exceeded')})"
|
|
@@ -89,7 +89,7 @@ def getMatchesFromHost(iteration: int, connection: RateLimitedAPI, host: str) ->
|
|
|
89
89
|
countries,
|
|
90
90
|
left_on="homeSquadCountryId",
|
|
91
91
|
right_on="id",
|
|
92
|
-
suffixes=("", "
|
|
92
|
+
suffixes=("", "_homeSquadCountry")
|
|
93
93
|
)
|
|
94
94
|
matches = matches.rename(columns={"fifaName": "homeSquadCountryName"})
|
|
95
95
|
|
|
@@ -97,7 +97,7 @@ def getMatchesFromHost(iteration: int, connection: RateLimitedAPI, host: str) ->
|
|
|
97
97
|
countries,
|
|
98
98
|
left_on="awaySquadCountryId",
|
|
99
99
|
right_on="id",
|
|
100
|
-
suffixes=("", "
|
|
100
|
+
suffixes=("", "_awaySquadCountry")
|
|
101
101
|
)
|
|
102
102
|
matches = matches.rename(columns={"fifaName": "awaySquadCountryName"})
|
|
103
103
|
|
|
@@ -115,7 +115,7 @@ def getPlayerIterationAveragesFromHost(
|
|
|
115
115
|
left_on="kpiId",
|
|
116
116
|
right_on="id",
|
|
117
117
|
how="outer",
|
|
118
|
-
suffixes=("", "
|
|
118
|
+
suffixes=("", "_kpis")
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
# fill missing values in the "name" column with a default value to ensure players without scorings don't get lost
|
|
@@ -173,7 +173,7 @@ def getPlayerIterationAveragesFromHost(
|
|
|
173
173
|
left_on=["iterationId", "squadId", "playerId", "position"],
|
|
174
174
|
right_on=["iterationId", "squadId", "playerId", "position"],
|
|
175
175
|
how="inner",
|
|
176
|
-
suffixes=("", "
|
|
176
|
+
suffixes=("", "_matchShares")
|
|
177
177
|
)
|
|
178
178
|
|
|
179
179
|
averages_list.append(averages_raw)
|
|
@@ -187,7 +187,7 @@ def getPlayerIterationAveragesFromHost(
|
|
|
187
187
|
left_on="iterationId",
|
|
188
188
|
right_on="id",
|
|
189
189
|
how="left",
|
|
190
|
-
suffixes=("", "
|
|
190
|
+
suffixes=("", "_iterations")
|
|
191
191
|
).merge(
|
|
192
192
|
squads[["id", "name"]].rename(
|
|
193
193
|
columns={"id": "squadId", "name": "squadName"}
|
|
@@ -195,7 +195,7 @@ def getPlayerIterationAveragesFromHost(
|
|
|
195
195
|
left_on="squadId",
|
|
196
196
|
right_on="squadId",
|
|
197
197
|
how="left",
|
|
198
|
-
suffixes=("", "
|
|
198
|
+
suffixes=("", "_squads")
|
|
199
199
|
).merge(
|
|
200
200
|
players[[
|
|
201
201
|
"id", "wyscoutId", "heimSpielId", "skillCornerId", "commonname",
|
|
@@ -206,13 +206,13 @@ def getPlayerIterationAveragesFromHost(
|
|
|
206
206
|
left_on="playerId",
|
|
207
207
|
right_on="id",
|
|
208
208
|
how="left",
|
|
209
|
-
suffixes=("", "
|
|
209
|
+
suffixes=("", "_players")
|
|
210
210
|
).merge(
|
|
211
211
|
countries.rename(columns={"fifaName": "playerCountry"}),
|
|
212
212
|
left_on="countryId",
|
|
213
213
|
right_on="id",
|
|
214
214
|
how="left",
|
|
215
|
-
suffixes=("", "
|
|
215
|
+
suffixes=("", "_countries")
|
|
216
216
|
)
|
|
217
217
|
|
|
218
218
|
# remove NA rows
|
|
@@ -192,7 +192,7 @@ def getPlayerIterationScoresFromHost(
|
|
|
192
192
|
left_on="playerScoreId",
|
|
193
193
|
right_on="id",
|
|
194
194
|
how="outer",
|
|
195
|
-
suffixes=("", "
|
|
195
|
+
suffixes=("", "_scores")
|
|
196
196
|
)
|
|
197
197
|
|
|
198
198
|
# get matchShares
|
|
@@ -226,7 +226,7 @@ def getPlayerIterationScoresFromHost(
|
|
|
226
226
|
left_on=["iterationId", "squadId", "playerId", "position"],
|
|
227
227
|
right_on=["iterationId", "squadId", "playerId", "position"],
|
|
228
228
|
how="inner",
|
|
229
|
-
suffixes=("", "
|
|
229
|
+
suffixes=("", "_matchShares")
|
|
230
230
|
)
|
|
231
231
|
else:
|
|
232
232
|
match_shares = averages[
|
|
@@ -258,7 +258,7 @@ def getPlayerIterationScoresFromHost(
|
|
|
258
258
|
left_on=["iterationId", "squadId", "playerId", "positions"],
|
|
259
259
|
right_on=["iterationId", "squadId", "playerId", "positions"],
|
|
260
260
|
how="inner",
|
|
261
|
-
suffixes=("", "
|
|
261
|
+
suffixes=("", "_matchShares")
|
|
262
262
|
)
|
|
263
263
|
|
|
264
264
|
# merge with other data
|
|
@@ -268,7 +268,7 @@ def getPlayerIterationScoresFromHost(
|
|
|
268
268
|
left_on="iterationId",
|
|
269
269
|
right_on="id",
|
|
270
270
|
how="left",
|
|
271
|
-
suffixes=("", "
|
|
271
|
+
suffixes=("", "_iterations")
|
|
272
272
|
).merge(
|
|
273
273
|
players[[
|
|
274
274
|
"id", "wyscoutId", "heimSpielId", "skillCornerId", "commonname",
|
|
@@ -279,7 +279,7 @@ def getPlayerIterationScoresFromHost(
|
|
|
279
279
|
left_on="playerId",
|
|
280
280
|
right_on="id",
|
|
281
281
|
how="left",
|
|
282
|
-
suffixes=("", "
|
|
282
|
+
suffixes=("", "_players")
|
|
283
283
|
)
|
|
284
284
|
averages["playerCountry"] = averages.countryId.map(country_map)
|
|
285
285
|
|
|
@@ -294,7 +294,7 @@ def getPlayerMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
294
294
|
left_on="playerScoreId",
|
|
295
295
|
right_on="id",
|
|
296
296
|
how="outer",
|
|
297
|
-
suffixes=("", "
|
|
297
|
+
suffixes=("", "_scores")
|
|
298
298
|
)
|
|
299
299
|
|
|
300
300
|
# pivot data
|
|
@@ -316,7 +316,7 @@ def getPlayerMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
316
316
|
left_on=["matchId", "squadId", "id", "position"],
|
|
317
317
|
right_on=["matchId", "squadId", "id", "position"],
|
|
318
318
|
how="inner",
|
|
319
|
-
suffixes=("", "
|
|
319
|
+
suffixes=("", "_matchShares")
|
|
320
320
|
)
|
|
321
321
|
else:
|
|
322
322
|
temp = pd.pivot_table(
|
|
@@ -336,7 +336,7 @@ def getPlayerMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
336
336
|
left_on=["matchId", "squadId", "id", "positions"],
|
|
337
337
|
right_on=["matchId", "squadId", "id", "positions"],
|
|
338
338
|
how="inner",
|
|
339
|
-
suffixes=("", "
|
|
339
|
+
suffixes=("", "_matchShares")
|
|
340
340
|
)
|
|
341
341
|
|
|
342
342
|
# append to match_player_scores
|
|
@@ -360,7 +360,7 @@ def getPlayerMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
360
360
|
left_on="matchId",
|
|
361
361
|
right_on="id",
|
|
362
362
|
how="left",
|
|
363
|
-
suffixes=("", "
|
|
363
|
+
suffixes=("", "_matchplan")
|
|
364
364
|
).merge(
|
|
365
365
|
pd.concat([
|
|
366
366
|
match_data[["id","squadHomeId", "squadHomeCoachId"]].rename(columns={"squadHomeId": "squadId", "squadHomeCoachId": "coachId"}),
|
|
@@ -369,13 +369,13 @@ def getPlayerMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
369
369
|
left_on=["matchId", "squadId"],
|
|
370
370
|
right_on=["id", "squadId"],
|
|
371
371
|
how="left",
|
|
372
|
-
suffixes=("", "
|
|
372
|
+
suffixes=("", "_matchData")
|
|
373
373
|
).merge(
|
|
374
374
|
iterations[["id", "competitionId", "competitionName", "competitionType", "season"]],
|
|
375
375
|
left_on="iterationId",
|
|
376
376
|
right_on="id",
|
|
377
377
|
how="left",
|
|
378
|
-
suffixes=("", "
|
|
378
|
+
suffixes=("", "_iterations")
|
|
379
379
|
).merge(
|
|
380
380
|
players[[
|
|
381
381
|
"id", "wyscoutId", "heimSpielId", "skillCornerId", "commonname",
|
|
@@ -386,7 +386,7 @@ def getPlayerMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
386
386
|
left_on="id",
|
|
387
387
|
right_on="id",
|
|
388
388
|
how="left",
|
|
389
|
-
suffixes=("", "
|
|
389
|
+
suffixes=("", "_players")
|
|
390
390
|
)
|
|
391
391
|
player_scores["playerCountry"] = player_scores.countryId.map(country_map)
|
|
392
392
|
|
|
@@ -220,7 +220,7 @@ def getPlayerMatchsumsFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
220
220
|
left_on="kpiId",
|
|
221
221
|
right_on="id",
|
|
222
222
|
how="outer",
|
|
223
|
-
suffixes=("", "
|
|
223
|
+
suffixes=("", "_kpis")
|
|
224
224
|
)
|
|
225
225
|
|
|
226
226
|
# pivot data
|
|
@@ -241,7 +241,7 @@ def getPlayerMatchsumsFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
241
241
|
left_on=["matchId", "squadId", "id", "position"],
|
|
242
242
|
right_on=["matchId", "squadId", "id", "position"],
|
|
243
243
|
how="inner",
|
|
244
|
-
suffixes=("", "
|
|
244
|
+
suffixes=("", "_matchShares")
|
|
245
245
|
)
|
|
246
246
|
|
|
247
247
|
# append to matchsums
|
|
@@ -254,7 +254,7 @@ def getPlayerMatchsumsFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
254
254
|
left_on="matchId",
|
|
255
255
|
right_on="id",
|
|
256
256
|
how="left",
|
|
257
|
-
suffixes=("", "
|
|
257
|
+
suffixes=("", "_matchplan")
|
|
258
258
|
).merge(
|
|
259
259
|
pd.concat([
|
|
260
260
|
match_data[["id","squadHomeId", "squadHomeCoachId"]].rename(columns={"squadHomeId": "squadId", "squadHomeCoachId": "coachId"}),
|
|
@@ -263,13 +263,13 @@ def getPlayerMatchsumsFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
263
263
|
left_on=["matchId", "squadId"],
|
|
264
264
|
right_on=["id", "squadId"],
|
|
265
265
|
how="left",
|
|
266
|
-
suffixes=("", "
|
|
266
|
+
suffixes=("", "_matchData")
|
|
267
267
|
).merge(
|
|
268
268
|
iterations[["id", "competitionId", "competitionName", "competitionType", "season"]],
|
|
269
269
|
left_on="iterationId",
|
|
270
270
|
right_on="id",
|
|
271
271
|
how="left",
|
|
272
|
-
suffixes=("", "
|
|
272
|
+
suffixes=("", "_iterations")
|
|
273
273
|
).merge(
|
|
274
274
|
players[[
|
|
275
275
|
"id", "wyscoutId", "heimSpielId", "skillCornerId", "commonname",
|
|
@@ -280,7 +280,7 @@ def getPlayerMatchsumsFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
280
280
|
left_on="id",
|
|
281
281
|
right_on="id",
|
|
282
282
|
how="left",
|
|
283
|
-
suffixes=("", "
|
|
283
|
+
suffixes=("", "_players")
|
|
284
284
|
)
|
|
285
285
|
matchsums["playerCountry"] = matchsums.countryId.map(country_map)
|
|
286
286
|
|
|
@@ -160,7 +160,7 @@ def getPlayerProfileScoresFromHost(
|
|
|
160
160
|
left_on="profileName",
|
|
161
161
|
right_on="name",
|
|
162
162
|
how="outer",
|
|
163
|
-
suffixes=("", "
|
|
163
|
+
suffixes=("", "_scores")
|
|
164
164
|
)
|
|
165
165
|
|
|
166
166
|
# get matchShares
|
|
@@ -192,7 +192,7 @@ def getPlayerProfileScoresFromHost(
|
|
|
192
192
|
left_on=["iterationId", "squadId", "playerId", "positions"],
|
|
193
193
|
right_on=["iterationId", "squadId", "playerId", "positions"],
|
|
194
194
|
how="inner",
|
|
195
|
-
suffixes=("", "
|
|
195
|
+
suffixes=("", "_matchShares")
|
|
196
196
|
)
|
|
197
197
|
# merge with other data
|
|
198
198
|
profile_scores = profile_scores.merge(
|
|
@@ -200,7 +200,7 @@ def getPlayerProfileScoresFromHost(
|
|
|
200
200
|
left_on="iterationId",
|
|
201
201
|
right_on="id",
|
|
202
202
|
how="left",
|
|
203
|
-
suffixes=("", "
|
|
203
|
+
suffixes=("", "_iterations")
|
|
204
204
|
).merge(
|
|
205
205
|
squads[["id", "name"]].rename(
|
|
206
206
|
columns={"id": "squadId", "name": "squadName"}
|
|
@@ -208,7 +208,7 @@ def getPlayerProfileScoresFromHost(
|
|
|
208
208
|
left_on="squadId",
|
|
209
209
|
right_on="squadId",
|
|
210
210
|
how="left",
|
|
211
|
-
suffixes=("", "
|
|
211
|
+
suffixes=("", "_squads")
|
|
212
212
|
).merge(
|
|
213
213
|
players[[
|
|
214
214
|
"id", "wyscoutId", "heimSpielId", "skillCornerId", "commonname",
|
|
@@ -219,7 +219,7 @@ def getPlayerProfileScoresFromHost(
|
|
|
219
219
|
left_on="playerId",
|
|
220
220
|
right_on="id",
|
|
221
221
|
how="left",
|
|
222
|
-
suffixes=("", "
|
|
222
|
+
suffixes=("", "_players")
|
|
223
223
|
)
|
|
224
224
|
profile_scores["playerCountry"] = profile_scores.countryId.map(country_map)
|
|
225
225
|
|
|
@@ -164,7 +164,7 @@ def getSetPiecesFromHost(matches: list, connection: RateLimitedAPI, host: str) -
|
|
|
164
164
|
left_on="matchId",
|
|
165
165
|
right_on="id",
|
|
166
166
|
how="left",
|
|
167
|
-
suffixes=("", "
|
|
167
|
+
suffixes=("", "_matchplan")
|
|
168
168
|
)
|
|
169
169
|
|
|
170
170
|
# merge with competition info
|
|
@@ -173,7 +173,7 @@ def getSetPiecesFromHost(matches: list, connection: RateLimitedAPI, host: str) -
|
|
|
173
173
|
left_on="iterationId",
|
|
174
174
|
right_on="id",
|
|
175
175
|
how="left",
|
|
176
|
-
suffixes=("", "
|
|
176
|
+
suffixes=("", "_iterations")
|
|
177
177
|
)
|
|
178
178
|
|
|
179
179
|
# determine defending squad
|
|
@@ -208,7 +208,7 @@ def getSetPiecesFromHost(matches: list, connection: RateLimitedAPI, host: str) -
|
|
|
208
208
|
left_on="setPieceSubPhaseMainEventPlayerId",
|
|
209
209
|
right_on="setPieceSubPhaseMainEventPlayerId",
|
|
210
210
|
how="left",
|
|
211
|
-
suffixes=("", "
|
|
211
|
+
suffixes=("", "_main")
|
|
212
212
|
).merge(
|
|
213
213
|
players[["id", "commonname"]].rename(
|
|
214
214
|
columns={
|
|
@@ -219,7 +219,7 @@ def getSetPiecesFromHost(matches: list, connection: RateLimitedAPI, host: str) -
|
|
|
219
219
|
left_on="setPieceSubPhasePassReceiverId",
|
|
220
220
|
right_on="setPieceSubPhasePassReceiverId",
|
|
221
221
|
how="left",
|
|
222
|
-
suffixes=("", "
|
|
222
|
+
suffixes=("", "_receiver")
|
|
223
223
|
).merge(
|
|
224
224
|
players[["id", "commonname"]].rename(
|
|
225
225
|
columns={
|
|
@@ -230,7 +230,7 @@ def getSetPiecesFromHost(matches: list, connection: RateLimitedAPI, host: str) -
|
|
|
230
230
|
left_on="setPieceSubPhaseFirstTouchPlayerId",
|
|
231
231
|
right_on="setPieceSubPhaseFirstTouchPlayerId",
|
|
232
232
|
how="left",
|
|
233
|
-
suffixes=("", "
|
|
233
|
+
suffixes=("", "_first")
|
|
234
234
|
).merge(
|
|
235
235
|
players[["id", "commonname"]].rename(
|
|
236
236
|
columns={
|
|
@@ -241,7 +241,7 @@ def getSetPiecesFromHost(matches: list, connection: RateLimitedAPI, host: str) -
|
|
|
241
241
|
left_on="setPieceSubPhaseSecondTouchPlayerId",
|
|
242
242
|
right_on="setPieceSubPhaseSecondTouchPlayerId",
|
|
243
243
|
how="left",
|
|
244
|
-
suffixes=("", "
|
|
244
|
+
suffixes=("", "_second")
|
|
245
245
|
)
|
|
246
246
|
|
|
247
247
|
# rename some columns
|
|
@@ -78,7 +78,7 @@ def getSquadIterationAveragesFromHost(iteration: int, connection: RateLimitedAPI
|
|
|
78
78
|
left_on="kpiId",
|
|
79
79
|
right_on="id",
|
|
80
80
|
how="outer",
|
|
81
|
-
suffixes=("", "
|
|
81
|
+
suffixes=("", "_kpis")
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
# pivot kpi values
|
|
@@ -99,7 +99,7 @@ def getSquadIterationAveragesFromHost(iteration: int, connection: RateLimitedAPI
|
|
|
99
99
|
left_on="squadId",
|
|
100
100
|
right_on="squadId",
|
|
101
101
|
how="inner",
|
|
102
|
-
suffixes=("", "
|
|
102
|
+
suffixes=("", "_matches")
|
|
103
103
|
)
|
|
104
104
|
|
|
105
105
|
# merge with other data
|
|
@@ -108,7 +108,7 @@ def getSquadIterationAveragesFromHost(iteration: int, connection: RateLimitedAPI
|
|
|
108
108
|
left_on="iterationId",
|
|
109
109
|
right_on="id",
|
|
110
110
|
how="left",
|
|
111
|
-
suffixes=("", "
|
|
111
|
+
suffixes=("", "_iterations")
|
|
112
112
|
).merge(
|
|
113
113
|
squads[["id", "wyscoutId", "heimSpielId", "skillCornerId", "name"]].rename(
|
|
114
114
|
columns={"id": "squadId", "name": "squadName"}
|
|
@@ -116,7 +116,7 @@ def getSquadIterationAveragesFromHost(iteration: int, connection: RateLimitedAPI
|
|
|
116
116
|
left_on="squadId",
|
|
117
117
|
right_on="squadId",
|
|
118
118
|
how="left",
|
|
119
|
-
suffixes=("", "
|
|
119
|
+
suffixes=("", "_squads")
|
|
120
120
|
)
|
|
121
121
|
|
|
122
122
|
# remove NA rows
|
|
@@ -78,7 +78,7 @@ def getSquadIterationScoresFromHost(iteration: int, connection: RateLimitedAPI,
|
|
|
78
78
|
left_on="squadScoreId",
|
|
79
79
|
right_on="id",
|
|
80
80
|
how="outer",
|
|
81
|
-
suffixes=("", "
|
|
81
|
+
suffixes=("", "_scores")
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
# pivot kpi values
|
|
@@ -99,7 +99,7 @@ def getSquadIterationScoresFromHost(iteration: int, connection: RateLimitedAPI,
|
|
|
99
99
|
left_on="squadId",
|
|
100
100
|
right_on="squadId",
|
|
101
101
|
how="inner",
|
|
102
|
-
suffixes=("", "
|
|
102
|
+
suffixes=("", "_matches")
|
|
103
103
|
)
|
|
104
104
|
|
|
105
105
|
# merge with other data
|
|
@@ -108,7 +108,7 @@ def getSquadIterationScoresFromHost(iteration: int, connection: RateLimitedAPI,
|
|
|
108
108
|
left_on="iterationId",
|
|
109
109
|
right_on="id",
|
|
110
110
|
how="left",
|
|
111
|
-
suffixes=("", "
|
|
111
|
+
suffixes=("", "_iterations")
|
|
112
112
|
).merge(
|
|
113
113
|
squads[["id", "wyscoutId", "heimSpielId", "skillCornerId", "name"]].rename(
|
|
114
114
|
columns={"id": "squadId", "name": "squadName"}
|
|
@@ -116,7 +116,7 @@ def getSquadIterationScoresFromHost(iteration: int, connection: RateLimitedAPI,
|
|
|
116
116
|
left_on="squadId",
|
|
117
117
|
right_on="squadId",
|
|
118
118
|
how="left",
|
|
119
|
-
suffixes=("", "
|
|
119
|
+
suffixes=("", "_squads")
|
|
120
120
|
)
|
|
121
121
|
|
|
122
122
|
# remove NA rows
|
|
@@ -181,7 +181,7 @@ def getSquadMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
181
181
|
left_on="squadScoreId",
|
|
182
182
|
right_on="id",
|
|
183
183
|
how="outer",
|
|
184
|
-
suffixes=("", "
|
|
184
|
+
suffixes=("", "_scores")
|
|
185
185
|
)
|
|
186
186
|
|
|
187
187
|
# pivot data
|
|
@@ -204,7 +204,7 @@ def getSquadMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
204
204
|
left_on="matchId",
|
|
205
205
|
right_on="id",
|
|
206
206
|
how="left",
|
|
207
|
-
suffixes=("", "
|
|
207
|
+
suffixes=("", "_matchplan")
|
|
208
208
|
).merge(
|
|
209
209
|
pd.concat([
|
|
210
210
|
match_data[["id","squadHomeId", "squadHomeCoachId"]].rename(columns={"squadHomeId": "squadId", "squadHomeCoachId": "coachId"}),
|
|
@@ -213,13 +213,13 @@ def getSquadMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
213
213
|
left_on=["matchId", "squadId"],
|
|
214
214
|
right_on=["id", "squadId"],
|
|
215
215
|
how="left",
|
|
216
|
-
suffixes=("", "
|
|
216
|
+
suffixes=("", "_matchData")
|
|
217
217
|
).merge(
|
|
218
218
|
iterations[["id", "competitionId", "competitionName", "competitionType", "season"]],
|
|
219
219
|
left_on="iterationId",
|
|
220
220
|
right_on="id",
|
|
221
221
|
how="left",
|
|
222
|
-
suffixes=("", "
|
|
222
|
+
suffixes=("", "_iterations")
|
|
223
223
|
).merge(
|
|
224
224
|
squads[["id", "wyscoutId", "heimSpielId", "skillCornerId", "name"]].rename(
|
|
225
225
|
columns={"id": "squadId", "name": "squadName"}
|
|
@@ -227,7 +227,7 @@ def getSquadMatchScoresFromHost(matches: list, connection: RateLimitedAPI, host:
|
|
|
227
227
|
left_on="squadId",
|
|
228
228
|
right_on="squadId",
|
|
229
229
|
how="left",
|
|
230
|
-
suffixes=("", "
|
|
230
|
+
suffixes=("", "_squads")
|
|
231
231
|
)
|
|
232
232
|
|
|
233
233
|
if not coaches_blacklisted:
|
|
@@ -204,7 +204,7 @@ def getSquadMatchsumsFromHost(matches: list, connection: RateLimitedAPI, host: s
|
|
|
204
204
|
left_on="matchId",
|
|
205
205
|
right_on="id",
|
|
206
206
|
how="left",
|
|
207
|
-
suffixes=("", "
|
|
207
|
+
suffixes=("", "_matchplan")
|
|
208
208
|
).merge(
|
|
209
209
|
pd.concat([
|
|
210
210
|
match_data[["id","squadHomeId", "squadHomeCoachId"]].rename(columns={"squadHomeId": "squadId", "squadHomeCoachId": "coachId"}),
|
|
@@ -213,13 +213,13 @@ def getSquadMatchsumsFromHost(matches: list, connection: RateLimitedAPI, host: s
|
|
|
213
213
|
left_on=["matchId", "squadId"],
|
|
214
214
|
right_on=["id", "squadId"],
|
|
215
215
|
how="left",
|
|
216
|
-
suffixes=("", "
|
|
216
|
+
suffixes=("", "_matchData")
|
|
217
217
|
).merge(
|
|
218
218
|
iterations[["id", "competitionId", "competitionName", "competitionType", "season"]],
|
|
219
219
|
left_on="iterationId",
|
|
220
220
|
right_on="id",
|
|
221
221
|
how="left",
|
|
222
|
-
suffixes=("", "
|
|
222
|
+
suffixes=("", "_iterations")
|
|
223
223
|
).merge(
|
|
224
224
|
squads[["id", "wyscoutId", "heimSpielId", "skillCornerId", "name"]].rename(
|
|
225
225
|
columns={"id": "squadId", "name": "squadName"}
|
|
@@ -185,7 +185,7 @@ def getStartingPositionsFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
185
185
|
left_on="id",
|
|
186
186
|
right_on="id",
|
|
187
187
|
how="left",
|
|
188
|
-
suffixes=("", "
|
|
188
|
+
suffixes=("", "_matchplan")
|
|
189
189
|
)
|
|
190
190
|
|
|
191
191
|
# merge with competition info
|
|
@@ -194,7 +194,7 @@ def getStartingPositionsFromHost(matches: list, connection: RateLimitedAPI, host
|
|
|
194
194
|
left_on="iterationId",
|
|
195
195
|
right_on="id",
|
|
196
196
|
how="left",
|
|
197
|
-
suffixes=("", "
|
|
197
|
+
suffixes=("", "_iterations")
|
|
198
198
|
)
|
|
199
199
|
|
|
200
200
|
# rename some columns
|
|
@@ -200,7 +200,7 @@ def getSubstitutionsFromHost(matches: list, connection: RateLimitedAPI, host: st
|
|
|
200
200
|
left_on="id",
|
|
201
201
|
right_on="id",
|
|
202
202
|
how="left",
|
|
203
|
-
suffixes=("", "
|
|
203
|
+
suffixes=("", "_matchplan")
|
|
204
204
|
)
|
|
205
205
|
|
|
206
206
|
# merge with competition info
|
|
@@ -209,7 +209,7 @@ def getSubstitutionsFromHost(matches: list, connection: RateLimitedAPI, host: st
|
|
|
209
209
|
left_on="iterationId",
|
|
210
210
|
right_on="id",
|
|
211
211
|
how="left",
|
|
212
|
-
suffixes=("", "
|
|
212
|
+
suffixes=("", "_iterations")
|
|
213
213
|
)
|
|
214
214
|
|
|
215
215
|
# rename some columns
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: impectPy
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.7
|
|
4
4
|
Summary: A Python package to facilitate interaction with the Impect customer API
|
|
5
5
|
Home-page: https://github.com/ImpectAPI/impectPy
|
|
6
6
|
Author: Impect
|
|
@@ -25,9 +25,9 @@ Dynamic: summary
|
|
|
25
25
|
|
|
26
26
|
A package provided by: Impect GmbH
|
|
27
27
|
|
|
28
|
-
Version: v2.5.
|
|
28
|
+
Version: v2.5.7
|
|
29
29
|
|
|
30
|
-
**Updated: February
|
|
30
|
+
**Updated: February 24th 2026**
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -58,7 +58,7 @@ pip install impectPy
|
|
|
58
58
|
You can also install it from [GitHub](https://github.com/) with:
|
|
59
59
|
|
|
60
60
|
```cmd
|
|
61
|
-
pip install git+https://github.com/ImpectAPI/impectPy.git@v2.5.
|
|
61
|
+
pip install git+https://github.com/ImpectAPI/impectPy.git@v2.5.7
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Usage
|
|
@@ -17,7 +17,7 @@ setup(
|
|
|
17
17
|
"pandas>=2.2.0",
|
|
18
18
|
"numpy>=1.24.2"],
|
|
19
19
|
# *strongly* suggested for sharing
|
|
20
|
-
version="2.5.
|
|
20
|
+
version="2.5.7",
|
|
21
21
|
# The license can be anything you like
|
|
22
22
|
license="MIT",
|
|
23
23
|
description="A Python package to facilitate interaction with the Impect customer API",
|
|
@@ -10,10 +10,10 @@ from tqdm import tqdm
|
|
|
10
10
|
from dotenv import load_dotenv
|
|
11
11
|
import pandas as pd
|
|
12
12
|
|
|
13
|
-
execute_functions =
|
|
13
|
+
execute_functions = True
|
|
14
14
|
|
|
15
15
|
# branch comparison configuration
|
|
16
|
-
BRANCH_A_NAME = "
|
|
16
|
+
BRANCH_A_NAME = "146-improve-rate-limit-handling"
|
|
17
17
|
BRANCH_B_NAME = "release"
|
|
18
18
|
|
|
19
19
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
|
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
|