File size: 1,808 Bytes
1fbfeb6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import pandas as pd
import random
from faker import Faker
from datetime import timedelta

fake = Faker()

# -----------------------------
# CONFIG
# -----------------------------
NUM_RECORDS = 25

medicine_names = [
    "Paracetamol", "Amoxicillin", "Azithromycin", "Atorvastatin",
    "Ibuprofen", "Metformin", "Cetirizine", "Pantoprazole",
    "Aspirin", "Cough Syrup", "Vitamin C", "Insulin"
]

categories = [
    "Analgesic", "Antibiotic", "Antihistamine",
    "Cardiac", "Diabetes", "Gastro", "Supplement"
]

suppliers = [
    "Sun Pharma", "Cipla Ltd.", "Dr. Reddy's",
    "Pfizer Inc.", "Abbott India", "Lupin Ltd."
]

# -----------------------------
# DATA GENERATION
# -----------------------------
data = []

for _ in range(NUM_RECORDS):
    medicine = random.choice(medicine_names)
    category = random.choice(categories)
    supplier = random.choice(suppliers)

    purchase_date = fake.date_between(start_date="-2y", end_date="today")
    expiry_date = purchase_date + timedelta(days=random.randint(180, 900))

    record = {
        "Medicine_Name": medicine,
        "Category": category,
        "Batch_No": f"{medicine[:3].upper()}-{random.randint(1000,9999)}",
        "Stock_Quantity": random.randint(10, 500),
        "Monthly_Sales": random.randint(5, 200),
        "Expiry_Date": expiry_date,
        "Purchase_Date": purchase_date,
        "Supplier": supplier
    }

    data.append(record)

# -----------------------------
# CREATE DATAFRAME
# -----------------------------
df = pd.DataFrame(data)

# -----------------------------
# SAVE TO CSV
# -----------------------------
df.to_csv("pharmacy_inventory_25.csv", index=False)

print("✅ 10,000 pharmacy inventory records generated successfully!")
print(df.head())