This repository was archived by the owner on Dec 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.py
More file actions
54 lines (50 loc) · 2.14 KB
/
Copy pathsample.py
File metadata and controls
54 lines (50 loc) · 2.14 KB
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
import json
import random
# Define base data structure
def generate_sample(id_suffix):
selected_team = random.choice(["A", "B", "C"])
school_name = f"School-{id_suffix}"
return {
"selectedTeam": selected_team,
"members": [
{
"whatsappNumber": f"07{random.randint(10000000, 99999999)}",
"name": random.choice(["Sandu Kumara", "Amila Perera", "Anuruddha Jayasena", "Madushan Silva", "Dinushi Fernando"])
} for _ in range(5)
],
"firstround": {
"Cosmology1": random.randint(0, 30),
"AstroPhysics1": random.randint(0, 30),
"Observation1": random.randint(0, 30),
"Rocketry2": random.randint(0, 30),
"GeneralAstronomy2": random.randint(0, 30),
"Rocketry1": random.randint(0, 30),
"AstroPhysics2": random.randint(0, 30),
"GeneralAstronomy1": random.randint(0, 30),
"Observation2": random.randint(0, 30),
"Cosmology2": random.randint(0, 30)
},
"formData": {
"schoolAddress": f"{random.randint(1, 999)}, Random Road, City-{random.randint(1, 50)}",
"language": random.choice(["english", "tamil", "sinhala"]),
"presidentName": random.choice(["Suresh Chandrasena", "Kumari Perera", "Ruwan Wijesekara"]),
"schoolName": school_name,
"teacherInCharge": random.choice(["Nila Menika", "Sanjaya Dissanayake", "Dinesha Kumara"]),
"presidentContactNumber": f"07{random.randint(10000000, 99999999)}",
"societyEmail": f"club-{id_suffix}@school.com",
"ticContactNumber": f"07{random.randint(10000000, 99999999)}"
},
"selectedCenter": random.choice(["anuradhapura", "kandy", "colombo", "matara"]),
"selected": None,
"final": None,
"firstCheck": True,
"finalround": None,
"id": f"{school_name}-Team {selected_team}"
}
# Generate 100 samples
data = [generate_sample(i) for i in range(1, 101)]
# Save to a JSON file
output_file = "teams.json"
with open(output_file, "w") as f:
json.dump(data, f, indent=4)
output_file