This repository was archived by the owner on Sep 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathgenerate.py
More file actions
37 lines (35 loc) · 1.32 KB
/
generate.py
File metadata and controls
37 lines (35 loc) · 1.32 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
##############
############
#########
#######
#####
###
##
#
import string
import random
num_recs = 50000
print "["
for i in range(0, num_recs):
print "{"
print "\"id\": "+str(random.randint(1000000,9999999))+","
print "\"guid\": "+str(random.randint(100000000,999999999999))+","
print "\"isActive\": "+str(random.choice(["true","false"]))+","
print "\"name\": \"" + ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(12))+"\","
print "\"registered\": \"" + ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))+"\","
print "\"gender\": \"" +random.choice(["male", "female"])+"\","
print "\"age\": " +str(random.randint(20,40))+","
print "\"Ai\": " + str(random.randint(0,10)) + ","
print "\"Bi\": " + str(random.randint(0,8)) + ","
print "\"Ci\": "+ str(random.randint(0,12)) + ","
print "\"Di\": "+str(random.randint(4,10)) + ","
print "\"Eb\": "+str(random.choice(["true","false"]))+","
print "\"Ff\": "+str(random.uniform(12,100))+","
print "\"Gf\": "+str(random.uniform(0,1))+","
print "\"Hf\": \""+str(random.choice(["aa","ab", "ac", "ba"]))+"\","
print "\"image\": \"data/testimages/" +str(random.randint(0,10000))+ ".jpg\""
if(i == num_recs - 1):
print "}"
print "]"
else:
print "},"