python-picnic-api2 1.2.3__tar.gz → 1.2.4__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.
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/PKG-INFO +1 -1
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/pyproject.toml +1 -1
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/src/python_picnic_api2/helper.py +8 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/uv.lock +1 -1
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.devcontainer/devcontainer.json +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.env.example +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.github/dependabot.yml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.github/release.yml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.github/workflows/ci.yaml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.github/workflows/it.yaml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.github/workflows/release.yml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/.gitignore +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/LICENSE.md +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/README.rst +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/codecov.yml +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/integration_tests/__init__.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/integration_tests/test_client.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/integration_tests/test_helper.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/integration_tests/test_session.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/src/python_picnic_api2/__init__.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/src/python_picnic_api2/client.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/src/python_picnic_api2/session.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/tests/__init__.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/tests/test_client.py +0 -0
- {python_picnic_api2-1.2.3 → python_picnic_api2-1.2.4}/tests/test_session.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-picnic-api2
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Project-URL: homepage, https://github.com/codesalatdev/python-picnic-api
|
|
5
5
|
Project-URL: repository, https://github.com/codesalatdev/python-picnic-api
|
|
6
6
|
Author-email: Mike Brink <mjh.brink@icloud.com>, CodeSalat <pypi@codesalat.dev>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import logging
|
|
2
3
|
import re
|
|
3
4
|
|
|
4
5
|
# prefix components:
|
|
@@ -8,6 +9,8 @@ branch = "│ "
|
|
|
8
9
|
tee = "├── "
|
|
9
10
|
last = "└── "
|
|
10
11
|
|
|
12
|
+
LOGGER = logging.getLogger(__name__)
|
|
13
|
+
|
|
11
14
|
IMAGE_SIZES = ["small", "medium", "regular", "large", "extra-large"]
|
|
12
15
|
IMAGE_BASE_URL = "https://storefront-prod.nl.picnicinternational.com/static/images"
|
|
13
16
|
|
|
@@ -88,6 +91,8 @@ def _extract_search_results(raw_results, max_items: int = 10):
|
|
|
88
91
|
search"""
|
|
89
92
|
search_results = []
|
|
90
93
|
|
|
94
|
+
LOGGER.debug(f"Extracting search results from {raw_results}")
|
|
95
|
+
|
|
91
96
|
def find_articles(node):
|
|
92
97
|
if len(search_results) >= max_items:
|
|
93
98
|
return
|
|
@@ -101,6 +106,7 @@ def _extract_search_results(raw_results, max_items: int = 10):
|
|
|
101
106
|
**selling_unit,
|
|
102
107
|
"sole_article_id": sole_article_id,
|
|
103
108
|
}
|
|
109
|
+
LOGGER.debug(f"Found article {result_entry}")
|
|
104
110
|
search_results.append(result_entry)
|
|
105
111
|
|
|
106
112
|
for child in node.get("children", []):
|
|
@@ -112,4 +118,6 @@ def _extract_search_results(raw_results, max_items: int = 10):
|
|
|
112
118
|
body = raw_results.get("body", {})
|
|
113
119
|
find_articles(body.get("child", {}))
|
|
114
120
|
|
|
121
|
+
LOGGER.debug(f"Found {len(search_results)}/{max_items} products after extraction")
|
|
122
|
+
|
|
115
123
|
return [{"items": search_results}]
|
|
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
|