From f1aa44a407a0afc68b781694f1a1895d7ec6a17a Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:21:55 +0500 Subject: [PATCH 1/9] 22 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 4287ca8..926ded7 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -# \ No newline at end of file +#33 \ No newline at end of file From 493ef1efbdb4a367f48b376aa0b07c60769de46b Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:27:31 +0500 Subject: [PATCH 2/9] 1 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 926ded7..9f31cd6 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -#33 \ No newline at end of file +#33 4 \ No newline at end of file From 11c393dd81020e6f3a098f232fbe958ad19aeaad Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:27:40 +0500 Subject: [PATCH 3/9] 1 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 9f31cd6..49426aa 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -#33 4 \ No newline at end of file +#33 44 \ No newline at end of file From b9db86f456da082cf90b75f45a90a40c6929982d Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:27:46 +0500 Subject: [PATCH 4/9] 1 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 49426aa..8abc4b9 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -#33 44 \ No newline at end of file +#33 441 \ No newline at end of file From 80f5b7793a39e65e11227155b3e29c7c12cac503 Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:27:56 +0500 Subject: [PATCH 5/9] 1 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 8abc4b9..abe592f 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -#33 441 \ No newline at end of file +#33 44111 \ No newline at end of file From 8dc81a7dd5bd19d4539ff9e8a04fa4ec99d88ecb Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:28:06 +0500 Subject: [PATCH 6/9] 1 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index abe592f..a92aa9b 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -#33 44111 \ No newline at end of file +#33 441112 \ No newline at end of file From 6767e6c15289337ad86e5e34211cd0fe386510a3 Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 14 Oct 2025 23:23:18 +0500 Subject: [PATCH 7/9] holodos --- yandex/holodos.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 yandex/holodos.py diff --git a/yandex/holodos.py b/yandex/holodos.py new file mode 100644 index 0000000..2689937 --- /dev/null +++ b/yandex/holodos.py @@ -0,0 +1,45 @@ +import datetime +from decimal import Decimal + + +def add(items: dict[str: list[dict]], title: str, amount: Decimal, expiration_date: datetime = None): + if expiration_date != None: + expiration_date = datetime.datetime.strptime(expiration_date, r'%Y-%m-%d').date() + items[title] = items.get(title, []) + for index_item in range(len(items[title])): + if items[title][index_item]['expiration_date'] == expiration_date: + items[title][index_item]['amount'] += amount + break + else: + items[title] = items.get(title, []) + [{'amount': amount, 'expiration_date': expiration_date}] + if len(items[title]) == 0: + items[title] += [{'amount': amount, 'expiration_date': expiration_date}] + + +def add_by_note(items: dict, note: str): + if '-' in note.split()[-1]: + title = ' '.join(note.split()[:-2]) + amount = Decimal(note.split()[-2]) + expiration_date = note.split()[-1] + else: + title = ' '.join(note.split()[:-1]) + amount = Decimal(note.split()[-1]) + expiration_date = None + add(items, title, amount, expiration_date) + + +def find(items: dict, needle: str): + needle = needle.lower() + finder = [item for item in items.keys() if needle in item.lower()] + return finder + + +def amount(items: dict, needle: str): + keys = find(items, needle) + count = 0 + + for title, item in items.items(): + if title in keys: + count += sum([amount['amount'] for amount in item]) + + return Decimal(count) \ No newline at end of file From dcc7d393a7cc260c14f8a6726981c0573104a4c8 Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:13:55 +0500 Subject: [PATCH 8/9] test --- test.py | 2 +- .../2.py" | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 "\320\237\321\200\320\260\320\272\321\202\320\270\320\272\320\260 4/2.py" diff --git a/test.py b/test.py index a92aa9b..4287ca8 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -#33 441112 \ No newline at end of file +# \ No newline at end of file diff --git "a/\320\237\321\200\320\260\320\272\321\202\320\270\320\272\320\260 4/2.py" "b/\320\237\321\200\320\260\320\272\321\202\320\270\320\272\320\260 4/2.py" new file mode 100644 index 0000000..e69de29 From caa6f94514ac8fcd592b426920b953bc50ea0e7a Mon Sep 17 00:00:00 2001 From: fdacky <72664014+fd4cky@users.noreply.github.com> Date: Tue, 21 Oct 2025 20:14:51 +0500 Subject: [PATCH 9/9] 1 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index 4287ca8..704bbe8 100644 --- a/test.py +++ b/test.py @@ -1 +1 @@ -# \ No newline at end of file +#№№ \ No newline at end of file