sample_data.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # sample_data.py
  2. """
  3. Sample data to test the attribute scoring system
  4. """
  5. SAMPLE_CATEGORY_RULES = [
  6. {
  7. 'category': 'Electronics',
  8. 'attribute_name': 'brand',
  9. 'is_mandatory': True,
  10. 'valid_values': ['Apple', 'Samsung', 'Sony', 'LG', 'Dell', 'HP', 'Lenovo'],
  11. 'data_type': 'string'
  12. },
  13. {
  14. 'category': 'Electronics',
  15. 'attribute_name': 'color',
  16. 'is_mandatory': True,
  17. 'valid_values': ['Black', 'White', 'Silver', 'Gray', 'Blue', 'Red', 'Gold', 'Rose Gold'],
  18. 'data_type': 'string'
  19. },
  20. {
  21. 'category': 'Electronics',
  22. 'attribute_name': 'warranty',
  23. 'is_mandatory': True,
  24. 'valid_values': ['1 Year', '2 Years', '3 Years', 'Lifetime'],
  25. 'data_type': 'string'
  26. },
  27. {
  28. 'category': 'Electronics',
  29. 'attribute_name': 'condition',
  30. 'is_mandatory': True,
  31. 'valid_values': ['New', 'Refurbished', 'Used'],
  32. 'data_type': 'string'
  33. },
  34. {
  35. 'category': 'Electronics',
  36. 'attribute_name': 'model',
  37. 'is_mandatory': False,
  38. 'valid_values': [],
  39. 'data_type': 'string'
  40. },
  41. {
  42. 'category': 'Clothing',
  43. 'attribute_name': 'brand',
  44. 'is_mandatory': True,
  45. 'valid_values': ['Nike', 'Adidas', 'Puma', 'Reebok', 'Under Armour'],
  46. 'data_type': 'string'
  47. },
  48. {
  49. 'category': 'Clothing',
  50. 'attribute_name': 'size',
  51. 'is_mandatory': True,
  52. 'valid_values': ['XS', 'S', 'M', 'L', 'XL', 'XXL'],
  53. 'data_type': 'string'
  54. },
  55. {
  56. 'category': 'Clothing',
  57. 'attribute_name': 'color',
  58. 'is_mandatory': True,
  59. 'valid_values': ['Black', 'White', 'Blue', 'Red', 'Green', 'Yellow', 'Gray'],
  60. 'data_type': 'string'
  61. },
  62. {
  63. 'category': 'Clothing',
  64. 'attribute_name': 'material',
  65. 'is_mandatory': True,
  66. 'valid_values': ['Cotton', 'Polyester', 'Wool', 'Silk', 'Nylon', 'Blend'],
  67. 'data_type': 'string'
  68. },
  69. ]
  70. SAMPLE_PRODUCTS = [
  71. {
  72. 'sku': 'ELEC-001',
  73. 'category': 'Electronics',
  74. 'title': 'Apple MacBook Pro 14-inch Space Gray',
  75. 'description': 'Latest Apple MacBook Pro with M3 chip, 14-inch display in Space Gray color.',
  76. 'attributes': {
  77. 'brand': 'Apple',
  78. 'color': 'Space Gray', # Should suggest "Gray"
  79. 'warranty': '1 Year',
  80. 'condition': 'New',
  81. 'model': 'MacBook Pro 14"'
  82. }
  83. },
  84. {
  85. 'sku': 'ELEC-002',
  86. 'category': 'Electronics',
  87. 'title': 'Samsung Galaxy S24 Ultra',
  88. 'description': 'Flagship Samsung phone with advanced camera system.',
  89. 'attributes': {
  90. 'brand': 'Samsung',
  91. 'color': 'blak', # Typo - should suggest "Black"
  92. 'warranty': 'N/A', # Placeholder - should flag
  93. 'condition': 'new', # Case mismatch - should suggest "New"
  94. # Missing 'model'
  95. }
  96. },
  97. {
  98. 'sku': 'ELEC-003',
  99. 'category': 'Electronics',
  100. 'title': 'Sony WH-1000XM5 Wireless Headphones',
  101. 'description': 'Premium noise-cancelling headphones from Sony.',
  102. 'attributes': {
  103. # Missing 'brand' - mandatory field
  104. 'color': 'Black',
  105. 'warranty': '2 Years',
  106. 'condition': 'Refurbished'
  107. }
  108. },
  109. {
  110. 'sku': 'CLTH-001',
  111. 'category': 'Clothing',
  112. 'title': 'Nike Dri-FIT Running T-Shirt Blue Medium',
  113. 'description': 'Lightweight Nike running shirt in blue color, size Medium.',
  114. 'attributes': {
  115. 'brand': 'Nike',
  116. 'size': 'M',
  117. 'color': 'Blue',
  118. 'material': 'Polyester'
  119. }
  120. },
  121. {
  122. 'sku': 'CLTH-002',
  123. 'category': 'Clothing',
  124. 'title': 'Adidas Hoodie',
  125. 'description': 'Comfortable hoodie for casual wear.',
  126. 'attributes': {
  127. 'brand': 'Adiddas', # Typo - should suggest "Adidas"
  128. 'size': 'Large', # Should suggest "L"
  129. 'color': '', # Empty - should flag
  130. # Missing 'material' - mandatory field
  131. }
  132. },
  133. ]