Spaces:
Sleeping
Sleeping
Delete check_dupes.py with huggingface_hub
Browse files123456789101112131415161718192021222324import json
with open(r'c:\react_projects\VortexCommerce\kaggle\extra_products_vortex.json', 'r', encoding='utf-8') as f: data = json.load(f) if isinstance(data, dict): products = data.get('products', []) else: products = data
seen_ar = set()seen_en = set()dupes = 0for p in products: ar = p.get('name_ar', '').strip() en = p.get('name_en', '').strip() if ar in seen_ar or en in seen_en: dupes += 1 else: seen_ar.add(ar) seen_en.add(en)
print(f"Total Products in JSON: {len(products)}")print(f"Duplicates found: {dupes}")print(f"Expected unique: {len(products) - dupes}")check_dupes.pyDeleted-24