foxapi 1.7.1__tar.gz → 1.8.0__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.7.1 → foxapi-1.8.0}/PKG-INFO +7 -7
- {foxapi-1.7.1 → foxapi-1.8.0}/README.md +6 -6
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/__init__.py +2 -2
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/foxapi.py +13 -12
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/utils.py +2 -1
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi.egg-info/PKG-INFO +7 -7
- {foxapi-1.7.1 → foxapi-1.8.0}/LICENSE +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/10.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/11.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/12.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/13.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/14.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/15.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/16.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/17.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/18.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/19.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/20.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/21.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/22.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/23.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/27.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/28.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/29.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/30.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/32.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/33.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/34.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/35.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/37.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/38.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/39.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/40.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/41.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/45.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/46.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/47.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/5.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/51.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/52.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/53.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/54.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/56.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/57.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/58.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/59.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/6.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/60.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/61.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/62.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/7.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/70.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/71.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/72.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/75.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/8.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/83.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/84.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/9.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/DebugIcon.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/MapIconCivicCenter.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/MapIconFortCursed.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/MapIconForwardBase1.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/MapIconScorchedTown.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/MapIconTownHall.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapIcons/MapIconVictory.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapAcrithiaHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapAllodsBightHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapAshFieldsHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapBasinSionnachHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapCallahansPassageHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapCallumsCapeHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapClahstraHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapClansheadValleyHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapDeadLandsHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapDrownedValeHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapEndlessShoreHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapFarranacCoastHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapFishermansRowHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapGodcroftsHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapGreatMarchHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapHeartlandsHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapHomeRegionC.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapHomeRegionW.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapHowlCountyHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapKalokaiHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapKingsCageHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapLinnMercyHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapLochMorHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapMarbanHollow.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapMooringCountyHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapMorgensCrossingHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapNevishLineHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapOarbreakerHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapOriginHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapReachingTrailHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapReaversPassHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapRedRiverHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapSableportHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapShackledChasmHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapSpeakingWoodsHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapStemaLandingHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapStlicanShelfHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapStonecradleHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapTempestIslandHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapTerminusHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapTheFingersHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapUmbralWildwoodHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapViperPitHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapWeatheredExpanseHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi/Images/MapsHex/MapWestgateHex.png +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi.egg-info/SOURCES.txt +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi.egg-info/dependency_links.txt +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi.egg-info/requires.txt +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/foxapi.egg-info/top_level.txt +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/setup.cfg +0 -0
- {foxapi-1.7.1 → foxapi-1.8.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
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
|
|
@@ -100,33 +100,33 @@ get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIRespons
|
|
|
100
100
|
### Map and War Data
|
|
101
101
|
|
|
102
102
|
```py
|
|
103
|
-
get_maps(use_cache: bool = True) -> list
|
|
103
|
+
get_maps(use_cache: bool = True, session: aiohttp.ClientSession | None = None) -> list
|
|
104
104
|
```
|
|
105
105
|
- Retrieves a list of available hexagons (maps) in the game world.
|
|
106
106
|
|
|
107
107
|
```py
|
|
108
|
-
get_war(use_cache: bool = False) -> dict
|
|
108
|
+
get_war(use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
109
109
|
```
|
|
110
110
|
- Retrieves the current war state (war data).
|
|
111
111
|
|
|
112
112
|
```py
|
|
113
|
-
get_static(hexagon: str, use_cache: bool = False) -> dict
|
|
113
|
+
get_static(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
- Retrieves the static data for the specified hexagon.
|
|
117
117
|
|
|
118
118
|
```py
|
|
119
|
-
get_dynamic(hexagon: str, use_cache: bool = False) -> dict
|
|
119
|
+
get_dynamic(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
120
120
|
```
|
|
121
121
|
- Retrieves the dynamic data for the specified hexagon.
|
|
122
122
|
|
|
123
123
|
```py
|
|
124
|
-
get_war_report(hexagon: str, use_cache: bool = False) -> dict
|
|
124
|
+
get_war_report(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
125
125
|
```
|
|
126
126
|
- Retrieves the war report for the specified hexagon.
|
|
127
127
|
|
|
128
128
|
```py
|
|
129
|
-
get_hexagon_data(hexagon: str, use_cache: bool = False) -> HexagonObject
|
|
129
|
+
get_hexagon_data(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> HexagonObject
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
- Retrieves all the data awailable for the specified hexagon.
|
|
@@ -69,33 +69,33 @@ get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIRespons
|
|
|
69
69
|
### Map and War Data
|
|
70
70
|
|
|
71
71
|
```py
|
|
72
|
-
get_maps(use_cache: bool = True) -> list
|
|
72
|
+
get_maps(use_cache: bool = True, session: aiohttp.ClientSession | None = None) -> list
|
|
73
73
|
```
|
|
74
74
|
- Retrieves a list of available hexagons (maps) in the game world.
|
|
75
75
|
|
|
76
76
|
```py
|
|
77
|
-
get_war(use_cache: bool = False) -> dict
|
|
77
|
+
get_war(use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
78
78
|
```
|
|
79
79
|
- Retrieves the current war state (war data).
|
|
80
80
|
|
|
81
81
|
```py
|
|
82
|
-
get_static(hexagon: str, use_cache: bool = False) -> dict
|
|
82
|
+
get_static(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
- Retrieves the static data for the specified hexagon.
|
|
86
86
|
|
|
87
87
|
```py
|
|
88
|
-
get_dynamic(hexagon: str, use_cache: bool = False) -> dict
|
|
88
|
+
get_dynamic(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
89
89
|
```
|
|
90
90
|
- Retrieves the dynamic data for the specified hexagon.
|
|
91
91
|
|
|
92
92
|
```py
|
|
93
|
-
get_war_report(hexagon: str, use_cache: bool = False) -> dict
|
|
93
|
+
get_war_report(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
94
94
|
```
|
|
95
95
|
- Retrieves the war report for the specified hexagon.
|
|
96
96
|
|
|
97
97
|
```py
|
|
98
|
-
get_hexagon_data(hexagon: str, use_cache: bool = False) -> HexagonObject
|
|
98
|
+
get_hexagon_data(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> HexagonObject
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
- Retrieves all the data awailable for the specified hexagon.
|
|
@@ -7,9 +7,9 @@ import requests, json
|
|
|
7
7
|
__title__ = 'FoxAPI'
|
|
8
8
|
__author__ = 'ThePhoenix78'
|
|
9
9
|
__license__ = 'MIT'
|
|
10
|
-
__copyright__ = 'Copyright 2024-
|
|
10
|
+
__copyright__ = 'Copyright 2024-2026 ThePhoenix78'
|
|
11
11
|
__url__ = 'https://github.com/ThePhoenix78/FoxAPI'
|
|
12
|
-
__newest__ = __version__ = '1.
|
|
12
|
+
__newest__ = __version__ = '1.8.0'
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
try:
|
|
@@ -130,15 +130,16 @@ class FoxAPI():
|
|
|
130
130
|
async with aiohttp.ClientSession() as session:
|
|
131
131
|
async with session.get(f"{self.base_api}{endpoint}", headers=headers) as data:
|
|
132
132
|
self.etag[endpoint] = data.headers.get("ETag", self.etag.get(endpoint))
|
|
133
|
-
data_json = await data.json()
|
|
134
133
|
|
|
135
134
|
if data.status == 200:
|
|
135
|
+
data_json = await data.json()
|
|
136
136
|
self.cache[endpoint] = data_json
|
|
137
137
|
return APIResponse(headers=data.headers, json=data_json, status_code=data.status, hexagon=hexagon, is_cache=False)
|
|
138
138
|
|
|
139
139
|
elif data.status == 304:
|
|
140
140
|
return APIResponse(headers=data.headers, json=self.cache.get(endpoint), status_code=data.status, hexagon=hexagon, is_cache=True)
|
|
141
|
-
|
|
141
|
+
|
|
142
|
+
data_json = await data.json()
|
|
142
143
|
return APIResponse(headers=data.headers, json=data_json, status_code=data.status, hexagon=hexagon, is_cache=False)
|
|
143
144
|
else:
|
|
144
145
|
async with session.get(f"{self.base_api}{endpoint}", headers=headers) as data:
|
|
@@ -359,33 +360,33 @@ class FoxAPI():
|
|
|
359
360
|
---------------------------------------- ASYNC METHODS ----------------------------------------
|
|
360
361
|
"""
|
|
361
362
|
|
|
362
|
-
async def get_maps(self, use_cache: bool = True):
|
|
363
|
-
data: APIResponse = await self.get_data(endpoint="/maps", use_cache=use_cache)
|
|
363
|
+
async def get_maps(self, use_cache: bool = True, session: aiohttp.ClientSession = None):
|
|
364
|
+
data: APIResponse = await self.get_data(endpoint="/maps", use_cache=use_cache, session=session)
|
|
364
365
|
return data.json
|
|
365
366
|
|
|
366
|
-
async def get_war(self, use_cache: bool = None):
|
|
367
|
-
data: APIResponse = await self.get_data(endpoint="/war", use_cache=use_cache)
|
|
367
|
+
async def get_war(self, use_cache: bool = None, session: aiohttp.ClientSession = None):
|
|
368
|
+
data: APIResponse = await self.get_data(endpoint="/war", use_cache=use_cache, session=session)
|
|
368
369
|
return data.json
|
|
369
370
|
|
|
370
|
-
async def get_static(self, hexagon: str, use_cache: bool = True):
|
|
371
|
+
async def get_static(self, hexagon: str, use_cache: bool = True, session: aiohttp.ClientSession = None):
|
|
371
372
|
if self._safe_mode:
|
|
372
373
|
hexagon: str = self._format_hexagon(hexagon)
|
|
373
374
|
|
|
374
|
-
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/static", use_cache=use_cache)
|
|
375
|
+
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/static", use_cache=use_cache, session=session)
|
|
375
376
|
return data.json
|
|
376
377
|
|
|
377
|
-
async def get_dynamic(self, hexagon: str, use_cache: bool = None):
|
|
378
|
+
async def get_dynamic(self, hexagon: str, use_cache: bool = None, session: aiohttp.ClientSession = None):
|
|
378
379
|
if self._safe_mode:
|
|
379
380
|
hexagon: str = self._format_hexagon(hexagon)
|
|
380
381
|
|
|
381
|
-
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/dynamic/public", use_cache=use_cache)
|
|
382
|
+
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/dynamic/public", use_cache=use_cache, session=session)
|
|
382
383
|
return data.json
|
|
383
384
|
|
|
384
|
-
async def get_war_report(self, hexagon: str, use_cache: bool = None):
|
|
385
|
+
async def get_war_report(self, hexagon: str, use_cache: bool = None, session: aiohttp.ClientSession = None):
|
|
385
386
|
if self._safe_mode:
|
|
386
387
|
hexagon: str = self._format_hexagon(hexagon)
|
|
387
388
|
|
|
388
|
-
data: APIResponse = await self.get_data(endpoint=f"/warReport/{hexagon}", use_cache=use_cache)
|
|
389
|
+
data: APIResponse = await self.get_data(endpoint=f"/warReport/{hexagon}", use_cache=use_cache, session=session)
|
|
389
390
|
return data.json
|
|
390
391
|
|
|
391
392
|
"""
|
|
@@ -95,7 +95,7 @@ class HexagonObject:
|
|
|
95
95
|
self.captured_towns: dict = captured_towns
|
|
96
96
|
self.casualty_rate: dict = casualty_rate
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
'''
|
|
99
99
|
class FoxObject:
|
|
100
100
|
"""
|
|
101
101
|
Universal wrapper for any kind of dict item
|
|
@@ -140,3 +140,4 @@ class APIObject:
|
|
|
140
140
|
|
|
141
141
|
def items(self):
|
|
142
142
|
return self.json.__dict__.items()
|
|
143
|
+
'''
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
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
|
|
@@ -100,33 +100,33 @@ get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIRespons
|
|
|
100
100
|
### Map and War Data
|
|
101
101
|
|
|
102
102
|
```py
|
|
103
|
-
get_maps(use_cache: bool = True) -> list
|
|
103
|
+
get_maps(use_cache: bool = True, session: aiohttp.ClientSession | None = None) -> list
|
|
104
104
|
```
|
|
105
105
|
- Retrieves a list of available hexagons (maps) in the game world.
|
|
106
106
|
|
|
107
107
|
```py
|
|
108
|
-
get_war(use_cache: bool = False) -> dict
|
|
108
|
+
get_war(use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
109
109
|
```
|
|
110
110
|
- Retrieves the current war state (war data).
|
|
111
111
|
|
|
112
112
|
```py
|
|
113
|
-
get_static(hexagon: str, use_cache: bool = False) -> dict
|
|
113
|
+
get_static(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
- Retrieves the static data for the specified hexagon.
|
|
117
117
|
|
|
118
118
|
```py
|
|
119
|
-
get_dynamic(hexagon: str, use_cache: bool = False) -> dict
|
|
119
|
+
get_dynamic(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
120
120
|
```
|
|
121
121
|
- Retrieves the dynamic data for the specified hexagon.
|
|
122
122
|
|
|
123
123
|
```py
|
|
124
|
-
get_war_report(hexagon: str, use_cache: bool = False) -> dict
|
|
124
|
+
get_war_report(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> dict
|
|
125
125
|
```
|
|
126
126
|
- Retrieves the war report for the specified hexagon.
|
|
127
127
|
|
|
128
128
|
```py
|
|
129
|
-
get_hexagon_data(hexagon: str, use_cache: bool = False) -> HexagonObject
|
|
129
|
+
get_hexagon_data(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> HexagonObject
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
- Retrieves all the data awailable for the specified hexagon.
|
|
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
|