Skip to content

Commit 7600f69

Browse files
committed
Add type hints and remove pydantic again
1 parent d49a264 commit 7600f69

5 files changed

Lines changed: 7 additions & 287 deletions

File tree

gather/get_api_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
from .helper import fetch_multiple
88

99

10-
async def get_sc2_league_api_data(client: httpx.AsyncClient, access_token: str, season_number: int, fetch_delay: float):
10+
async def get_sc2_league_api_data(
11+
client: httpx.AsyncClient, access_token: str, season_number: int, fetch_delay: float
12+
) -> list[dict]:
1113
url = "https://{}.api.blizzard.com/data/sc2/league/{}/{}/{}/{}?locale=en_US"
1214

1315
urls = []

gather/get_gm_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def get_sc2_gm_api_data(client: httpx.AsyncClient, access_token: str, fetc
2424
return responses
2525

2626

27-
async def mix_gm_data(prepared_data, gm_borders):
27+
async def mix_gm_data(prepared_data: dict, gm_borders: dict) -> dict:
2828
prepared_data["201"]["6"] = {}
2929
# Empty when GM isn't open
3030
if len(gm_borders) == 0:
@@ -35,7 +35,7 @@ async def mix_gm_data(prepared_data, gm_borders):
3535
return prepared_data
3636

3737

38-
async def get_gm_borders(gm_data: dict):
38+
async def get_gm_borders(gm_data: dict) -> dict:
3939
gm_table_info = {}
4040
for index, region in enumerate(REGIONS):
4141
# No GM data could be retrieved

gather/get_legacy_ladders_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async def get_sc2_legacy_ladder_api_data(
7373
fetch_delay: float,
7474
prepared_data: dict,
7575
gm_data: dict,
76-
):
76+
) -> dict:
7777
url = "https://{}.api.blizzard.com/sc2/legacy/ladder/{}/{}"
7878
# url = f"https://{region}.api.blizzard.com/sc2/legacy/ladder/{region_id}/{ladder_id}"
7979

@@ -226,7 +226,7 @@ async def get_sc2_legacy_ladder_api_data(
226226
}
227227

228228

229-
async def add_gm_stats(gm_data, avg_games_table, total_games_table, avg_winrate_table):
229+
async def add_gm_stats(gm_data, avg_games_table, total_games_table, avg_winrate_table) -> None:
230230
# Add GM stats
231231
for region_id, region_name in enumerate(REGIONS, start=1):
232232
new_row_avg_games = [ROW_DESCRIPTIONS[-1]]

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dependencies = [
77
"dpath>=2.2.0",
88
"httpx>=0.28.0",
99
"loguru>=0.7.2",
10-
"pydantic>=2.10.6",
1110
]
1211

1312
[dependency-groups]

0 commit comments

Comments
 (0)