-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmadden_to_football_gm.py
727 lines (689 loc) · 22.9 KB
/
madden_to_football_gm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# -*- coding: utf-8 -*-
"""Madden to Football GM.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1tPoD30xXS41Fd671YXKZEAQid69HLkSm
"""
import requests
import time
from bs4 import BeautifulSoup
import concurrent.futures
import json
import numpy as np
import scipy.stats as stats
import pandas as pd
def process_player(name, profile_url):
profile_response = requests.get(profile_url, headers=headers)
profile_soup = BeautifulSoup(profile_response.text, "html.parser")
# Extract rating names and values
rating_names = profile_soup.find_all("span", class_="Stat_label__faUgX")
rating_values = profile_soup.find_all("span", class_="Stat_value__TT86G")
images = profile_soup.find_all("img", class_="Picture_image__L8suG")
# Get all elements with the shared class
attributes = profile_soup.find_all("span", class_="Typography_typography___mliz generated_body2__P92dE Typography_margins__GGnT6") # Update class
# Process attributes in order
extracted = [attr.text.strip() for attr in attributes]
ratings_dict = {}
ratings_dict['Image'] = images[2]["src"]
ratings_dict['Position'] = extracted[0]
ratings_dict['Team'] = extracted[1]
ratings_dict['Height'] = extracted[2]
ratings_dict['Weight'] = extracted[3]
ratings_dict['Archetype'] = extracted[4]
ratings_dict['College'] = extracted[-4]
ratings_dict['Age'] = extracted[-3]
ratings_dict['Draft Year'] = extracted[-2]
ratings_dict['Jersey Number'] = extracted[-1]
for r_name, r_value in zip(rating_names, rating_values):
if r_name.text.strip() == "General":
continue
ratings_dict[r_name.text.strip()] = r_value.text.strip()
players_dict[name] = ratings_dict
time.sleep(1)
return name, ratings_dict
def match_distribution(target_data, source_data):
return np.percentile(
np.array(source_data),
stats.rankdata(np.array(target_data)) / len(np.array(target_data)) * 100
)
base_url = "https://www.ea.com"
ratings_url_template = "https://www.ea.com/en/games/madden-nfl/ratings?page={}"
# Fetch the main ratings page
headers = {"User-Agent": "Mozilla/5.0"}
player_profiles = {}
players_dict = {}
for page_num in range(1, 22):
ratings_url = ratings_url_template.format(page_num)
response = requests.get(ratings_url, headers=headers)
soup = BeautifulSoup(response.text, "html.parser")
# Find player profile links
players = soup.find_all("a", class_="Table_profileCellAnchor__Zj6g4")
for player in players:
name = player.text.strip()
profile_link = base_url + player["href"] # Construct full URL
player_profiles[name] = profile_link
with concurrent.futures.ThreadPoolExecutor(max_workers=15) as executor: # Adjust max_workers as needed
futures = [executor.submit(process_player, name, profile_url) for name, profile_url in player_profiles.items()]
for future in concurrent.futures.as_completed(futures):
name, ratings_dict = future.result()
players_dict[name] = ratings_dict
fbgm_players = []
for player in players_dict:
current = players_dict[player]
fbgm_players.append({})
i = len(fbgm_players) - 1
name = player.split(' ', 1)
fbgm_players[i]['firstName'] = name[0]
fbgm_players[i]['lastName'] = name[1]
fbgm_players[i]['born'] = {"year" : 2024 - int(players_dict[player]['Age'])}
fbgm_players[i]['draft'] = {"year" : 2024 - int(players_dict[player]['Draft Year'])}
fbgm_players[i]['college'] = current['College']
match current['Team']:
case "Arizona Cardinals":
fbgm_players[i]['tid'] = 0
case "Atlanta Falcons":
fbgm_players[i]['tid'] = 1
case "Baltimore Ravens":
fbgm_players[i]['tid'] = 2
case "Buffalo Bills":
fbgm_players[i]['tid'] = 3
case "Carolina Panthers":
fbgm_players[i]['tid'] = 4
case "Chicago Bears":
fbgm_players[i]['tid'] = 5
case "Cincinnati Bengals":
fbgm_players[i]['tid'] = 6
case "Cleveland Browns":
fbgm_players[i]['tid'] = 7
case "Dallas Cowboys":
fbgm_players[i]['tid'] = 8
case "Denver Broncos":
fbgm_players[i]['tid'] = 9
case "Detroit Lions":
fbgm_players[i]['tid'] = 10
case "Green Bay Packers":
fbgm_players[i]['tid'] = 11
case "Houston Texans":
fbgm_players[i]['tid'] = 12
case "Indianapolis Colts":
fbgm_players[i]['tid'] = 13
case "Jacksonville Jaguars":
fbgm_players[i]['tid'] = 14
case "Kansas City Chiefs":
fbgm_players[i]['tid'] = 15
case "Las Vegas Raiders":
fbgm_players[i]['tid'] = 16
case "Los Angeles Chargers":
fbgm_players[i]['tid'] = 17
case "Los Angeles Rams":
fbgm_players[i]['tid'] = 18
case "Miami Dolphins":
fbgm_players[i]['tid'] = 19
case "Minnesota Vikings":
fbgm_players[i]['tid'] = 20
case "New England Patriots":
fbgm_players[i]['tid'] = 21
case "New Orleans Saints":
fbgm_players[i]['tid'] = 22
case "NY Giants":
fbgm_players[i]['tid'] = 23
case "NY Jets":
fbgm_players[i]['tid'] = 24
case "Philadelphia Eagles":
fbgm_players[i]['tid'] = 25
case "Pittsburgh Steelers":
fbgm_players[i]['tid'] = 26
case "San Francisco 49ers":
fbgm_players[i]['tid'] = 27
case "Seattle Seahawks":
fbgm_players[i]['tid'] = 28
case "Tampa Bay Buccaneers":
fbgm_players[i]['tid'] = 29
case "Tennessee Titans":
fbgm_players[i]['tid'] = 30
case "Washington Commanders":
fbgm_players[i]['tid'] = 31
case _:
fbgm_players[i]['tid'] = -1
feet, inches = current['Height'].split('"')[0].split("'")
fbgm_players[i]['hgt'] = int(feet) * 12 + int(inches)
fbgm_players[i]['imgURL'] = current["Image"]
fbgm_players[i]['jerseyNumber'] = current['Jersey Number']
fbgm_players[i]['weight'] = int(current['Weight'].split('l')[0])
match current['Position']:
case "Quarterback":
fbgm_players[i]['pos'] = "QB"
case "Halfback":
fbgm_players[i]['pos'] = "RB"
case "Wide Receiver":
fbgm_players[i]['pos'] = "WR"
case "Fullback" | "Tight End":
fbgm_players[i]['pos'] = "TE"
case "Left Tackle" | "Left Guard" | "Center" | "Right Guard" | "Right Tackle":
fbgm_players[i]['pos'] = "OL"
case "Left Defensive End" | "Defensive Tackle" | "Right Defensive End":
fbgm_players[i]['pos'] = "DL"
case "Left Outside Linebacker" | "Middle Linebacker" | "Right Outside Linebacker":
fbgm_players[i]['pos'] = "DL" if "Rusher" in current['Archetype'] else "LB"
case "Cornerback":
fbgm_players[i]['pos']= "CB"
case "Strong Safety" | "Free Safety":
fbgm_players[i]['pos'] = "S"
case "Kicker":
fbgm_players[i]['pos'] = "K"
case _:
fbgm_players[i]['pos'] = "P"
ratings = [{}]
ratings[0]['hgt'] = int(round((fbgm_players[i]['hgt'] - 64) / 18 * 100))
ratings[0]['stre'] = int(current['Strength'])
ratings[0]['spd'] = int(round(.6 * int(current['Speed']) +
.4 * int(current['Acceleration'])))
ratings[0]['endu'] = int(round(.6 * int(current['Stamina']) +
.2 * int(current['Toughness']) +
.2 * int(current['Injury'])))
ratings[0]['thv'] = int(round(.67 * int(current['Awareness']) +
.33 * int(current['Play Action'])))
ratings[0]['thp'] = int(current['Throw Power'])
ratings[0]['tha'] = int(round(.4 * int(current['Throw Accuracy Short']) +
.3 * int(current['Throw Accuracy Mid']) +
.3 * int(current['Throw Accuracy Deep'])))
ratings[0]['bsc'] = int(round(.5 * int(current['Carrying']) +
.15 * int(current['Awareness']) +
.15 * int(current['BC Vision']) +
.1 * int(current['Toughness']) +
.1 * int(current['Trucking'])))
ratings[0]['elu'] = int(round(.26 * int(current['Juke Move']) +
.22 * int(current['Spin Move']) +
.17 * int(current['Change Of Direction']) +
.15 * int(current['Break Tackle']) +
.1 * int(current['Agility']) +
.1 * int(current['Trucking'])))
ratings[0]['rtr'] = int(round(.28 * int(current['Short Route Running']) +
.28 * int(current['Medium Route Running']) +
.24 * int(current['Deep Route Running']) +
.2 * int(current['Release'])))
ratings[0]['hnd'] = int(round(.4 * int(current['Catching']) +
.2 * int(current['Catch In Traffic']) +
.2 * int(current['Spectacular Catch']) +
.1 * int(current['Awareness']) +
.1 * int(current['Jumping'])))
ratings[0]['rbk'] = int(round(.4 * int(current['Run Block']) +
.2 * int(current['Run Block Power']) +
.2 * int(current['Run Block Finesse']) +
.2 * int(current['Lead Block'])))
ratings[0]['pbk'] = int(round(.5 * int(current['Pass Block']) +
.25 * int(current['Pass Block Power']) +
.25 * int(current['Pass Block Finesse'])))
ratings[0]['pcv'] = int(round(.4 * int(current['Man Coverage']) +
.4 * int(current['Zone Coverage']) +
.1 * int(current['Press']) +
.1 * int(current['Play Recognition'])))
ratings[0]['tck'] = int(round(.5 * int(current['Tackle']) +
.3 * int(current['Hit Power']) +
.2 * int(current['Pursuit'])))
ratings[0]['prs'] = int(round(.6 * int(current['Block Shedding']) +
.3 * int(current['Finesse Moves']) +
.1 * int(current['Power Moves'])))
ratings[0]['rns'] = int(round(.6 * int(current['Block Shedding']) +
.2 * int(current['Power Moves']) +
.2 * int(current['Pursuit'])))
ratings[0]['kpw'] = ratings[0]['ppw'] = int(current['Kick Power'])
ratings[0]['kac'] = ratings[0]['pac'] = int(current['Kick Accuracy'])
fbgm_players[i]['ratings'] = ratings
player_ratings = pd.read_csv("PlayerRatings/PlayerRatings.csv")
for i in range(1, 19):
temp = pd.read_csv(f"PlayerRatings/PlayerRatings ({i}).csv")
player_ratings = pd.concat([player_ratings, temp], ignore_index=True)
player_ratings = player_ratings.iloc[:, range(9, 29)]
attributes_arrays = {
col: player_ratings[col].to_numpy() for col in player_ratings.columns
}
i = 0
attributes = []
while i < len(fbgm_players):
j = 0
for attribute in fbgm_players[i]['ratings'][0]:
if attribute == "hgt":
continue
if i == 0:
attributes.append(np.array([]))
attributes[j] = np.append(attributes[j], fbgm_players[i]['ratings'][0][attribute])
j += 1
i += 1
for i in range(len(attributes)):
attributes[i] = np.round(match_distribution(
attributes[i],
attributes_arrays[player_ratings.columns[i]]
))
for i in range(len(fbgm_players)):
for j in range(len(fbgm_players[0]['ratings'][0])):
if j != 0:
fbgm_players[i]['ratings'][0][list(fbgm_players[0]['ratings'][0].keys())[j]] = attributes[j - 1][i]
j += 1
i += 1
confs = [
{"cid": 0, "name": "AFC"},
{"cid": 1, "name": "NFC"}
]
divs = [
{"did": 0, "cid": 0, "name": "East"},
{"did": 1, "cid": 0, "name": "North"},
{"did": 2, "cid": 0, "name": "South"},
{"did": 3, "cid": 0, "name": "West"},
{"did": 4, "cid": 1, "name": "East"},
{"did": 5, "cid": 1, "name": "North"},
{"did": 6, "cid": 1, "name": "South"},
{"did": 7, "cid": 1, "name": "West"}
]
gameAttributes = {
"completionFactor": .907,
"confs": confs,
"divs": divs,
"draftAges": [20, 26],
"draftPickAutoContract": True,
"draftPickAutoContractPercent": 20,
"draftPickAutoContractRounds": 7,
"fantasyPoints": "ppr",
"luxuryPayroll": 330000,
"maxContract": 60000,
"maxRosterSize": 53,
"minContract": 850,
"minPayroll": 250000,
"minRosterSize": 46,
"numSeasonsFutureDraftPicks": 3,
"rookieContractLengths": [4],
"salaryCap": 280000
}
teams = [
{
"tid": 0,
"cid": 1,
"did": 7,
"region": "Arizona",
"name": "Cardinals",
"abbrev": "ARI",
"pop": 4.1,
"stadiumCapacity": 63400,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/ari.png",
"colors": ["#97233F", "#000000", "#FFB612"]
},
{
"tid": 1,
"cid": 1,
"did": 6,
"region": "Atlanta",
"name": "Falcons",
"abbrev": "ATL",
"pop": 6.3,
"stadiumCapacity": 71000,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/atl.png",
"colors": ["#A71930", "#000000", "#A5ACAF"]
},
{
"tid": 2,
"cid": 0,
"did": 1,
"region": "Baltimore",
"name": "Ravens",
"abbrev": "BAL",
"pop": 2.8,
"stadiumCapacity": 71008,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/bal.png",
"colors": ["#241773", "#000000", "#9E7C0C"]
},
{
"tid": 3,
"cid": 0,
"did": 0,
"region": "Buffalo",
"name": "Bills",
"abbrev": "BUF",
"pop": 1.2,
"stadiumCapacity": 71608,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/buf.png",
"colors": ["#0038D", "#C60C30", "#FFFFFF"]
},
{
"tid": 4,
"cid": 1,
"did": 6,
"region": "Carolina",
"name": "Panthers",
"abbrev": "CAR",
"pop": 2.8,
"stadiumCapacity": 74867,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/car.png",
"colors": ["#0085CA", "#101820", "#BFC0BF"]
},
{
"tid": 5,
"cid": 1,
"did": 5,
"region": "Chicago",
"name": "Bears",
"abbrev": "CHI",
"pop": 9.3,
"stadiumCapacity": 61500,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/chi.png",
"colors": ["#0B162A", "#C83803", "FFFFFF"]
},
{
"tid": 6,
"cid": 0,
"did": 1,
"region": "Cincinnati",
"name": "Bengals",
"abbrev": "CIN",
"pop": 2.3,
"stadiumCapacity": 65515,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/cin.png",
"colors": ["#FB4F14", "#000000", "#FFFFFF"]
},
{
"tid": 7,
"cid": 0,
"did": 1,
"region": "Cleveland",
"name": "Browns",
"abbrev": "CLE",
"pop": 2.2,
"stadiumCapacity": 67431,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/cle.png",
"colors": ["#311D00", "#FF3C00", "#FFFFFF"]
},
{
"tid": 8,
"cid": 1,
"did": 4,
"region": "Dallas",
"name": "Cowboys",
"abbrev": "DAL",
"pop": 8.1,
"stadiumCapacity": 100000,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/dal.png",
"colors": ["#003594", "#041E42", "#869397"]
},
{
"tid": 9,
"cid": 0,
"did": 3,
"region": "Denver",
"name": "Broncos",
"abbrev": "DEN",
"pop": 3,
"stadiumCapacity": 76125,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/den.png",
"colors": ["#FB4F14", "#002244", "#FFFFFF"]
},
{
"tid": 10,
"cid": 1,
"did": 5,
"region": "Detroit",
"name": "Lions",
"abbrev": "DET",
"pop": 4.3,
"stadiumCapacity": 65000,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/det.png",
"colors": ["#0076B6", "#B0B7BC", "#000000"]
},
{
"tid": 11,
"cid": 1,
"did": 5,
"region": "Green Bay",
"name": "Packers",
"abbrev": "GB",
"pop": 0.33,
"stadiumCapacity": 81441,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/gb.png",
"colors": ["#203731", "#FFB612", "#FFFFFF"]
},
{
"tid": 12,
"cid": 0,
"did": 2,
"region": "Houston",
"name": "Texans",
"abbrev": "HOU",
"pop": 7.5,
"stadiumCapacity": 72220,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/hou.png",
"colors": ["#03202F", "#A71930", "#FFFFFF"]
},
{
"tid": 13,
"cid": 0,
"did": 2,
"region": "Indianapolis",
"name": "Colts",
"abbrev": "IND",
"pop": 2.1,
"stadiumCapacity": 70000,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/ind.png",
"colors": ["#002C5F", "#A2AAAD", "#FFFFFF"]
},
{
"tid": 14,
"cid": 0,
"did": 2,
"region": "Jacksonville",
"name": "Jaguars",
"abbrev": "JAC",
"pop": 1.7,
"stadiumCapacity": 67814,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/jac.png",
"colors": ["#101820", "#D7A22A", "#9F792C"]
},
{
"tid": 15,
"cid": 0,
"did": 3,
"region": "Kansas City",
"name": "Chiefs",
"abbrev": "KC",
"pop": 2.2,
"stadiumCapacity": 76416,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/kc.png",
"colors": ["#E31837", "#FFB81C", "#FFFFFF"]
},
{
"tid": 16,
"cid": 0,
"did": 3,
"region": "Las Vegas",
"name": "Raiders",
"abbrev": "LV",
"pop": 2.3,
"stadiumCapacity": 65000,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/lv.png",
"colors": ["#000000", "#A5ACAF", "FFFFFF"]
},
{
"tid": 17,
"cid": 0,
"did": 3,
"region": "Los Angeles",
"name": "Chargers",
"abbrev": "LAC",
"pop": 12.8,
"stadiumCapacity": 70240,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/lac.png",
"colors": ["#0080C6", "#FFC20E", "#FFFFFF"]
},
{
"tid": 18,
"cid": 1,
"did": 7,
"region": "Los Angeles",
"name": "Rams",
"abbrev": "LAR",
"pop": 12.8,
"stadiumCapacity": 70240,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/lar.png",
"colors": ["#003594", "#FFA300", "#FF8200"]
},
{
"tid": 19,
"cid": 0,
"did": 0,
"region": "Miami",
"name": "Dolphins",
"abbrev": "MIA",
"pop": 6.2,
"stadiumCapacity": 65000,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/mia.png",
"colors": ["#008E97", "#FC4C02", "#005778"]
},
{
"tid": 20,
"cid": 1,
"did": 5,
"region": "Minnesota",
"name": "Vikings",
"abbrev": "MIN",
"pop": 3.7,
"stadiumCapacity": 66860,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/min.png",
"colors": ["#4F2683", "FFC62F", "FFFFFF"]
},
{
"tid": 21,
"cid": 0,
"did": 0,
"region": "New England",
"name": "Patriots",
"abbrev": "NE",
"pop": 4.9,
"stadiumCapacity": 64628,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/ne.png",
"colors": ["#002244", "#C60C30", "#B0B7BC"]
},
{
"tid": 22,
"cid": 1,
"did": 6,
"region": "New Orleans",
"name": "Saints",
"abbrev": "NO",
"pop": 0.96,
"stadiumCapacity": 73208,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/no.png",
"colors": ["#D3BC8D", "#101820", "#FFFFFF"]
},
{
"tid": 23,
"cid": 1,
"did": 4,
"region": "New York",
"name": "Giants",
"abbrev": "NYG",
"pop": 19.5,
"stadiumCapacity": 82500,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/nyg.png",
"colors": ["#0B2265", "#A71930", "#A5ACAF"]
},
{
"tid": 24,
"cid": 0,
"did": 0,
"region": "New York",
"name": "Jets",
"abbrev": "NYJ",
"pop": 19.5,
"stadiumCapacity": 82500,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/nyj.png",
"colors": ["#125740", "#000000", "#FFFFFF"]
},
{
"tid": 25,
"cid": 1,
"did": 4,
"region": "Philadelphia",
"name": "Eagles",
"abbrev": "PHI",
"pop": 6.2,
"stadiumCapacity": 67594,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/phi.png",
"colors": ["#004C54", "#A5ACAF", "#ACC0C6"]
},
{
"tid": 26,
"cid": 0,
"did": 1,
"region": "Pittsburgh",
"name": "Steelers",
"abbrev": "PIT",
"pop": 2.4,
"stadiumCapacity": 68400,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/pit.png",
"colors": ["#FFB612", "#101820", "#003087"]
},
{
"tid": 27,
"cid": 1,
"did": 7,
"region": "San Francisco",
"name": "49ers",
"abbrev": "SF",
"pop": 4.6,
"stadiumCapacity": 68500,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/sf.png",
"colors": ["#AA0000", "#B3995D", "#FFFFFF"]
},
{
"tid": 28,
"cid": 1,
"did": 7,
"region": "Seattle",
"name": "Seahawks",
"abbrev": "SEA",
"pop": 4,
"stadiumCapacity": 68740,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/sea.png",
"colors": ["#002244", "#69BE28", "#A5ACAF"]
},
{
"tid": 29,
"cid": 1,
"did": 6,
"region": "Tampa Bay",
"name": "Buccaneers",
"abbrev": "TB",
"pop": 3.3,
"stadiumCapacity": 69218,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/tb.png",
"colors": ["#D50A0A", "#FF7900", "#FF7900"]
},
{
"tid": 30,
"cid": 0,
"did": 2,
"region": "Tennessee",
"name": "Titans",
"abbrev": "TEN",
"pop": 2.1,
"stadiumCapacity": 69143,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/ten.png",
"colors": ["#0C2340", "#4B92DB", "#C8102E"]
},
{
"tid": 31,
"cid": 1,
"did": 4,
"region": "Washington",
"name": "Commanders",
"abbrev": "WAS",
"pop": 6.3,
"stadiumCapacity": 62000,
"imgURL": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/was.png",
"colors": ["#5A1414", "#FFB612", "#FFFFFF"]
}
]
data = {
"players" : fbgm_players,
"teams" : teams,
"gameAttributes" : gameAttributes
}
with open("Madden 25 to Football GM.json", "w", encoding="utf-8") as f:
json.dump(data, f, indent=4)