foxapi 1.8.1__tar.gz → 2.0.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.8.1 → foxapi-2.0.0}/PKG-INFO +82 -56
- {foxapi-1.8.1 → foxapi-2.0.0}/README.md +79 -38
- foxapi-2.0.0/foxapi/Images/MapIcons/36.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapIcons/88.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapIcons/89.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapIcons/90.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapIcons/91.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapIcons/92.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapIcons/MapIconHomeBaseHallColonial.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapIcons/MapIconHomeBaseHallWarden.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/FoxholeFestivalMapHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapAcrithiaHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapAllodsBightHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapAshFieldsHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapBasinSionnachHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapCallahansPassageHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapCallumsCapeHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapClahstraHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapClansheadValleyHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapDeadLandsHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapDrownedValeHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapEndlessShoreHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapFarranacCoastHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapFishermansRowHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapGodcroftsHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapGreatMarchHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapGutterHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapHeartlandsHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapHomeRegionC.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapHomeRegionW.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapHowlCountyHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapKalokaiHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapKingsCageHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapKuuraStrandHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapLinnMercyHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapLochMorHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapLykosIsleHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapMarbanHollowHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapMooringCountyHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapMorgensCrossingHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapNevishLineHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapOarbreakerHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapOlavisWakeHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapOnyxHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapOriginHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapPalantineBermHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapPariPeakHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapPipersEnclaveHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapReachingTrailHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapReaversPassHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapRedRiverHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapSableportHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapShackledChasmHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapSpeakingWoodsHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapStemaLandingHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapStlicanShelfHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapStonecradleHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapTempestIslandHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapTerminusHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapTheFingersHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapTyrantFoothillsHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapUmbralWildwoodHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapViperPitHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapWeatheredExpanseHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapWestgateHex.png +0 -0
- foxapi-2.0.0/foxapi/Images/MapsHex/MapWrestaHex.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/__init__.py +7 -3
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/foxapi.py +54 -53
- foxapi-2.0.0/foxapi/objects.py +181 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/utils.py +19 -53
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi.egg-info/PKG-INFO +82 -56
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi.egg-info/SOURCES.txt +22 -4
- {foxapi-1.8.1 → foxapi-2.0.0}/setup.py +2 -1
- foxapi-1.8.1/foxapi/Images/MapIcons/MapIconFortCursed.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapIcons/MapIconForwardBase1.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapAcrithiaHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapAllodsBightHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapAshFieldsHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapBasinSionnachHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapCallahansPassageHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapCallumsCapeHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapClahstraHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapClansheadValleyHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapDeadLandsHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapDrownedValeHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapEndlessShoreHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapFarranacCoastHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapFishermansRowHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapGodcroftsHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapGreatMarchHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapHeartlandsHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapHomeRegionC.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapHomeRegionW.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapHowlCountyHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapKalokaiHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapKingsCageHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapLinnMercyHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapLochMorHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapMarbanHollow.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapMooringCountyHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapMorgensCrossingHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapNevishLineHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapOarbreakerHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapOriginHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapReachingTrailHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapReaversPassHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapRedRiverHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapSableportHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapShackledChasmHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapSpeakingWoodsHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapStemaLandingHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapStlicanShelfHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapStonecradleHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapTempestIslandHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapTerminusHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapTheFingersHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapUmbralWildwoodHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapViperPitHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapWeatheredExpanseHex.png +0 -0
- foxapi-1.8.1/foxapi/Images/MapsHex/MapWestgateHex.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/LICENSE +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/10.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/11.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/12.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/13.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/14.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/15.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/16.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/17.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/18.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/19.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/20.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/21.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/22.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/23.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/27.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/28.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/29.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/30.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/32.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/33.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/34.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/35.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/37.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/38.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/39.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/40.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/41.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/45.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/46.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/47.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/5.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/51.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/52.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/53.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/54.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/56.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/57.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/58.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/59.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/6.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/60.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/61.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/62.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/7.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/70.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/71.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/72.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/75.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/8.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/83.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/84.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/9.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/DebugIcon.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/MapIconCivicCenter.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/MapIconScorchedTown.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/MapIconTownHall.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi/Images/MapIcons/MapIconVictory.png +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi.egg-info/dependency_links.txt +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi.egg-info/requires.txt +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/foxapi.egg-info/top_level.txt +0 -0
- {foxapi-1.8.1 → foxapi-2.0.0}/setup.cfg +0 -0
|
@@ -1,33 +1,18 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.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
|
|
7
7
|
Author: ThePhoenix78
|
|
8
8
|
Author-email: thephoenix788@gmail.com
|
|
9
9
|
License: MIT
|
|
10
|
-
Keywords: foxhole,foxapi,foxhole-game,foxhole-api
|
|
10
|
+
Keywords: foxhole,foxapi,foxhole-game,foxhole-api,warapi
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
|
-
Requires-Dist: requests
|
|
17
|
-
Requires-Dist: pillow
|
|
18
|
-
Requires-Dist: aiohttp
|
|
19
|
-
Dynamic: author
|
|
20
|
-
Dynamic: author-email
|
|
21
|
-
Dynamic: classifier
|
|
22
|
-
Dynamic: description
|
|
23
|
-
Dynamic: description-content-type
|
|
24
|
-
Dynamic: download-url
|
|
25
|
-
Dynamic: home-page
|
|
26
|
-
Dynamic: keywords
|
|
27
|
-
Dynamic: license
|
|
28
|
-
Dynamic: license-file
|
|
29
|
-
Dynamic: requires-dist
|
|
30
|
-
Dynamic: summary
|
|
31
16
|
|
|
32
17
|
# FoxAPI Documentation
|
|
33
18
|
|
|
@@ -41,7 +26,7 @@ pip install foxapi
|
|
|
41
26
|
|
|
42
27
|
`FoxAPI` is a wrapper for the Official Foxhole API. It provides methods to interact with various endpoints related to maps, war data, dynamic/static map states, and more. The client supports data caching and etags natively to avoid overloading the Foxhole servers.
|
|
43
28
|
|
|
44
|
-
If you are new to the developer world
|
|
29
|
+
If you are new to the developer world or just like coding, it's the perfect tool!
|
|
45
30
|
|
|
46
31
|
Also, if you work with discord.py or any asynchronous API, this tool might be useful as well since it support async methods natively as well as synchronous
|
|
47
32
|
|
|
@@ -86,12 +71,13 @@ class FoxAPI(shard: str = "", image_dir: str = None, safe_mode: bool = True)
|
|
|
86
71
|
#### Note : all of theses methods are async, to run the synchronous version, add _sync at the end (see API example)
|
|
87
72
|
|
|
88
73
|
```py
|
|
89
|
-
get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIResponse
|
|
74
|
+
get_data(endpoint: str, session: aiohttp.ClientSession | None = None, etag: str = None, use_cache: bool = False) -> APIResponse
|
|
90
75
|
```
|
|
91
76
|
Fetches data from the specified endpoint, you can choose to use cache instead of sending a request and you can pass ETag.
|
|
92
77
|
|
|
93
78
|
- Parameters:
|
|
94
79
|
- `endpoint` (str): The API endpoint to call.
|
|
80
|
+
- `session` (aiohttp.ClientSession, optional) the async session
|
|
95
81
|
- `etag` (str, optional): The ETag header for cache validation (not required since managed natively).
|
|
96
82
|
- `use_cache` (bool, optional): Whether to use cached data (default: False).
|
|
97
83
|
|
|
@@ -100,28 +86,28 @@ get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIRespons
|
|
|
100
86
|
### Map and War Data
|
|
101
87
|
|
|
102
88
|
```py
|
|
103
|
-
get_maps(use_cache: bool = True, session: aiohttp.ClientSession | None = None) -> list
|
|
89
|
+
get_maps(use_cache: bool = True, session: aiohttp.ClientSession | None = None) -> list[str]
|
|
104
90
|
```
|
|
105
91
|
- Retrieves a list of available hexagons (maps) in the game world.
|
|
106
92
|
|
|
107
93
|
```py
|
|
108
|
-
get_war(use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
94
|
+
get_war(use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> WarObject
|
|
109
95
|
```
|
|
110
96
|
- Retrieves the current war state (war data).
|
|
111
97
|
|
|
112
98
|
```py
|
|
113
|
-
get_static(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
99
|
+
get_static(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> SDObject
|
|
114
100
|
```
|
|
115
101
|
|
|
116
102
|
- Retrieves the static data for the specified hexagon.
|
|
117
103
|
|
|
118
104
|
```py
|
|
119
|
-
get_dynamic(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
105
|
+
get_dynamic(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> SDObject
|
|
120
106
|
```
|
|
121
107
|
- Retrieves the dynamic data for the specified hexagon.
|
|
122
108
|
|
|
123
109
|
```py
|
|
124
|
-
get_war_report(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
110
|
+
get_war_report(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> WarReportObject
|
|
125
111
|
```
|
|
126
112
|
- Retrieves the war report for the specified hexagon.
|
|
127
113
|
|
|
@@ -140,7 +126,7 @@ calc_distance(x1: float, y1: float, x2: float, y2: float) -> float
|
|
|
140
126
|
- Calculates the Euclidean distance between two points on the map.
|
|
141
127
|
|
|
142
128
|
```py
|
|
143
|
-
get_captured_towns(hexagon: str = None, dynamic:
|
|
129
|
+
get_captured_towns(hexagon: str = None, dynamic: SDObject = None, static: SDObject = None, session: aiohttp.ClientSession | None = None) -> dict
|
|
144
130
|
```
|
|
145
131
|
- Retrieves the captured towns for a given hexagon based on dynamic and static data.
|
|
146
132
|
|
|
@@ -151,14 +137,14 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
151
137
|
- Loads the PNG map for the specified hexagon.
|
|
152
138
|
|
|
153
139
|
```py
|
|
154
|
-
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic:
|
|
140
|
+
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: SDObject = None, static: SDObject = None, session: aiohttp.ClientSession | None = None) -> pillow.Image
|
|
155
141
|
```
|
|
156
142
|
- 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
143
|
- colored -> display each region in the team's color
|
|
158
144
|
- icons -> display selected building in their team's color
|
|
159
145
|
|
|
160
146
|
```py
|
|
161
|
-
calculate_death_rate(hexagon: str = None, war_report:
|
|
147
|
+
calculate_death_rate(hexagon: str = None, war_report: WarReportObject = None, session: aiohttp.ClientSession | None = None): -> dict
|
|
162
148
|
```
|
|
163
149
|
- calculate the death rate between the first launch and the current one
|
|
164
150
|
|
|
@@ -223,30 +209,70 @@ asyncio.run(main())
|
|
|
223
209
|
## Objects
|
|
224
210
|
|
|
225
211
|
```python
|
|
226
|
-
class Task:
|
|
227
|
-
def __init__(self, function: callable, args: any = "no_args", result: any = None):
|
|
228
|
-
self.function: callable = function
|
|
229
|
-
self.args: any = args
|
|
230
|
-
self.result: any = result
|
|
231
|
-
|
|
232
|
-
|
|
233
212
|
class APIResponse:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
self.is_cache: bool = is_cache
|
|
213
|
+
headers: dict
|
|
214
|
+
json: dict
|
|
215
|
+
status_code: int
|
|
216
|
+
hexagon: str
|
|
217
|
+
is_cache: bool
|
|
240
218
|
|
|
241
219
|
|
|
242
220
|
class HexagonObject:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
221
|
+
hexagon: str
|
|
222
|
+
war_report: WarReportObject
|
|
223
|
+
static: SDObject
|
|
224
|
+
dynamic: SDObject
|
|
225
|
+
captured_towns: dict
|
|
226
|
+
casualty_rate: dict
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class WarObject:
|
|
230
|
+
warId: str
|
|
231
|
+
warNumber: int
|
|
232
|
+
winner: str
|
|
233
|
+
conquestStartTime: str
|
|
234
|
+
conquestEndTime: str
|
|
235
|
+
resistanceStartTime: str
|
|
236
|
+
scheduledConquestEndTime: str
|
|
237
|
+
requiredVictoryTowns: str
|
|
238
|
+
shortRequiredVictoryTowns: str
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class WarReportObject:
|
|
242
|
+
totalEnlistments: int
|
|
243
|
+
colonialCasualties: int
|
|
244
|
+
wardenCasualties: int
|
|
245
|
+
dayOfWar: int
|
|
246
|
+
version: int
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class MapItemsObject:
|
|
250
|
+
teamId: str
|
|
251
|
+
iconType: int
|
|
252
|
+
x: float
|
|
253
|
+
y: float
|
|
254
|
+
flags: int
|
|
255
|
+
viewDirection: int
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
class MapTextItemsObject:
|
|
259
|
+
text: str
|
|
260
|
+
x: float
|
|
261
|
+
y: float
|
|
262
|
+
mapMarkerType: str
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class SDObject:
|
|
266
|
+
regionId: int
|
|
267
|
+
scorchedVictoryTowns: int
|
|
268
|
+
|
|
269
|
+
mapItems: list[MapItemsObject]
|
|
270
|
+
mapItemsC: list[MapItemsObject]
|
|
271
|
+
mapItemsW: list[MapItemsObject]
|
|
272
|
+
mapTextItems: list[MapTextItemsObject]
|
|
273
|
+
|
|
274
|
+
lastUpdated: int
|
|
275
|
+
version: int
|
|
250
276
|
```
|
|
251
277
|
|
|
252
278
|
|
|
@@ -268,12 +294,12 @@ fox = FoxAPI(shard="1")
|
|
|
268
294
|
def function(hexagon: str = "DeadLandsHex"):
|
|
269
295
|
# Get the list of available hexagons (maps) and state of the current war
|
|
270
296
|
maps: list = fox.get_maps_sync()
|
|
271
|
-
war:
|
|
297
|
+
war: WarObject = fox.get_war_sync()
|
|
272
298
|
|
|
273
299
|
# Retrieve data for a specific hexagon
|
|
274
|
-
dynamic_data:
|
|
275
|
-
static_data:
|
|
276
|
-
war_report:
|
|
300
|
+
dynamic_data: SDObject = fox.get_dynamic_sync(hexagon)
|
|
301
|
+
static_data: SDObject = fox.get_static_sync(hexagon)
|
|
302
|
+
war_report: WarReportObject = fox.get_war_report_sync(hexagon)
|
|
277
303
|
|
|
278
304
|
# Create a map PNG for a hexagon with building informations on it
|
|
279
305
|
map_image = fox.make_map_png_sync(hexagon)
|
|
@@ -288,12 +314,12 @@ def function(hexagon: str = "DeadLandsHex"):
|
|
|
288
314
|
async def function(hexagon: str = "DeadLandsHex"):
|
|
289
315
|
# Get the list of available hexagons (maps) and state of the current war
|
|
290
316
|
maps: list = await fox.get_maps()
|
|
291
|
-
war:
|
|
317
|
+
war: WarObject = await fox.get_war()
|
|
292
318
|
|
|
293
319
|
# Retrieve data for a specific hexagon
|
|
294
|
-
dynamic_data:
|
|
295
|
-
static_data:
|
|
296
|
-
war_report:
|
|
320
|
+
dynamic_data: SDObject = await fox.get_dynamic(hexagon)
|
|
321
|
+
static_data: SDObject = await fox.get_static(hexagon)
|
|
322
|
+
war_report: WarReportObject = await fox.get_war_report(hexagon)
|
|
297
323
|
|
|
298
324
|
# Create a map PNG for a hexagon with building informations on it
|
|
299
325
|
map_image = await fox.make_map_png(hexagon)
|
|
@@ -10,7 +10,7 @@ pip install foxapi
|
|
|
10
10
|
|
|
11
11
|
`FoxAPI` is a wrapper for the Official Foxhole API. It provides methods to interact with various endpoints related to maps, war data, dynamic/static map states, and more. The client supports data caching and etags natively to avoid overloading the Foxhole servers.
|
|
12
12
|
|
|
13
|
-
If you are new to the developer world
|
|
13
|
+
If you are new to the developer world or just like coding, it's the perfect tool!
|
|
14
14
|
|
|
15
15
|
Also, if you work with discord.py or any asynchronous API, this tool might be useful as well since it support async methods natively as well as synchronous
|
|
16
16
|
|
|
@@ -55,12 +55,13 @@ class FoxAPI(shard: str = "", image_dir: str = None, safe_mode: bool = True)
|
|
|
55
55
|
#### Note : all of theses methods are async, to run the synchronous version, add _sync at the end (see API example)
|
|
56
56
|
|
|
57
57
|
```py
|
|
58
|
-
get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIResponse
|
|
58
|
+
get_data(endpoint: str, session: aiohttp.ClientSession | None = None, etag: str = None, use_cache: bool = False) -> APIResponse
|
|
59
59
|
```
|
|
60
60
|
Fetches data from the specified endpoint, you can choose to use cache instead of sending a request and you can pass ETag.
|
|
61
61
|
|
|
62
62
|
- Parameters:
|
|
63
63
|
- `endpoint` (str): The API endpoint to call.
|
|
64
|
+
- `session` (aiohttp.ClientSession, optional) the async session
|
|
64
65
|
- `etag` (str, optional): The ETag header for cache validation (not required since managed natively).
|
|
65
66
|
- `use_cache` (bool, optional): Whether to use cached data (default: False).
|
|
66
67
|
|
|
@@ -69,28 +70,28 @@ get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIRespons
|
|
|
69
70
|
### Map and War Data
|
|
70
71
|
|
|
71
72
|
```py
|
|
72
|
-
get_maps(use_cache: bool = True, session: aiohttp.ClientSession | None = None) -> list
|
|
73
|
+
get_maps(use_cache: bool = True, session: aiohttp.ClientSession | None = None) -> list[str]
|
|
73
74
|
```
|
|
74
75
|
- Retrieves a list of available hexagons (maps) in the game world.
|
|
75
76
|
|
|
76
77
|
```py
|
|
77
|
-
get_war(use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
78
|
+
get_war(use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> WarObject
|
|
78
79
|
```
|
|
79
80
|
- Retrieves the current war state (war data).
|
|
80
81
|
|
|
81
82
|
```py
|
|
82
|
-
get_static(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
83
|
+
get_static(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> SDObject
|
|
83
84
|
```
|
|
84
85
|
|
|
85
86
|
- Retrieves the static data for the specified hexagon.
|
|
86
87
|
|
|
87
88
|
```py
|
|
88
|
-
get_dynamic(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
89
|
+
get_dynamic(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> SDObject
|
|
89
90
|
```
|
|
90
91
|
- Retrieves the dynamic data for the specified hexagon.
|
|
91
92
|
|
|
92
93
|
```py
|
|
93
|
-
get_war_report(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) ->
|
|
94
|
+
get_war_report(hexagon: str, use_cache: bool = False, session: aiohttp.ClientSession | None = None) -> WarReportObject
|
|
94
95
|
```
|
|
95
96
|
- Retrieves the war report for the specified hexagon.
|
|
96
97
|
|
|
@@ -109,7 +110,7 @@ calc_distance(x1: float, y1: float, x2: float, y2: float) -> float
|
|
|
109
110
|
- Calculates the Euclidean distance between two points on the map.
|
|
110
111
|
|
|
111
112
|
```py
|
|
112
|
-
get_captured_towns(hexagon: str = None, dynamic:
|
|
113
|
+
get_captured_towns(hexagon: str = None, dynamic: SDObject = None, static: SDObject = None, session: aiohttp.ClientSession | None = None) -> dict
|
|
113
114
|
```
|
|
114
115
|
- Retrieves the captured towns for a given hexagon based on dynamic and static data.
|
|
115
116
|
|
|
@@ -120,14 +121,14 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
120
121
|
- Loads the PNG map for the specified hexagon.
|
|
121
122
|
|
|
122
123
|
```py
|
|
123
|
-
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic:
|
|
124
|
+
make_map_png(hexagon: str, icons: str | list = "all", colored: bool = False, dynamic: SDObject = None, static: SDObject = None, session: aiohttp.ClientSession | None = None) -> pillow.Image
|
|
124
125
|
```
|
|
125
126
|
- 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
127
|
- colored -> display each region in the team's color
|
|
127
128
|
- icons -> display selected building in their team's color
|
|
128
129
|
|
|
129
130
|
```py
|
|
130
|
-
calculate_death_rate(hexagon: str = None, war_report:
|
|
131
|
+
calculate_death_rate(hexagon: str = None, war_report: WarReportObject = None, session: aiohttp.ClientSession | None = None): -> dict
|
|
131
132
|
```
|
|
132
133
|
- calculate the death rate between the first launch and the current one
|
|
133
134
|
|
|
@@ -192,30 +193,70 @@ asyncio.run(main())
|
|
|
192
193
|
## Objects
|
|
193
194
|
|
|
194
195
|
```python
|
|
195
|
-
class Task:
|
|
196
|
-
def __init__(self, function: callable, args: any = "no_args", result: any = None):
|
|
197
|
-
self.function: callable = function
|
|
198
|
-
self.args: any = args
|
|
199
|
-
self.result: any = result
|
|
200
|
-
|
|
201
|
-
|
|
202
196
|
class APIResponse:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
self.is_cache: bool = is_cache
|
|
197
|
+
headers: dict
|
|
198
|
+
json: dict
|
|
199
|
+
status_code: int
|
|
200
|
+
hexagon: str
|
|
201
|
+
is_cache: bool
|
|
209
202
|
|
|
210
203
|
|
|
211
204
|
class HexagonObject:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
205
|
+
hexagon: str
|
|
206
|
+
war_report: WarReportObject
|
|
207
|
+
static: SDObject
|
|
208
|
+
dynamic: SDObject
|
|
209
|
+
captured_towns: dict
|
|
210
|
+
casualty_rate: dict
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class WarObject:
|
|
214
|
+
warId: str
|
|
215
|
+
warNumber: int
|
|
216
|
+
winner: str
|
|
217
|
+
conquestStartTime: str
|
|
218
|
+
conquestEndTime: str
|
|
219
|
+
resistanceStartTime: str
|
|
220
|
+
scheduledConquestEndTime: str
|
|
221
|
+
requiredVictoryTowns: str
|
|
222
|
+
shortRequiredVictoryTowns: str
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class WarReportObject:
|
|
226
|
+
totalEnlistments: int
|
|
227
|
+
colonialCasualties: int
|
|
228
|
+
wardenCasualties: int
|
|
229
|
+
dayOfWar: int
|
|
230
|
+
version: int
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class MapItemsObject:
|
|
234
|
+
teamId: str
|
|
235
|
+
iconType: int
|
|
236
|
+
x: float
|
|
237
|
+
y: float
|
|
238
|
+
flags: int
|
|
239
|
+
viewDirection: int
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class MapTextItemsObject:
|
|
243
|
+
text: str
|
|
244
|
+
x: float
|
|
245
|
+
y: float
|
|
246
|
+
mapMarkerType: str
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class SDObject:
|
|
250
|
+
regionId: int
|
|
251
|
+
scorchedVictoryTowns: int
|
|
252
|
+
|
|
253
|
+
mapItems: list[MapItemsObject]
|
|
254
|
+
mapItemsC: list[MapItemsObject]
|
|
255
|
+
mapItemsW: list[MapItemsObject]
|
|
256
|
+
mapTextItems: list[MapTextItemsObject]
|
|
257
|
+
|
|
258
|
+
lastUpdated: int
|
|
259
|
+
version: int
|
|
219
260
|
```
|
|
220
261
|
|
|
221
262
|
|
|
@@ -237,12 +278,12 @@ fox = FoxAPI(shard="1")
|
|
|
237
278
|
def function(hexagon: str = "DeadLandsHex"):
|
|
238
279
|
# Get the list of available hexagons (maps) and state of the current war
|
|
239
280
|
maps: list = fox.get_maps_sync()
|
|
240
|
-
war:
|
|
281
|
+
war: WarObject = fox.get_war_sync()
|
|
241
282
|
|
|
242
283
|
# Retrieve data for a specific hexagon
|
|
243
|
-
dynamic_data:
|
|
244
|
-
static_data:
|
|
245
|
-
war_report:
|
|
284
|
+
dynamic_data: SDObject = fox.get_dynamic_sync(hexagon)
|
|
285
|
+
static_data: SDObject = fox.get_static_sync(hexagon)
|
|
286
|
+
war_report: WarReportObject = fox.get_war_report_sync(hexagon)
|
|
246
287
|
|
|
247
288
|
# Create a map PNG for a hexagon with building informations on it
|
|
248
289
|
map_image = fox.make_map_png_sync(hexagon)
|
|
@@ -257,12 +298,12 @@ def function(hexagon: str = "DeadLandsHex"):
|
|
|
257
298
|
async def function(hexagon: str = "DeadLandsHex"):
|
|
258
299
|
# Get the list of available hexagons (maps) and state of the current war
|
|
259
300
|
maps: list = await fox.get_maps()
|
|
260
|
-
war:
|
|
301
|
+
war: WarObject = await fox.get_war()
|
|
261
302
|
|
|
262
303
|
# Retrieve data for a specific hexagon
|
|
263
|
-
dynamic_data:
|
|
264
|
-
static_data:
|
|
265
|
-
war_report:
|
|
304
|
+
dynamic_data: SDObject = await fox.get_dynamic(hexagon)
|
|
305
|
+
static_data: SDObject = await fox.get_static(hexagon)
|
|
306
|
+
war_report: WarReportObject = await fox.get_war_report(hexagon)
|
|
266
307
|
|
|
267
308
|
# Create a map PNG for a hexagon with building informations on it
|
|
268
309
|
map_image = await fox.make_map_png(hexagon)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from .foxapi import FoxAPI
|
|
2
|
-
from .utils import HexagonObject, FoxAPIError, HexagonError, EndpointError, APIResponse, Task
|
|
2
|
+
from .utils import HexagonObject, FoxAPIError, HexagonError, EndpointError, APIResponse, Task, _images_relations, _map_flags
|
|
3
|
+
from .objects import WarObject, WarReportObject, SDObject
|
|
3
4
|
|
|
4
5
|
import requests, json
|
|
5
6
|
|
|
@@ -9,7 +10,7 @@ __author__ = 'ThePhoenix78'
|
|
|
9
10
|
__license__ = 'MIT'
|
|
10
11
|
__copyright__ = 'Copyright 2024-2026 ThePhoenix78'
|
|
11
12
|
__url__ = 'https://github.com/ThePhoenix78/FoxAPI'
|
|
12
|
-
__newest__ = __version__ = '
|
|
13
|
+
__newest__ = __version__ = '2.0.0'
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
try:
|
|
@@ -24,4 +25,7 @@ finally:
|
|
|
24
25
|
if __version__ < __newest__:
|
|
25
26
|
print(f"New version of {__title__} available: {__newest__} (Using {__version__})")
|
|
26
27
|
else:
|
|
27
|
-
print(f"version : {__version__}")
|
|
28
|
+
print(f"version : {__version__}")
|
|
29
|
+
print("NOTE: This version use Objects instead of raw JSON, consider using obj.json to access the raw JSON")
|
|
30
|
+
print("Saving with json.dumps(obj) will not work, use json.dumps(obj.json) instead")
|
|
31
|
+
print("Start using obj.attribute instead of obj['attribute'] as it will be deprecated soon (my magic isn't strong enough to keep it all together)")
|