示例#1
0
    def generate_dummy_data(data_tokens):
        """
        Insert dummy data based on data tokens
        I - integer id
        L - login/username
        E - email
        P - password
        T - piece of text
        :return:
        """

        token_list = data_tokens.split(',')

        samples_count = random.randint(100, 1000)
        inserted_data = []
        for i in range(samples_count):
            values = []
            for token in token_list:
                if token == 'I':
                    values.append(i)
                if token == 'L':
                    data = elizabeth.Personal().username()
                    values.append(data)
                if token == 'E':
                    data = elizabeth.Personal().email()
                    values.append(data)
                if token == 'P':
                    data = elizabeth.Personal().password()
                    values.append(data)
                if token == 'T':
                    sample_length = random.randint(1, 10)
                    data = elizabeth.Text().text(quantity=sample_length)
                    values.append(data)
            inserted_data.append(tuple(values))

        return inserted_data, token_list
示例#2
0
def personal(request):
    return elizabeth.Personal(request.param)
import elizabeth

en = elizabeth.Business('en')
per = elizabeth.Personal('en')
path1 = elizabeth.Path()

f = open("test_data.txt", 'a+', encoding='utf-8')
count = 1
quantity = int(input('How many records do you want to generate?: '))

for i in range(1, quantity + 1):

    f.write('Record #: ' + str(count) + '\n', )
    f.write('Company Name: ' + en.company() + '\n')
    f.write('Name: ' + per.full_name() + '\n')
    f.write('Social Media Profile: ' + per.social_media_profile() + '\n')
    f.write('Computer IP Address: ' + elizabeth.core.Internet.ip_v4() + '\n')
    f.write('Username: '******'\n')
    f.write('Password: '******'\n')
    f.write('Credit Card #: ' + per.credit_card_number() + '\n')
    f.write('Expiration Date: ' + per.credit_card_expiration_date() + '\n')
    f.write('CVV: ' + str(per.cvv()) + '\n')
    f.write('SSN: ' + per.identifier(mask='###-##-####') + '\n')
    f.write('Company Value: ' + en.price(100000.0, 100000000.0) + '\n\n')
    count += 1

f.close()

# This is a test