first commit

This commit is contained in:
2026-02-23 13:22:55 +03:00
commit ae9c89c765
11 changed files with 208 additions and 0 deletions

29
handlers/s_daemon.py Normal file
View File

@@ -0,0 +1,29 @@
import os
from schema.pydantic import settings, jsonread
from handlers.handler import Handler
from pathlib import Path
files = os.listdir(settings.INPUTDIR)
for i in ("input", "output"):
path=Path(f"./{i}")
path.mkdir(exist_ok=True)
# Print the files
for file in files:
if file.startswith("~$"): #Проверка не редактируемый ли файл
continue
# Check if item is a file, not a directory
if not os.path.isdir(os.path.join(settings.INPUTDIR, file)):
match file:
case _ if "ozon" in file:
print("Это OZON")
calculate = Handler(file)
calculate.get_articles_with_sales(jsonread.merchant("ozon"), sheet_name="По товарам")
case _ if "yandex" in file:
print("Это Yandex")
calculate = Handler(file)
calculate.get_articles_with_sales(jsonread.merchant("yandex"), sheet_name="Отчёт по товарам")
case _ if "wb" in file:
print("Это WB")
case _:
print("Не распознано")