wbapi-async 0.7.7__tar.gz → 0.7.8__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.
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/PKG-INFO +1 -1
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/pyproject.toml +1 -1
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/utils/paginate.py +19 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/.gitignore +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/LICENSE +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/README.md +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/__init__.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/_method.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/_registry.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/api.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/client/__init__.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/client/session/__init__.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/client/session/base.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/client/session/headers.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/exceptions.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/py.typed +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/type.py +0 -0
- {wbapi_async-0.7.7 → wbapi_async-0.7.8}/src/wbapi/utils/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wbapi-async
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.8
|
|
4
4
|
Summary: Fast, lightweight async client for the Wildberries Seller API
|
|
5
5
|
Project-URL: Documentation, https://serdukow.github.io/wbapi-async/
|
|
6
6
|
Project-URL: Repository, https://github.com/serdukow/wbapi-async
|
|
@@ -19,6 +19,24 @@ class PaginationStrategy:
|
|
|
19
19
|
raise NotImplementedError
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
class RrdIdBodyCursorStrategy(PaginationStrategy):
|
|
23
|
+
def detect(self, raw: Any, page: list[Any], body: Any, page_size: int, path: str) -> bool:
|
|
24
|
+
return bool(body is not None and page and isinstance(page[-1], dict) and "rrdId" in page[-1])
|
|
25
|
+
|
|
26
|
+
async def paginate(
|
|
27
|
+
self, result: list[Any], page: list[Any], raw: Any, request: _Requester, page_size: int, body: Any
|
|
28
|
+
) -> list[Any]:
|
|
29
|
+
from .._method import _extract_list
|
|
30
|
+
|
|
31
|
+
while len(page) >= page_size:
|
|
32
|
+
rrd_id = page[-1]["rrdId"]
|
|
33
|
+
page = _extract_list(await request(extra_body={"rrdId": rrd_id})) or []
|
|
34
|
+
if not page:
|
|
35
|
+
break
|
|
36
|
+
result.extend(page)
|
|
37
|
+
return result
|
|
38
|
+
|
|
39
|
+
|
|
22
40
|
class RrdIdCursorStrategy(PaginationStrategy):
|
|
23
41
|
def detect(self, raw: Any, page: list[Any], body: Any, page_size: int, path: str) -> bool:
|
|
24
42
|
return bool(page and isinstance(page[-1], dict) and "rrd_id" in page[-1])
|
|
@@ -147,6 +165,7 @@ class CardsListStrategy(PaginationStrategy):
|
|
|
147
165
|
|
|
148
166
|
PAGINATION_STRATEGIES: list[PaginationStrategy] = [
|
|
149
167
|
CardsListStrategy(),
|
|
168
|
+
RrdIdBodyCursorStrategy(),
|
|
150
169
|
RrdIdCursorStrategy(),
|
|
151
170
|
LastChangeDateStrategy(),
|
|
152
171
|
BodyCursorStrategy(),
|
|
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
|