From d5b9f93fd48ff087c538f57b8c499e15aff4b4da Mon Sep 17 00:00:00 2001 From: TheNetworkGuy Date: Sat, 24 May 2025 15:12:59 +0200 Subject: [PATCH 1/2] Fixes tiny typo in the readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 018026a..3d117c5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ pip install python-picnic-api2 Then create a new instance of `PicnicAPI` and login using your credentials: ```python -from python_picnic_api import PicnicAPI +from python_picnic_api2 import PicnicAPI picnic = PicnicAPI(username='username', password='password', country_code="NL") ``` @@ -99,4 +99,4 @@ picnic.get_delivery_slots() ```python {'delivery_slots': [{'slot_id': 'XXYYZZ', 'hub_id': 'YYY', 'fc_id': 'FCX', 'window_start': '2025-04-29T17:15:00.000+02:00', 'window_end': '2025-04-29T19:15:00.000+02:00'... -``` \ No newline at end of file +``` From e63ede2bd0acef952b48d7137da7cf919ba8c53c Mon Sep 17 00:00:00 2001 From: TheNetworkGuy Date: Sat, 24 May 2025 16:45:04 +0200 Subject: [PATCH 2/2] Fallback should there be no markup for a specific product --- src/python_picnic_api2/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_picnic_api2/client.py b/src/python_picnic_api2/client.py index 8a02e72..9e37c21 100644 --- a/src/python_picnic_api2/client.py +++ b/src/python_picnic_api2/client.py @@ -114,7 +114,7 @@ def get_article(self, article_id: str, add_category_name=False): return None color_regex = re.compile(r"#\(#\d{6}\)") - producer = re.sub(color_regex, "", str(article_details[1]["markdown"])) + producer = re.sub(color_regex, "", str(article_details[1].get("markdown", ""))) article_name = re.sub(color_regex, "", str(article_details[0]["markdown"])) article = {"name": f"{producer} {article_name}", "id": article_id}