Dummy Dataset Generation
Generate realistic dummy datasets for testing with customizable columns, constraints, and output formats (CSV, JSON, SQL, Python script). Creates executable scripts or direct data files for immediate use.
Use when: Creating test data, generating sample datasets, building realistic mock data for development, or populating test environments.
Arguments:
$PRODUCT: The product or system name
$DATASET_TYPE: Type of data (e.g., customer feedback, transactions, user profiles)
$ROWS: Number of rows to generate (default: 100)
$COLUMNS: Specific columns or fields to include
$FORMAT: Output format (CSV, JSON, SQL, Python script)
$CONSTRAINTS: Additional constraints or business rules
Step-by-Step Process
- Identify dataset type - Understand the data domain
- Define column specifications - Names, data types, and value ranges
- Determine row count - How many sample records needed
- Select output format - CSV, JSON, SQL INSERT, or Python script
- Apply realistic patterns - Ensure data looks authentic and valid
- Add business constraints - Respect business logic and relationships
- Generate or script data - Create executable output
- Validate output - Ensure data quality and completeness
Template: Python Script Output
import csv
import json
from datetime import datetime, timedelta
import random
# Configuration
ROWS = $ROWS
FILENAME = "$DATASET_TYPE.csv"
# Column definitions with realistic value generators
columns = {
"id": "auto-increment",
"name": "first_last_name",
"email": "email",
"created_at": "timestamp",
# Add more columns...
}
def generate_dataset():
"""Generate realistic dummy dataset"""
data = []
for i in range(1, ROWS + 1):
record = {
"id": f"U{i:06d}",
# Generate values based on column definitions
}
data.append(record)
return data
def save_as_csv(data, filename):
"""Save dataset as CSV"""
with open(filename, 'w', newline='') as f:
writer = csv.DictWriter(f, fieldnames=data[0].keys())
writer.writeheader()
writer.writerows(data)
if __name__ == "__main__":
dataset = generate_dataset()
save_as_csv(dataset, FILENAME)
print(f"Generated {len(dataset)} records in {FILENAME}")
Example Dataset Specification
Dataset Type: Customer Feedback
Columns:
- feedback_id (auto-increment, U001, U002...)
- customer_name (realistic names)
- email (valid email format)
- feedback_date (dates last 90 days)
- rating (1-5 stars)
- category (Bug, Feature Request, Complaint, Praise)
- text (realistic feedback)
- product (electronics, clothing, home)
Constraints:
- Ratings skewed: 40% 5-star, 30% 4-star, 20% 3-star, 10% 1-2 star
- Bug category only with ratings 1-3
- Feature requests only with ratings 3-5
- Email domains realistic (gmail, yahoo, company.com)
Output Deliverables
- Ready-to-execute Python script OR direct data file
- CSV file with proper headers and formatting
- JSON file with valid structure and types
- SQL INSERT statements for database population
- Data validation and constraint compliance
- Realistic, business-appropriate values
- Documentation of data generation logic
- Quick-start instructions for using the dataset
Output Formats
CSV: Flat tabular format, easy to import into spreadsheets and databases
JSON: Nested structure, ideal for APIs and NoSQL databases
SQL: INSERT statements, directly executable on relational databases
Python Script: Executable generator for custom or large datasets
Source: phuryn/pm-skills → pm-execution/skills/dummy-dataset/SKILL.md
1---2name: dummy-dataset3description: Generate realistic dummy datasets for testing with customizable columns, constraints, and output formats (CSV, JSON, SQL, Python script). Use when creating test data, building mock datasets, or generating sample data for development and demos.4---5
6# Dummy Dataset Generation
7
8Generate realistic dummy datasets for testing with customizable columns, constraints, and output formats (CSV, JSON, SQL, Python script). Creates executable scripts or direct data files for immediate use.
9
10**Use when:** Creating test data, generating sample datasets, building realistic mock data for development, or populating test environments.
11
12**Arguments:**
13- `$PRODUCT`: The product or system name
14- `$DATASET_TYPE`: Type of data (e.g., customer feedback, transactions, user profiles)
15- `$ROWS`: Number of rows to generate (default: 100)
16- `$COLUMNS`: Specific columns or fields to include
17- `$FORMAT`: Output format (CSV, JSON, SQL, Python script)
18- `$CONSTRAINTS`: Additional constraints or business rules
19
20## Step-by-Step Process
21
221. **Identify dataset type** - Understand the data domain
232. **Define column specifications** - Names, data types, and value ranges
243. **Determine row count** - How many sample records needed
254. **Select output format** - CSV, JSON, SQL INSERT, or Python script
265. **Apply realistic patterns** - Ensure data looks authentic and valid
276. **Add business constraints** - Respect business logic and relationships
287. **Generate or script data** - Create executable output
298. **Validate output** - Ensure data quality and completeness
30
31## Template: Python Script Output
32
33```python
34import csv
35import json
36from datetime import datetime, timedelta
37import random
38
39# Configuration
40ROWS = $ROWS
41FILENAME = "$DATASET_TYPE.csv"
42
43# Column definitions with realistic value generators
44columns = {
45 "id": "auto-increment",
46 "name": "first_last_name",
47 "email": "email",
48 "created_at": "timestamp",
49 # Add more columns...
50}
51
52def generate_dataset():
53 """Generate realistic dummy dataset"""
54 data = []
55 for i in range(1, ROWS + 1):
56 record = {
57 "id": f"U{i:06d}",
58 # Generate values based on column definitions
59 }
60 data.append(record)
61 return data
62
63def save_as_csv(data, filename):
64 """Save dataset as CSV"""
65 with open(filename, 'w', newline='') as f:
66 writer = csv.DictWriter(f, fieldnames=data[0].keys())
67 writer.writeheader()
68 writer.writerows(data)
69
70if __name__ == "__main__":
71 dataset = generate_dataset()
72 save_as_csv(dataset, FILENAME)
73 print(f"Generated {len(dataset)} records in {FILENAME}")
74```
75
76## Example Dataset Specification
77
78**Dataset Type:** Customer Feedback
79
80**Columns:**
81- feedback_id (auto-increment, U001, U002...)
82- customer_name (realistic names)
83- email (valid email format)
84- feedback_date (dates last 90 days)
85- rating (1-5 stars)
86- category (Bug, Feature Request, Complaint, Praise)
87- text (realistic feedback)
88- product (electronics, clothing, home)
89
90**Constraints:**
91- Ratings skewed: 40% 5-star, 30% 4-star, 20% 3-star, 10% 1-2 star
92- Bug category only with ratings 1-3
93- Feature requests only with ratings 3-5
94- Email domains realistic (gmail, yahoo, company.com)
95
96## Output Deliverables
97
98- Ready-to-execute Python script OR direct data file
99- CSV file with proper headers and formatting
100- JSON file with valid structure and types
101- SQL INSERT statements for database population
102- Data validation and constraint compliance
103- Realistic, business-appropriate values
104- Documentation of data generation logic
105- Quick-start instructions for using the dataset
106
107## Output Formats
108
109**CSV:** Flat tabular format, easy to import into spreadsheets and databases
110
111**JSON:** Nested structure, ideal for APIs and NoSQL databases
112
113**SQL:** INSERT statements, directly executable on relational databases
114
115**Python Script:** Executable generator for custom or large datasets
116
117---
118
119**Source:** [`phuryn/pm-skills`](https://github.com/phuryn/pm-skills) → `pm-execution/skills/dummy-dataset/SKILL.md`