foxapi 1.8.0__tar.gz → 1.8.1__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.
- {foxapi-1.8.0 → foxapi-1.8.1}/PKG-INFO +4 -4
- {foxapi-1.8.0 → foxapi-1.8.1}/README.md +3 -3
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/__init__.py +1 -1
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/foxapi.py +19 -19
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi.egg-info/PKG-INFO +4 -4
- {foxapi-1.8.0 → foxapi-1.8.1}/LICENSE +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/10.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/11.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/12.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/13.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/14.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/15.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/16.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/17.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/18.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/19.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/20.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/21.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/22.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/23.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/27.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/28.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/29.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/30.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/32.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/33.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/34.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/35.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/37.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/38.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/39.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/40.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/41.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/45.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/46.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/47.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/5.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/51.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/52.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/53.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/54.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/56.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/57.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/58.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/59.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/6.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/60.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/61.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/62.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/7.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/70.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/71.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/72.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/75.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/8.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/83.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/84.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/9.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/DebugIcon.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/MapIconCivicCenter.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/MapIconFortCursed.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/MapIconForwardBase1.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/MapIconScorchedTown.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/MapIconTownHall.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapIcons/MapIconVictory.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapAcrithiaHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapAllodsBightHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapAshFieldsHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapBasinSionnachHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapCallahansPassageHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapCallumsCapeHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapClahstraHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapClansheadValleyHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapDeadLandsHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapDrownedValeHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapEndlessShoreHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapFarranacCoastHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapFishermansRowHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapGodcroftsHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapGreatMarchHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapHeartlandsHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapHomeRegionC.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapHomeRegionW.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapHowlCountyHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapKalokaiHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapKingsCageHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapLinnMercyHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapLochMorHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapMarbanHollow.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapMooringCountyHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapMorgensCrossingHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapNevishLineHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapOarbreakerHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapOriginHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapReachingTrailHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapReaversPassHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapRedRiverHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapSableportHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapShackledChasmHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapSpeakingWoodsHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapStemaLandingHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapStlicanShelfHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapStonecradleHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapTempestIslandHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapTerminusHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapTheFingersHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapUmbralWildwoodHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapViperPitHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapWeatheredExpanseHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/Images/MapsHex/MapWestgateHex.png +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi/utils.py +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi.egg-info/SOURCES.txt +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi.egg-info/dependency_links.txt +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi.egg-info/requires.txt +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/foxapi.egg-info/top_level.txt +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/setup.cfg +0 -0
- {foxapi-1.8.0 → foxapi-1.8.1}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.1
|
|
4
4
|
Summary: A wrapper for the foxhole API
|
|
5
5
|
Home-page: https://github.com/ThePhoenix78/FoxAPI
|
|
6
6
|
Download-URL: https://github.com/ThePhoenix78/FoxAPI/tarball/master
|
|
@@ -140,7 +140,7 @@ calc_distance(x1: float, y1: float, x2: float, y2: float) -> float
|
|
|
140
140
|
- Calculates the Euclidean distance between two points on the map.
|
|
141
141
|
|
|
142
142
|
```py
|
|
143
|
-
get_captured_towns(hexagon: str = None, dynamic: dict = None, static: dict = None) -> dict
|
|
143
|
+
get_captured_towns(hexagon: str = None, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None) -> dict
|
|
144
144
|
```
|
|
145
145
|
- Retrieves the captured towns for a given hexagon based on dynamic and static data.
|
|
146
146
|
|
|
@@ -151,14 +151,14 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
151
151
|
- Loads the PNG map for the specified hexagon.
|
|
152
152
|
|
|
153
153
|
```py
|
|
154
|
-
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
154
|
+
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None) -> pillow.Image
|
|
155
155
|
```
|
|
156
156
|
- Generates a PNG image of the hexagon map with all the icons associated to each faction in their respective colors (included fields and town base). Only public data will be present.
|
|
157
157
|
- colored -> display each region in the team's color
|
|
158
158
|
- icons -> display selected building in their team's color
|
|
159
159
|
|
|
160
160
|
```py
|
|
161
|
-
calculate_death_rate(hexagon: str = None, war_report: dict = None): -> dict
|
|
161
|
+
calculate_death_rate(hexagon: str = None, war_report: dict = None, session: aiohttp.ClientSession | None = None): -> dict
|
|
162
162
|
```
|
|
163
163
|
- calculate the death rate between the first launch and the current one
|
|
164
164
|
|
|
@@ -109,7 +109,7 @@ calc_distance(x1: float, y1: float, x2: float, y2: float) -> float
|
|
|
109
109
|
- Calculates the Euclidean distance between two points on the map.
|
|
110
110
|
|
|
111
111
|
```py
|
|
112
|
-
get_captured_towns(hexagon: str = None, dynamic: dict = None, static: dict = None) -> dict
|
|
112
|
+
get_captured_towns(hexagon: str = None, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None) -> dict
|
|
113
113
|
```
|
|
114
114
|
- Retrieves the captured towns for a given hexagon based on dynamic and static data.
|
|
115
115
|
|
|
@@ -120,14 +120,14 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
120
120
|
- Loads the PNG map for the specified hexagon.
|
|
121
121
|
|
|
122
122
|
```py
|
|
123
|
-
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
123
|
+
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None) -> pillow.Image
|
|
124
124
|
```
|
|
125
125
|
- Generates a PNG image of the hexagon map with all the icons associated to each faction in their respective colors (included fields and town base). Only public data will be present.
|
|
126
126
|
- colored -> display each region in the team's color
|
|
127
127
|
- icons -> display selected building in their team's color
|
|
128
128
|
|
|
129
129
|
```py
|
|
130
|
-
calculate_death_rate(hexagon: str = None, war_report: dict = None): -> dict
|
|
130
|
+
calculate_death_rate(hexagon: str = None, war_report: dict = None, session: aiohttp.ClientSession | None = None): -> dict
|
|
131
131
|
```
|
|
132
132
|
- calculate the death rate between the first launch and the current one
|
|
133
133
|
|
|
@@ -360,29 +360,29 @@ class FoxAPI():
|
|
|
360
360
|
---------------------------------------- ASYNC METHODS ----------------------------------------
|
|
361
361
|
"""
|
|
362
362
|
|
|
363
|
-
async def get_maps(self, use_cache: bool = True, session: aiohttp.ClientSession = None):
|
|
363
|
+
async def get_maps(self, use_cache: bool = True, session: aiohttp.ClientSession | None = None):
|
|
364
364
|
data: APIResponse = await self.get_data(endpoint="/maps", use_cache=use_cache, session=session)
|
|
365
365
|
return data.json
|
|
366
366
|
|
|
367
|
-
async def get_war(self, use_cache: bool = None, session: aiohttp.ClientSession = None):
|
|
367
|
+
async def get_war(self, use_cache: bool = None, session: aiohttp.ClientSession | None = None):
|
|
368
368
|
data: APIResponse = await self.get_data(endpoint="/war", use_cache=use_cache, session=session)
|
|
369
369
|
return data.json
|
|
370
370
|
|
|
371
|
-
async def get_static(self, hexagon: str, use_cache: bool = True, session: aiohttp.ClientSession = None):
|
|
371
|
+
async def get_static(self, hexagon: str, use_cache: bool = True, session: aiohttp.ClientSession | None = None):
|
|
372
372
|
if self._safe_mode:
|
|
373
373
|
hexagon: str = self._format_hexagon(hexagon)
|
|
374
374
|
|
|
375
375
|
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/static", use_cache=use_cache, session=session)
|
|
376
376
|
return data.json
|
|
377
377
|
|
|
378
|
-
async def get_dynamic(self, hexagon: str, use_cache: bool = None, session: aiohttp.ClientSession = None):
|
|
378
|
+
async def get_dynamic(self, hexagon: str, use_cache: bool = None, session: aiohttp.ClientSession | None = None):
|
|
379
379
|
if self._safe_mode:
|
|
380
380
|
hexagon: str = self._format_hexagon(hexagon)
|
|
381
381
|
|
|
382
382
|
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/dynamic/public", use_cache=use_cache, session=session)
|
|
383
383
|
return data.json
|
|
384
384
|
|
|
385
|
-
async def get_war_report(self, hexagon: str, use_cache: bool = None, session: aiohttp.ClientSession = None):
|
|
385
|
+
async def get_war_report(self, hexagon: str, use_cache: bool = None, session: aiohttp.ClientSession | None = None):
|
|
386
386
|
if self._safe_mode:
|
|
387
387
|
hexagon: str = self._format_hexagon(hexagon)
|
|
388
388
|
|
|
@@ -393,22 +393,22 @@ class FoxAPI():
|
|
|
393
393
|
---------------------------------------- ADDITIONAL ASYNC METHODS ----------------------------------------
|
|
394
394
|
"""
|
|
395
395
|
|
|
396
|
-
async def get_captured_towns(self, hexagon: str = None, dynamic: dict = None, static: dict = None) -> dict[str, str]:
|
|
396
|
+
async def get_captured_towns(self, hexagon: str = None, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None) -> dict[str, str]:
|
|
397
397
|
if hexagon is not None and static is None and dynamic is None:
|
|
398
|
-
static: dict = await self.get_static(hexagon, use_cache=True)
|
|
399
|
-
dynamic: dict = await self.get_dynamic(hexagon)
|
|
398
|
+
static: dict = await self.get_static(hexagon, use_cache=True, session=session)
|
|
399
|
+
dynamic: dict = await self.get_dynamic(hexagon, session=session)
|
|
400
400
|
|
|
401
401
|
if static is None or dynamic is None:
|
|
402
402
|
raise FoxAPIError("Please pass the required parameters (hexagon or (static and dynamic))")
|
|
403
403
|
|
|
404
404
|
return self.associate_towns(dynamic=dynamic, static=static)
|
|
405
405
|
|
|
406
|
-
async def make_map_png(self, hexagon: str, icons: str | list[int | str] = "all", colored: bool = False, dynamic: dict = None, static: dict = None):
|
|
406
|
+
async def make_map_png(self, hexagon: str, icons: str | list[int | str] = "all", colored: bool = False, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None):
|
|
407
407
|
if dynamic is None and (icons or colored):
|
|
408
|
-
dynamic: dict = await self.get_dynamic(hexagon=hexagon)
|
|
408
|
+
dynamic: dict = await self.get_dynamic(hexagon=hexagon, session=session)
|
|
409
409
|
|
|
410
410
|
if static is None and colored:
|
|
411
|
-
static: dict = await self.get_static(hexagon=hexagon, use_cache=True)
|
|
411
|
+
static: dict = await self.get_static(hexagon=hexagon, use_cache=True, session=session)
|
|
412
412
|
|
|
413
413
|
img1: Image = self.load_hexagon_map(hexagon)
|
|
414
414
|
|
|
@@ -420,28 +420,28 @@ class FoxAPI():
|
|
|
420
420
|
|
|
421
421
|
return img1
|
|
422
422
|
|
|
423
|
-
async def calculate_death_rate(self, hexagon: str = None, war_report: dict = None):
|
|
423
|
+
async def calculate_death_rate(self, hexagon: str = None, war_report: dict = None, session: aiohttp.ClientSession | None = None):
|
|
424
424
|
if self._safe_mode:
|
|
425
425
|
hexagon: str = self._format_hexagon(hexagon=hexagon)
|
|
426
426
|
|
|
427
427
|
if war_report is None:
|
|
428
|
-
war_report: dict = await self.get_war_report(hexagon)
|
|
428
|
+
war_report: dict = await self.get_war_report(hexagon, session=session)
|
|
429
429
|
|
|
430
430
|
if war_report is None:
|
|
431
431
|
raise FoxAPIError("Please pass the required parameters (hexagon or war_report)")
|
|
432
432
|
|
|
433
433
|
return self._calc_death_rate(hexagon=hexagon, war_report=war_report)
|
|
434
434
|
|
|
435
|
-
async def get_hexagon_data(self, hexagon: str, use_cache: bool = None):
|
|
435
|
+
async def get_hexagon_data(self, hexagon: str, use_cache: bool = None, session: aiohttp.ClientSession | None = None):
|
|
436
436
|
if self._safe_mode:
|
|
437
437
|
hexagon: str = self._format_hexagon(hexagon=hexagon)
|
|
438
438
|
|
|
439
|
-
war_report: dict = await self.get_war_report(hexagon=hexagon, use_cache=use_cache)
|
|
440
|
-
static: dict = await self.get_static(hexagon=hexagon, use_cache=True)
|
|
441
|
-
dynamic: dict = await self.get_dynamic(hexagon=hexagon, use_cache=use_cache)
|
|
439
|
+
war_report: dict = await self.get_war_report(hexagon=hexagon, use_cache=use_cache, session=session)
|
|
440
|
+
static: dict = await self.get_static(hexagon=hexagon, use_cache=True, session=session)
|
|
441
|
+
dynamic: dict = await self.get_dynamic(hexagon=hexagon, use_cache=use_cache, session=session)
|
|
442
442
|
|
|
443
|
-
captured_towns: dict = await self.get_captured_towns(dynamic=dynamic, static=static)
|
|
444
|
-
casualty_rate: dict = await self.calculate_death_rate(hexagon=hexagon, war_report=war_report)
|
|
443
|
+
captured_towns: dict = await self.get_captured_towns(dynamic=dynamic, static=static, session=session)
|
|
444
|
+
casualty_rate: dict = await self.calculate_death_rate(hexagon=hexagon, war_report=war_report, session=session)
|
|
445
445
|
|
|
446
446
|
return HexagonObject(hexagon=hexagon, war_report=war_report, static=static, dynamic=dynamic, captured_towns=captured_towns, casualty_rate=casualty_rate)
|
|
447
447
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.1
|
|
4
4
|
Summary: A wrapper for the foxhole API
|
|
5
5
|
Home-page: https://github.com/ThePhoenix78/FoxAPI
|
|
6
6
|
Download-URL: https://github.com/ThePhoenix78/FoxAPI/tarball/master
|
|
@@ -140,7 +140,7 @@ calc_distance(x1: float, y1: float, x2: float, y2: float) -> float
|
|
|
140
140
|
- Calculates the Euclidean distance between two points on the map.
|
|
141
141
|
|
|
142
142
|
```py
|
|
143
|
-
get_captured_towns(hexagon: str = None, dynamic: dict = None, static: dict = None) -> dict
|
|
143
|
+
get_captured_towns(hexagon: str = None, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None) -> dict
|
|
144
144
|
```
|
|
145
145
|
- Retrieves the captured towns for a given hexagon based on dynamic and static data.
|
|
146
146
|
|
|
@@ -151,14 +151,14 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
151
151
|
- Loads the PNG map for the specified hexagon.
|
|
152
152
|
|
|
153
153
|
```py
|
|
154
|
-
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
154
|
+
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: dict = None, static: dict = None, session: aiohttp.ClientSession | None = None) -> pillow.Image
|
|
155
155
|
```
|
|
156
156
|
- Generates a PNG image of the hexagon map with all the icons associated to each faction in their respective colors (included fields and town base). Only public data will be present.
|
|
157
157
|
- colored -> display each region in the team's color
|
|
158
158
|
- icons -> display selected building in their team's color
|
|
159
159
|
|
|
160
160
|
```py
|
|
161
|
-
calculate_death_rate(hexagon: str = None, war_report: dict = None): -> dict
|
|
161
|
+
calculate_death_rate(hexagon: str = None, war_report: dict = None, session: aiohttp.ClientSession | None = None): -> dict
|
|
162
162
|
```
|
|
163
163
|
- calculate the death rate between the first launch and the current one
|
|
164
164
|
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|