Example #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.")
def generate_complex_patient():
  od = collections.OrderedDict()
  od['phn'] = demographics.ID()
  od['name'] = name.find_name()
  od['birthdate'] = '"' + demographics.birthdate(random.choice(['%Y-%m-%d', '%b %d, %Y', '%d %B %Y'])) + '"'
  od['postal_code'] = address.ca_postal_code(address.ca_city())
  od['province'] = 'Alberta'
  od['province_abbr'] = address.ca_province_abbr(od['province'])
  od['gender'] = demographics.gender()
  od['phone'] = phone_number.phone_number()
  od['education'] = '"' + demographics.education() + '"'
  return od
Example #3
0
def generate_complex_patient():
    od = collections.OrderedDict()
    od['phn'] = demographics.ID()
    od['name'] = name.find_name()
    od['birthdate'] = '"' + demographics.birthdate(
        random.choice(['%Y-%m-%d', '%b %d, %Y', '%d %B %Y'])) + '"'
    od['postal_code'] = address.ca_postal_code(address.ca_city())
    od['province'] = 'Alberta'
    od['province_abbr'] = address.ca_province_abbr(od['province'])
    od['gender'] = demographics.gender()
    od['phone'] = phone_number.phone_number()
    od['education'] = '"' + demographics.education() + '"'
    return od
Example #4
0
def create_card():
    return {
        "name":
        name.find_name(),
        "username":
        internet.user_name(),
        "email":
        internet.email(),
        "address": {
            "streetA": address.street_name(),
            "streetB": address.street_address(),
            "streetC": address.street_address(True),
            "streetD": address.secondary_address(),
            "city": address.city(),
            "ukCounty": address.uk_county(),
            "ukCountry": address.uk_country(),
            "zipcode": address.zip_code()
        },
        "phone":
        phone_number.phone_number(),
        "website":
        internet.domain_name(),
        "company": {
            "name": company.company_name(),
            "catchPhrase": company.catch_phrase(),
            "bs": company.bs()
        },
        "posts": [{
            "words": lorem.words(),
            "sentence": lorem.sentence(),
            "sentences": lorem.sentences(),
            "paragraph": lorem.paragraph()
        }, {
            "words": lorem.words(),
            "sentence": lorem.sentence(),
            "sentences": lorem.sentences(),
            "paragraph": lorem.paragraph()
        }, {
            "words": lorem.words(),
            "sentence": lorem.sentence(),
            "sentences": lorem.sentences(),
            "paragraph": lorem.paragraph()
        }]
    }
Example #5
0
def user_card():
    return {
        "name": name.find_name(),
        "username": internet.user_name(),
        "email": internet.email(),
        "address": {
            "street": address.street_name(),
            "suite": address.secondary_address(),
            "city": address.city(),
            "zipcode": address.zip_code()
        },
        "phone": phone_number.phone_number(),
        "website": internet.domain_name(),
        "company": {
            "name": company.company_name(),
            "catchPhrase": company.catch_phrase(),
            "bs": company.bs()
        }
    }
Example #6
0
def create_card():
    return {
        "name": name.find_name(),
        "username": internet.user_name(),
        "email": internet.email(),
        "address": {
            "streetA": address.street_name(),
            "streetB": address.street_address(),
            "streetC": address.street_address(True),
            "streetD": address.secondary_address(),
            "city": address.city(),
            "ukCounty": address.uk_county(),
            "ukCountry": address.uk_country(),
            "zipcode": address.zip_code()
        },
        "phone": phone_number.phone_number(),
        "website": internet.domain_name(),
        "company": {
            "name": company.company_name(),
            "catchPhrase": company.catch_phrase(),
            "bs": company.bs()
        },
        "posts": [
            {
                "words": lorem.words(),
                "sentence": lorem.sentence(),
                "sentences": lorem.sentences(),
                "paragraph": lorem.paragraph()
            },
            {
                "words": lorem.words(),
                "sentence": lorem.sentence(),
                "sentences": lorem.sentences(),
                "paragraph": lorem.paragraph()
            },
            {
                "words": lorem.words(),
                "sentence": lorem.sentence(),
                "sentences": lorem.sentences(),
                "paragraph": lorem.paragraph()
            }
        ]
    }
Example #7
0
def user_card():
    return {
        "name": name.find_name(),
        "username": internet.user_name(),
        "email": internet.email(),
        "address": {
            "street": address.street_name(),
            "suite": address.secondary_address(),
            "city": address.city(),
            "zipcode": address.zip_code()
        },
        "phone": phone_number.phone_number(),
        "website": internet.domain_name(),
        "company": {
            "name": company.company_name(),
            "catchPhrase": company.catch_phrase(),
            "bs": company.bs()
        }
    }
Example #8
0
def get_all_data(user, user_id, tracks, tag_counts):
  tag_data = dict()
  user_name = name.find_name()
  tags, top_tracks, tag_count = get_all_tags(tracks, tag_counts)
  user_data = {'name': user_name, 'id':user_id, 'tags':tags, 'top_tracks':top_tracks, 'total_tracks':len(tracks), 'total_tags':tag_count}
  return user_data
 def createOwner(ownerClass):
     return { "name": name.find_name(), "email": internet.email(), "ui": "http://lorempixel.com/200/200/business/", "type": ownerClass, "company": company.company_name() };
Example #10
0
def fullname():
    fn = name.find_name()
    ln = name.last_name()
    fl = fn + " " + ln
    return fl
Example #11
0
            attendee['nameOnIdIsPreferredName'] = True

        if random.randint(1, 100) < 60:  # Random chance of having a badge name
            attendee['fanName'] = get_badge_name()
        else:
            attendee['fanName'] = ""

        attendee['postal'] = address.zip_code()
        attendee['country'] = "United States of America"

        attendee['phone'] = phone_number.phone_number()
        attendee['email'] = internet.email()
        attendee['birthdate'] = "{0:4d}-{1:02d}-{2:02d}".format(
            birth_date.year, birth_date.month, birth_date.day)

        attendee['emergencyName'] = name.find_name()
        attendee['emergencyPhone'] = phone_number.phone_number()

        if age <= 17:
            attendee['parentName'] = attendee['emergencyName']
            attendee['parentPhone'] = attendee['emergencyPhone']
            attendee['emergencyContactSameAsParent'] = True
        else:
            attendee['parentName'] = ""
            attendee['parentPhone'] = ""
            attendee['emergencyContactSameAsParent'] = False

        if age >= 13:
            attendee['amountPaidInCents'] = str(
                random.choice([4500, 5000, 5500, 5700]))  # 13+ full price
        elif 6 >= age < 13: