Files
Excel-project/backend/validating_files.py
2025-10-27 18:54:13 +03:00

32 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from dotenv import load_dotenv #Работа с env
import os
from pathlib import Path
load_dotenv()
dir = Path(os.getenv("DIR"))
#Проход по всем файлам в директории
def validating():
for file in dir.rglob("*.xlsx"):
name = file.stem
match file:
case _ if "period_closure_income" in name.lower():
#Проверять более подробно
print("Реализация Яндекс ", name)
case _ if name == "0":
print("Реализация ВБ", name)
case _ if "отчет о реализации товара" in name.lower():
print("Реализация ОЗОН", name)
case _ if "вб" in name.lower() or "озон" in name.lower() or "яндекс" in name.lower():
print("Товары, переданные на комиссию", name)
case _ if "realizationreportcis" in name.lower():
print("Выкупы озон ", name)
case _ if "уведомление о выкупе" in name.lower():
print("Выкупы вб ", name)
case _:
print("Неизвестный файл")