third commit
This commit is contained in:
0
server/__init__.py
Normal file
0
server/__init__.py
Normal file
0
server/backend/__init__.py
Normal file
0
server/backend/__init__.py
Normal file
14
server/backend/excel.py
Normal file
14
server/backend/excel.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import pandas as pd
|
||||
def read_excel(dir, sheet1, sheet2):
|
||||
if sheet1 and sheet2:
|
||||
dfs = pd.read_excel(dir, sheet_name=[sheet1, sheet2])
|
||||
df1 = dfs[sheet1]
|
||||
df2 = dfs[sheet2]
|
||||
cols1 = df1[["Артикул поставщика", "Кол-во", "Вайлдберриз реализовал Товар (Пр)"]]
|
||||
print(df1.head(), df2.head(), cols1.head())
|
||||
elif sheet1:
|
||||
dfs = pd.read_excel(dir, sheet_name=[sheet1])
|
||||
df1 = dfs[sheet1]
|
||||
cols1 = df1[["Артикул поставщика", "Кол-во", "Вайлдберриз реализовал Товар (Пр)"]]
|
||||
print(cols1.head())
|
||||
|
||||
11
server/backend/pydantic.py
Normal file
11
server/backend/pydantic.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
class ExcelInfo(BaseModel):
|
||||
arti:str = Field(..., min_length=6, max_length=12, description="arti of the clothes")
|
||||
counts:int = Field(..., ge=0, description="the quantity of the clothes")
|
||||
price:int = Field(..., ge=0, description="the price of the clothes")
|
||||
class ExcelRealization(BaseModel):
|
||||
pass
|
||||
class ExcelReturning(BaseModel):
|
||||
pass
|
||||
class ExcelOut(BaseModel):
|
||||
pass
|
||||
31
server/backend/validating_files.py
Normal file
31
server/backend/validating_files.py
Normal file
@@ -0,0 +1,31 @@
|
||||
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("Неизвестный файл")
|
||||
0
server/frontend/__init__.py
Normal file
0
server/frontend/__init__.py
Normal file
Reference in New Issue
Block a user