#!/usr/bin/env python3
"""
Create sample Excel files for testing.
"""
from openpyxl import Workbook
from pathlib import Path
# Create sample directory
sample_dir = Path("sample")
sample_dir.mkdir(exist_ok=True)
# Create a sample Excel file with multiple sheets
wb = Workbook()
# Sheet 1: Sales Data
ws1 = wb.active
ws1.title = "Sales"
ws1.append(["Product", "Quantity", "Price", "Total"])
ws1.append(["Product A", 10, 1000, 10000])
ws1.append(["Product B", 5, 2000, 10000])
ws1.append(["Product C", 8, 1500, 12000])
ws1.append(["Product D", 12, 800, 9600])
# Sheet 2: Employees
ws2 = wb.create_sheet("Employees")
ws2.append(["Name", "Department", "Salary", "Join Date"])
ws2.append(["Alice", "Engineering", 500000, "2020-01-15"])
ws2.append(["Bob", "Sales", 450000, "2019-03-20"])
ws2.append(["Charlie", "Engineering", 550000, "2021-06-10"])
ws2.append(["Diana", "Marketing", 480000, "2020-11-05"])
# Sheet 3: Inventory
ws3 = wb.create_sheet("Inventory")
ws3.append(["Item", "Stock", "Location", "Status"])
ws3.append(["Item 1", 50, "Warehouse A", "In Stock"])
ws3.append(["Item 2", 0, "Warehouse B", "Out of Stock"])
ws3.append(["Item 3", 25, "Warehouse A", "In Stock"])
ws3.append(["Item 4", 100, "Warehouse C", "In Stock"])
# Save the file
output_file = sample_dir / "sample.xlsx"
wb.save(output_file)
print(f"Created sample Excel file: {output_file}")
# Create another simple sample file
wb2 = Workbook()
ws = wb2.active
ws.title = "Simple Data"
ws.append(["ID", "Name", "Value"])
ws.append([1, "First", 100])
ws.append([2, "Second", 200])
ws.append([3, "Third", 300])
output_file2 = sample_dir / "simple.xlsx"
wb2.save(output_file2)
print(f"Created simple Excel file: {output_file2}")