示例#1
0
def main():
    headers = [
        'archived', 'author', 'author_flair_css_class', 'author_flair_text',
        'body', 'controversiality', 'created_utc', 'distinguished', 'downs',
        'edited', 'gilded', 'id', 'link_id', 'name', 'parent_id', 'retrieved',
        'score', 'score_hidden', 'subreddit', 'subreddit_id', 'ups', 'positive'
    ]

    start_time = time.time()
    with open("test_data/test.csv", 'w', newline='',
              encoding='utf-8') as csv_file:
        writer = csv.writer(csv_file, delimiter=',')
        writer.writerow(headers)

        for i in range(0, length):
            row = [
                random.choice(bools),
                name.find_name(), '', '',
                lorem.bias_sentence(False, True),
                random.randint(-maxInt, maxInt),
                random.randint(-maxInt, maxInt), '',
                random.randint(-maxInt, maxInt),
                random.choice(bools),
                random.randint(-maxInt, maxInt),
                name.find_name() + str(random.randint(-maxInt, maxInt)),
                name.first_name() + str(random.randint(-maxInt, maxInt)),
                name.find_name(),
                name.last_name() + str(random.randint(-maxInt, maxInt)),
                random.randint(-maxInt, maxInt),
                random.randint(-maxInt, maxInt),
                random.choice(bools), '/r' + name.find_name(),
                name.find_name() + str(random.randint(-maxInt, maxInt)),
                random.randint(-maxInt, maxInt), True
            ]
            writer.writerow(row)

        for i in range(0, length):
            row = [
                random.choice(bools),
                name.find_name(), '', '',
                lorem.bias_sentence(False, False),
                random.randint(-maxInt, maxInt),
                random.randint(-maxInt, maxInt), '',
                random.randint(-maxInt, maxInt),
                random.choice(bools),
                random.randint(-maxInt, maxInt),
                name.find_name() + str(random.randint(-maxInt, maxInt)),
                name.first_name() + str(random.randint(-maxInt, maxInt)),
                name.find_name(),
                name.last_name() + str(random.randint(-maxInt, maxInt)),
                random.randint(-maxInt, maxInt),
                random.randint(-maxInt, maxInt),
                random.choice(bools), '/r' + name.find_name(),
                name.find_name() + str(random.randint(-maxInt, maxInt)),
                random.randint(-maxInt, maxInt), False
            ]
            writer.writerow(row)

    print("Took " + str(time.time() - start_time) + " seconds.")
示例#2
0
def generate_simple_patient():
    od = collections.OrderedDict()
    od['phn'] = demographics.ID()
    od['first_name'] = name.first_name()
    od['last_name'] = name.last_name()
    od['birthdate'] = demographics.birthdate()
    od['city'] = address.ca_city()
    od['postal_code'] = address.ca_postal_code(od['city'])
    od['education'] = demographics.education_code()
    return od
def generate_simple_patient():
  od = collections.OrderedDict()
  od['phn'] = demographics.ID()
  od['first_name'] = name.first_name()
  od['last_name'] = name.last_name()
  od['birthdate'] = demographics.birthdate()
  od['city'] = address.ca_city()
  od['postal_code'] = address.ca_postal_code(od['city'])
  od['education'] = demographics.education_code()
  return od
示例#4
0
def company_name(format=None):
  if format:
    r = format
  else:
    r=random.randint(0,2)
    if r==0:
      return name.last_name() + " " + company_suffix()
    if r==1:
      return name.last_name() + "-" + name.last_name()
    else:
      return name.last_name() + ", " + name.last_name() + " and " + name.last_name()
示例#5
0
def company_name(format=None):
    if format:
        r = format
    else:
        r=random.randint(0,2)
        if r==0:
            return name.last_name() + " " + company_suffix()
        if r==1:
            return name.last_name() + "-" + name.last_name()
        else:
            return name.last_name() + ", " + name.last_name() + " and " + name.last_name()
示例#6
0
def fullname():
    fn = name.find_name()
    ln = name.last_name()
    fl = fn + " " + ln
    return fl
示例#7
0
        else:
            rows = int(sys.argv[1])

    output = []

    order_id = 1
    for i in range(rows):
        birth_date = generate_birthday()
        age = datetime.datetime.now() - birth_date
        age = int(
            age.days /
            365.25)  # Not the right way to calculate age, but close enough

        attendee = {
            'firstName': name.first_name(),
            'lastName': name.last_name()
        }

        if random.randint(1, 100) < 10:  # random chance of having a legal name
            attendee['firstNameOnId'] = name.first_name()
            attendee['lastNameOnId'] = name.last_name()
            attendee['nameOnIdIsPreferredName'] = False
        else:
            attendee['firstNameOnId'] = attendee['firstName']
            attendee['lastNameOnId'] = attendee['lastName']
            attendee['nameOnIdIsPreferredName'] = True

        if random.randint(1, 100) < 60:  # Random chance of having a badge name
            attendee['fanName'] = get_badge_name()
        else:
            attendee['fanName'] = ""
示例#8
0
def fullName():
    fn = name.first_name()
    ln = name.last_name()
    fl = fn +" "+ ln
    return fl