To generate fake supplier information, you can use Python's faker library, which provides realistic fake data. Here's a step-by-step solution:
Step 1: Install the Faker Library
pip install faker
Step 2: Python Code to Generate Fake Supplier Info
from faker import Faker
def generate_fake_supplier():
fake = Faker()
supplier = {
"name": fake.company(),
"address": fake.address().replace('\n', ', '),
"phone": fake.phone_number(),
"email": fake.company_email(),
"registration_number": fake.bothify('####-??-####')
}
return supplier
fake_supplier = generate_fake_supplier()
import pprint
pprint.pprint(fake_supplier)
Output Example:
{'name': 'Smith, Johnson and Brown',
'address': '8929 Thompson Avenue Apt. 333, West Courtney, WV 26083',
'phone': '1-234-567-8901',
'email': '[email protected]',
'registration_number': '1234-AB-5678'}
Key Features:
- Company Name: Uses
fake.company()for realistic business names. - Address: Combines street, city, state, and ZIP code (formatted as a single line).
- Phone: Generates valid phone numbers in North American format.
- Email: Creates domain-based email addresses using the company name.
- Registration Number: Uses
bothify()to generate alphanumeric patterns (e.g.,1234-AB-5678).
Customization Options:
- Country: Add
fake = Faker('en_US')for US-specific data, or use other locales (e.g.,'en_GB'for UK). - Language: Set
Faker(seed=42)for reproducible results. - Additional Fields: Extend the dictionary with fields like
website,industry, orcontact_person.
Example with Customization:
fake = Faker('en_GB') # UK locale
supplier = {
"name": fake.company(),
"address": fake.address().replace('\n', ', '),
"phone": fake.phone_number(),
"email": fake.company_email(),
"registration_number": fake.bothify('UK-##-????-###')
}
This approach ensures fake supplier data is realistic, structured, and customizable for testing, development, or anonymization purposes.
Request an On-site Audit / Inquiry