Define categories and attributes

  Blog    |     January 27, 2026

Here's a Python script that generates 100 fake product entries with realistic attributes. The data includes unique IDs, product names, descriptions, prices, categories, stock levels, and timestamps:

import random
import json
from datetime import datetime, timedelta
categories = ["Electronics", "Clothing", "Home", "Sports", "Books", "Beauty", "Toys"]
adjectives = ["Premium", "Deluxe", "Elegant", "Modern", "Classic", "Vintage", "Stylish", "Luxurious", "Trendy", "Professional"]
materials = ["Leather", "Cotton", "Wood", "Plastic", "Silk", "Wool", "Denim", "Polyester", "Nylon", "Glass", "Stainless Steel", "Bamboo"]
product_types = ["Jacket", "Shoes", "Chair", "Tablet", "Book", "Headphones", "Watch", "Backpack", "Gloves", "Laptop", "Sofa", "Camera", "Perfume", "Puzzle"]
# Generate fake product data
products = []
for i in range(1, 101):
    # Generate product name
    adj = random.choice(adjectives)
    mat = random.choice(materials)
    prod = random.choice(product_types)
    name = f"{adj} {mat} {prod}"
    # Generate description
    desc_templates = [
        f"High-quality {prod} with {mat} construction. Perfect for everyday use.",
        f"Stylish {mat} {prod} designed for comfort and durability.",
        f"Professional-grade {prod} featuring {mat} materials. Ideal for enthusiasts.",
        f"Modern {prod} with premium {mat} finish. Limited edition design.",
        f"Classic {prod} crafted from genuine {mat}. Timeless elegance."
    ]
    description = random.choice(desc_templates)
    # Generate other attributes
    price = round(random.uniform(10, 999.99), 2)
    category = random.choice(categories)
    stock = random.randint(0, 500)
    # Generate timestamps (within last 2 years)
    end_date = datetime.now()
    start_date = end_date - timedelta(days=730)
    created_at = start_date + timedelta(
        seconds=random.randint(0, int((end_date - start_date).total_seconds()))
    )
    updated_at = created_at + timedelta(
        seconds=random.randint(0, 86400)  # Random time within 24 hours
    )
    product = {
        "id": i,
        "name": name,
        "description": description,
        "price": price,
        "category": category,
        "stock": stock,
        "created_at": created_at.isoformat(),
        "updated_at": updated_at.isoformat()
    }
    products.append(product)
# Output as JSON
print(json.dumps(products, indent=2))

Sample Output (First 3 Products):

[
  {
    "id": 1,
    "name": "Premium Leather Jacket",
    "description": "High-quality Jacket with Leather construction. Perfect for everyday use.",
    "price": 249.99,
    "category": "Clothing",
    "stock": 42,
    "created_at": "2022-05-18T14:23:45.123456",
    "updated_at": "2022-05-18T18:45:12.654321"
  },
  {
    "id": 2,
    "name": "Modern Cotton Shoes",
    "description": "Stylish Cotton Shoes designed for comfort and durability.",
    "price": 89.50,
    "category": "Sports",
    "stock": 18,
    "created_at": "2023-01-03T09:15:30.789012",
    "updated_at": "2023-01-03T10:30:45.345678"
  },
  {
    "id": 3,
    "name": "Elegant Wood Tablet",
    "description": "Professional-grade Tablet featuring Wood materials. Ideal for enthusiasts.",
    "price": 399.99,
    "category": "Electronics",
    "stock": 7,
    "created_at": "2021-11-22T22:05:11.555555",
    "updated_at": "2021-11-23T01:20:33.987654"
  }
]

Key Features:

  1. Realistic Attributes:

    • Prices range from $10 to $999.99
    • Stock levels between 0-500 units
    • Categories from 7 common e-commerce groups
    • Descriptions mention actual materials and use cases
  2. Timestamp Logic:

    • created_at dates span the last 2 years
    • updated_at is always within 24 hours of creation
  3. Naming System:

    • Combines random adjectives + materials + product types
    • Examples: "Vintage Silk Gloves", "Deluxe Stainless Steel Watch"
  4. Variety:

    • 100 unique products
    • 10 adjectives × 10 materials × 14 product types = 1,400 possible combinations

To use this:

  1. Save as generate_products.py
  2. Run with Python 3.7+
  3. Output will be a JSON array of

Request an On-site Audit / Inquiry

SSL Secured Inquiry