diff --git a/main.py b/main.py index dba24bb..63d13f3 100644 --- a/main.py +++ b/main.py @@ -84,10 +84,18 @@ def download_and_parse(): skipped += 1 continue + # Skip products marked with * after the country (e.g. "France*") — MTZ exclusion flag + raw_desc = str(row[2] or "") + if re.search(r'\(\d+\).*\*', raw_desc): + skipped += 1 + continue + brand_raw = row[9] # col J brand = str(brand_raw) if brand_raw is not None else "" min_box_raw = row[10] # col K - description = re.sub(r'\s*\(\d+\).*$', '', str(row[2] or "")).strip() + type_raw = row[6] # col G + product_type = re.sub(r'^\d+\.', '', str(type_raw)).strip() if type_raw is not None else "" + description = re.sub(r'\s*\(\d+\).*$', '', raw_desc).strip() parsed.append( { "item_code": safe_int(row[1], 0), @@ -96,6 +104,7 @@ def download_and_parse(): "price_usd": safe_float(row[4], 0.0), "stock": safe_int(row[5], 0), "brand": brand, + "type": product_type, "min_box_qty": safe_int(min_box_raw, 1), } )