foxapi 1.0.5__tar.gz → 1.0.7__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.0.5 → foxapi-1.0.7}/PKG-INFO +12 -12
- {foxapi-1.0.5 → foxapi-1.0.7}/README.md +11 -11
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi/foxapi.py +1 -2
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi.egg-info/PKG-INFO +12 -12
- {foxapi-1.0.5 → foxapi-1.0.7}/setup.py +1 -1
- {foxapi-1.0.5 → foxapi-1.0.7}/LICENSE +0 -0
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi/__init__.py +0 -0
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi/utils.py +0 -0
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi.egg-info/SOURCES.txt +0 -0
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi.egg-info/dependency_links.txt +0 -0
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi.egg-info/requires.txt +0 -0
- {foxapi-1.0.5 → foxapi-1.0.7}/foxapi.egg-info/top_level.txt +0 -0
- {foxapi-1.0.5 → foxapi-1.0.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
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
|
|
@@ -64,34 +64,34 @@ class FoxAPI(image_dir: str = None, safe_mode: bool = True)
|
|
|
64
64
|
|
|
65
65
|
#### Note : all of theses methods are async, to run the synchronous version, add _sync at the end (see API example)
|
|
66
66
|
|
|
67
|
-
- **get_data(endpoint: str, etag: str = None,
|
|
68
|
-
Fetches data from the specified endpoint
|
|
67
|
+
- **get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIResponse**
|
|
68
|
+
Fetches data from the specified endpoint, you can choose to use cache instead of sending a request and you can pass ETag.
|
|
69
69
|
|
|
70
70
|
- Parameters:
|
|
71
71
|
- `endpoint` (str): The API endpoint to call.
|
|
72
72
|
- `etag` (str, optional): The ETag header for cache validation (not required since managed natively).
|
|
73
73
|
- `cache` (bool, optional): Whether to use cached data (default: False).
|
|
74
74
|
|
|
75
|
-
- Returns: The response data from the API as a
|
|
75
|
+
- Returns: The response data from the API as a APIResponse object.
|
|
76
76
|
|
|
77
77
|
### Map and War Data
|
|
78
78
|
|
|
79
|
-
- **get_maps(
|
|
79
|
+
- **get_maps(use_cache: bool = True) -> list**
|
|
80
80
|
Retrieves a list of available hexagons (maps) in the game world.
|
|
81
81
|
|
|
82
|
-
- **get_war(
|
|
82
|
+
- **get_war(use_cache: bool = False) -> dict**
|
|
83
83
|
Retrieves the current war state (war data).
|
|
84
84
|
|
|
85
|
-
- **get_static(hexagon: str,
|
|
85
|
+
- **get_static(hexagon: str, use_cache: bool = False) -> dict**
|
|
86
86
|
Retrieves the static data for the specified hexagon.
|
|
87
87
|
|
|
88
|
-
- **get_dynamic(hexagon: str,
|
|
88
|
+
- **get_dynamic(hexagon: str, use_cache: bool = False) -> dict**
|
|
89
89
|
Retrieves the dynamic data for the specified hexagon.
|
|
90
90
|
|
|
91
|
-
- **get_war_report(hexagon: str,
|
|
91
|
+
- **get_war_report(hexagon: str, use_cache: bool = False) -> dict**
|
|
92
92
|
Retrieves the war report for the specified hexagon.
|
|
93
93
|
|
|
94
|
-
- **get_hexagon_data(hexagon: str,
|
|
94
|
+
- **get_hexagon_data(hexagon: str, use_cache: bool = False) -> HexagonObject**
|
|
95
95
|
Retrieves all the data awailable for the specified hexagon.
|
|
96
96
|
|
|
97
97
|
### Hexagon Operations
|
|
@@ -130,12 +130,12 @@ class FoxAPI(image_dir: str = None, safe_mode: bool = True)
|
|
|
130
130
|
|
|
131
131
|
```python
|
|
132
132
|
class APIResponse:
|
|
133
|
-
def __init__(self, headers: dict, json: dict, status_code: int, hexagon: str,
|
|
133
|
+
def __init__(self, headers: dict, json: dict, status_code: int, hexagon: str, is_use_cache: bool):
|
|
134
134
|
self.headers: dict = headers
|
|
135
135
|
self.json: dict = json
|
|
136
136
|
self.status_code: int = status_code
|
|
137
137
|
self.hexagon: str = hexagon
|
|
138
|
-
self.
|
|
138
|
+
self.is_use_cache: bool = is_cache
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
class HexagonObject:
|
|
@@ -46,34 +46,34 @@ class FoxAPI(image_dir: str = None, safe_mode: bool = True)
|
|
|
46
46
|
|
|
47
47
|
#### Note : all of theses methods are async, to run the synchronous version, add _sync at the end (see API example)
|
|
48
48
|
|
|
49
|
-
- **get_data(endpoint: str, etag: str = None,
|
|
50
|
-
Fetches data from the specified endpoint
|
|
49
|
+
- **get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIResponse**
|
|
50
|
+
Fetches data from the specified endpoint, you can choose to use cache instead of sending a request and you can pass ETag.
|
|
51
51
|
|
|
52
52
|
- Parameters:
|
|
53
53
|
- `endpoint` (str): The API endpoint to call.
|
|
54
54
|
- `etag` (str, optional): The ETag header for cache validation (not required since managed natively).
|
|
55
55
|
- `cache` (bool, optional): Whether to use cached data (default: False).
|
|
56
56
|
|
|
57
|
-
- Returns: The response data from the API as a
|
|
57
|
+
- Returns: The response data from the API as a APIResponse object.
|
|
58
58
|
|
|
59
59
|
### Map and War Data
|
|
60
60
|
|
|
61
|
-
- **get_maps(
|
|
61
|
+
- **get_maps(use_cache: bool = True) -> list**
|
|
62
62
|
Retrieves a list of available hexagons (maps) in the game world.
|
|
63
63
|
|
|
64
|
-
- **get_war(
|
|
64
|
+
- **get_war(use_cache: bool = False) -> dict**
|
|
65
65
|
Retrieves the current war state (war data).
|
|
66
66
|
|
|
67
|
-
- **get_static(hexagon: str,
|
|
67
|
+
- **get_static(hexagon: str, use_cache: bool = False) -> dict**
|
|
68
68
|
Retrieves the static data for the specified hexagon.
|
|
69
69
|
|
|
70
|
-
- **get_dynamic(hexagon: str,
|
|
70
|
+
- **get_dynamic(hexagon: str, use_cache: bool = False) -> dict**
|
|
71
71
|
Retrieves the dynamic data for the specified hexagon.
|
|
72
72
|
|
|
73
|
-
- **get_war_report(hexagon: str,
|
|
73
|
+
- **get_war_report(hexagon: str, use_cache: bool = False) -> dict**
|
|
74
74
|
Retrieves the war report for the specified hexagon.
|
|
75
75
|
|
|
76
|
-
- **get_hexagon_data(hexagon: str,
|
|
76
|
+
- **get_hexagon_data(hexagon: str, use_cache: bool = False) -> HexagonObject**
|
|
77
77
|
Retrieves all the data awailable for the specified hexagon.
|
|
78
78
|
|
|
79
79
|
### Hexagon Operations
|
|
@@ -112,12 +112,12 @@ class FoxAPI(image_dir: str = None, safe_mode: bool = True)
|
|
|
112
112
|
|
|
113
113
|
```python
|
|
114
114
|
class APIResponse:
|
|
115
|
-
def __init__(self, headers: dict, json: dict, status_code: int, hexagon: str,
|
|
115
|
+
def __init__(self, headers: dict, json: dict, status_code: int, hexagon: str, is_use_cache: bool):
|
|
116
116
|
self.headers: dict = headers
|
|
117
117
|
self.json: dict = json
|
|
118
118
|
self.status_code: int = status_code
|
|
119
119
|
self.hexagon: str = hexagon
|
|
120
|
-
self.
|
|
120
|
+
self.is_use_cache: bool = is_cache
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
class HexagonObject:
|
|
@@ -33,11 +33,10 @@ class FoxAPI():
|
|
|
33
33
|
self.cache: dict = {}
|
|
34
34
|
self.etag: dict = {}
|
|
35
35
|
|
|
36
|
-
self._refresh: int = 30
|
|
37
|
-
|
|
38
36
|
self._death_rate_w : dict = {}
|
|
39
37
|
self._death_rate_c : dict = {}
|
|
40
38
|
|
|
39
|
+
self._refresh: int = 60
|
|
41
40
|
self._cpt_rate_total: int = 3600 // self._refresh
|
|
42
41
|
self._cpt_rate: int = 0
|
|
43
42
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
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
|
|
@@ -64,34 +64,34 @@ class FoxAPI(image_dir: str = None, safe_mode: bool = True)
|
|
|
64
64
|
|
|
65
65
|
#### Note : all of theses methods are async, to run the synchronous version, add _sync at the end (see API example)
|
|
66
66
|
|
|
67
|
-
- **get_data(endpoint: str, etag: str = None,
|
|
68
|
-
Fetches data from the specified endpoint
|
|
67
|
+
- **get_data(endpoint: str, etag: str = None, use_cache: bool = False) -> APIResponse**
|
|
68
|
+
Fetches data from the specified endpoint, you can choose to use cache instead of sending a request and you can pass ETag.
|
|
69
69
|
|
|
70
70
|
- Parameters:
|
|
71
71
|
- `endpoint` (str): The API endpoint to call.
|
|
72
72
|
- `etag` (str, optional): The ETag header for cache validation (not required since managed natively).
|
|
73
73
|
- `cache` (bool, optional): Whether to use cached data (default: False).
|
|
74
74
|
|
|
75
|
-
- Returns: The response data from the API as a
|
|
75
|
+
- Returns: The response data from the API as a APIResponse object.
|
|
76
76
|
|
|
77
77
|
### Map and War Data
|
|
78
78
|
|
|
79
|
-
- **get_maps(
|
|
79
|
+
- **get_maps(use_cache: bool = True) -> list**
|
|
80
80
|
Retrieves a list of available hexagons (maps) in the game world.
|
|
81
81
|
|
|
82
|
-
- **get_war(
|
|
82
|
+
- **get_war(use_cache: bool = False) -> dict**
|
|
83
83
|
Retrieves the current war state (war data).
|
|
84
84
|
|
|
85
|
-
- **get_static(hexagon: str,
|
|
85
|
+
- **get_static(hexagon: str, use_cache: bool = False) -> dict**
|
|
86
86
|
Retrieves the static data for the specified hexagon.
|
|
87
87
|
|
|
88
|
-
- **get_dynamic(hexagon: str,
|
|
88
|
+
- **get_dynamic(hexagon: str, use_cache: bool = False) -> dict**
|
|
89
89
|
Retrieves the dynamic data for the specified hexagon.
|
|
90
90
|
|
|
91
|
-
- **get_war_report(hexagon: str,
|
|
91
|
+
- **get_war_report(hexagon: str, use_cache: bool = False) -> dict**
|
|
92
92
|
Retrieves the war report for the specified hexagon.
|
|
93
93
|
|
|
94
|
-
- **get_hexagon_data(hexagon: str,
|
|
94
|
+
- **get_hexagon_data(hexagon: str, use_cache: bool = False) -> HexagonObject**
|
|
95
95
|
Retrieves all the data awailable for the specified hexagon.
|
|
96
96
|
|
|
97
97
|
### Hexagon Operations
|
|
@@ -130,12 +130,12 @@ class FoxAPI(image_dir: str = None, safe_mode: bool = True)
|
|
|
130
130
|
|
|
131
131
|
```python
|
|
132
132
|
class APIResponse:
|
|
133
|
-
def __init__(self, headers: dict, json: dict, status_code: int, hexagon: str,
|
|
133
|
+
def __init__(self, headers: dict, json: dict, status_code: int, hexagon: str, is_use_cache: bool):
|
|
134
134
|
self.headers: dict = headers
|
|
135
135
|
self.json: dict = json
|
|
136
136
|
self.status_code: int = status_code
|
|
137
137
|
self.hexagon: str = hexagon
|
|
138
|
-
self.
|
|
138
|
+
self.is_use_cache: bool = is_cache
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
class HexagonObject:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|