wb_purchases_handler 1.0

This commit is contained in:
2025-11-07 18:56:13 +03:00
parent 7e9218ce07
commit 3edf41b7a6
4 changed files with 34 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
from pydantic import ValidationError
from server.backend.pydantic import ExcelInfo
import re
def process_sheet(df, real_arti = '', real_quantity='', real_sum_1=''):
def process_sheet(df, real_arti = 0, real_quantity=0, real_sum_1=0):
pattern = r'[A-ZА-Я]{0,1}\d{4}[A-ZА-Я]{1,2}\d{1}' #regex
df = df[[real_arti, real_quantity, real_sum_1]].copy().dropna() #copy and drop all NA values
df = df[(df != 0).all(axis=1)] #drop all 0 values