FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Guides

No client data yet? Demo on Friday anyway with Python and Faker

A seeded script turns the wait for database access into 300 realistic customers and 2,000 orders that come out identical on every run.

ShareLinkedInFacebookX

In brief

  • Faker generates fake data by locale; vi_VN has a Vietnamese address provider as well as company, job and automotive providers.
  • The same seed, methods and Faker version produce the same results. That is not guaranteed across patch versions, so pin yours.
  • Fake data is only a stopgap. One FDE job description template describes work inside clients' systems and on their data, and warns of demos that run on a forgiving sandbox production does not have.
Four steps in order: pin the Faker version in requirements.txt, use the vi_VN locale, set the seed for Faker and random (highlighted in orange), use .unique so emails do not repeat. An arrow links the seed step back to the version-pinning step: a seed only gives the same output on the same Faker version.
The seed keeps Friday's demo identical to Thursday's, but only if the Faker version is pinned. Source: Faker README, Python documentation.

The contract is signed, the kickoff meeting is over, and database access is still waiting for the security team’s approval. It is your first week at the client, and the project lead on their side wants to see a working demo this Friday.

The situation is a common one: there is a document describing the schema, but not a single row of data. Waiting costs a week. A demo built on a few hand-typed rows of “Nguyen Van A”, Vietnam’s answer to John Doe, will strike the client as a toy.

There is a third way: use Python and Faker to generate a few hundred customers with Vietnamese-style names, addresses and companies, and get the same dataset on every run. All you need is Python 3, pip and a terminal.

What you will build

The end product is a script, generate_data.py, that writes two files: customers.csv and orders.csv. The hypothetical client is a retail chain that wants a dashboard of revenue by customer. The example is simplified for learning; a real client’s schema will certainly have more columns.

According to its official documentation, Faker is a Python package that generates fake data. The project’s README lists uses such as bootstrapping a database, stress testing and anonymizing production data. A demo that is waiting for real data belongs in the first group.

Step 1: install Faker and record the version

Create a separate virtualenv for the demo, then install Faker:

pip install Faker
pip show Faker

Check: pip show should print a Version: line. Copy that number into requirements.txt in the form Faker==<version you see>. Step 3 explains why; this is also the step beginners skip most often.

Step 2: make the data look local

You can pass a locale to Faker to get localized data. For a Vietnamese client, use vi_VN. The documentation page for this locale includes a provider for Vietnamese addresses, along with company, job and automotive providers.

from faker import Faker

fake = Faker("vi_VN")
print(fake.name())
print(fake.address())
print(fake.company())
print(fake.job())

Check: the names and addresses printed should be in Vietnamese, with diacritics. If you see American names, you may have forgotten to pass the locale, or be initializing another fake variable elsewhere in the code.

It sounds minor, but it decides how viewers react. A head of sales who sees familiar customer names and addresses on the dashboard will talk about the numbers. One who sees “John Smith, Springfield” will talk about how odd the demo looks.

Step 3: seed the data so Friday’s demo matches Thursday’s

You do a trial run on Thursday night, see that the top customer has an attractive revenue figure, and send the client a screenshot in advance. You run it again on Friday morning and the top customer is someone else. In a demo, that is a serious failure.

Faker has a seed() method that seeds its shared random number generator. According to the README, the same seed, the same methods and the same version of Faker produce the same results. The README also says results are not guaranteed to be consistent across patch versions, which is why step 1 has you pin the version.

import random
from faker import Faker

Faker.seed(2026)
random.seed(2026)
fake = Faker("vi_VN")

random.seed is set as well because the order amounts below come from Python’s random module. Python’s documentation says that reusing a seed value reproduces the same sequence from run to run, as long as multiple threads are not running.

Check: run the script twice and compare the output files with diff. If no lines differ, you have passed.

Step 4: keep emails and IDs unique

Random data will occasionally repeat itself. In a name column, duplicates do no harm. In a column used as a key, such as a login email or order ID, they will break joins and can crash the demo in front of the client.

The documentation for the Faker class says that calling a provider through the .unique property guarantees that returned values are unique. When you need to start generating afresh, clear that memory with fake.unique.clear().

emails = [fake.unique.email() for _ in range(300)]
fake.unique.clear()

Check: len(set(emails)) == len(emails) should return True.

Step 5: the complete script

Now put the steps together. This version is simplified: customer IDs are sequential, amounts are random integers, and there is no seasonal distribution.

import csv
import random
from faker import Faker

Faker.seed(2026)
random.seed(2026)
fake = Faker("vi_VN")

customers = []
for i in range(1, 301):
    customers.append({
        "customer_id": f"CUS{i:04d}",
        "full_name": fake.name(),
        "email": fake.unique.email(),
        "address": fake.address(),
        "company": fake.company(),
    })

with open("customers.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.DictWriter(f, fieldnames=customers[0].keys())
    w.writeheader()
    w.writerows(customers)

with open("orders.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.writer(f)
    w.writerow(["order_id", "customer_id", "amount"])
    for j in range(1, 2001):
        customer = random.choice(customers)["customer_id"]
        w.writerow([f"ORD{j:05d}", customer, random.randint(50, 5000) * 1000])

Check: open both files in the dashboard tool you plan to demo and join them on customer_id. Every order should match a customer.

One variation is useful if some of the client’s customers are foreign. Faker’s documentation allows you to pass an OrderedDict of locales with weights to mix them proportionally, such as OrderedDict([("vi_VN", 0.8), ("en_US", 0.2)]). The ratio here is only an example; use figures supplied by the client.

Three mistakes that make a fake-data demo backfire

The first is failing to pin the version. A colleague reinstalls the environment, pulls a newer patch release, and the same seed no longer produces the same data. The second is using the random module to generate tokens, passwords or anything else related to security. Python’s documentation states that the module should not be used for security purposes.

The third is harder to spot: inventing your own column names. If the client’s schema document says CUST_ID, call the column CUST_ID. Then, on the day access arrives, you only have to change the data source and can leave the pipeline and dashboard alone.

Exercise: dirty your own data

Data you generated yourself is suspiciously clean. To get into the habit of thinking about real data, insert the snippet below just before the code that writes customers.csv. This is a simplified simulation: the 5% rate is an assumption, and CUST_ID comes from the schema example above.

for customer in customers:
    customer["CUST_ID"] = customer.pop("customer_id")
    if random.random() < 0.05:
        customer["email"] = ""

Remember to change customer_id to CUST_ID in the order-generation code so the join still works. Because random is seeded, the same rows will lose their emails on every run.

Check: reopen the dashboard. If any chart breaks or miscounts when emails are empty, you have found something to handle before you meet real data.

When does fake data stop being useful?

A 2026 template for an FDE job description says the hire will work with one to three clients, inside their systems and on their data. It also names a way to fail: the demo runs on a forgiving sandbox, and production has no such sandbox.

So treat the fake dataset as something you will throw away. It shows the client the shape of the product and lets you test joins and totals.

It cannot tell you how dirty the real data is, how many nulls it contains or where access is blocked. Say plainly during the demo that the data is synthetic, then use that same meeting to ask for read access to a small sample of the real thing.

When a job description says the role works inside clients’ systems and on their data, prepare a story about how you managed before access came through. The interviewer may well ask.

On your résumé, avoid a vague “knows Faker.” Say that you built a demo on reproducible synthetic data, kept to the client’s schema, and moved to real data in however many days it took.

Clients do not give the most credit to the engineer with the prettiest fake dataset. They give it to the one who deletes that dataset soonest.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
6 sources
Read next on the roadmap · Stage 1: FoundationsFDE interviews reward decomposition more than hard LeetCodeDatabricks sets a dictionary problem in a notebook, OpenAI a multi-part build, and Palantir an hour of decomposition on a deliberately vague brief, no Dijkstra required.