Skip to content

Realistic Value Generation

Ravi Kiran Pagidi edited this page Jun 21, 2026 · 2 revisions

Realistic Value Generation

Great Generator supports two modes:

generate_domain("banking", realism="placeholder")
generate_domain("banking", realism="realistic")

placeholder mode keeps simple deterministic values for debugging. realistic mode produces demo-ready values.

What realistic mode can generate

  • realistic names
  • emails derived from names
  • phone numbers
  • street addresses
  • cities, states, and postal codes
  • company names
  • merchant names
  • product names
  • provider and facility names
  • account types
  • transaction types
  • order statuses
  • claim statuses
  • domain-specific reference values

Name/email consistency

Great Generator keeps related descriptive fields consistent:

customer_name: Emily Carter
email: emily.carter247@example.com

It avoids mismatches such as:

customer_name: Emily Carter
email: john.smith@example.com

Schema-first realistic mode

generate_from_schema(...) is semantic-field based, not just Faker-based. It normalizes names, expands abbreviations, checks data types, and then chooses a generator.

from great_generator import generate_from_schema

schema = {
    "customer_id": "string",
    "cust_nm": "string",
    "emp_age": "int",
    "txn_amt": "double",
    "created_ts": "timestamp",
    "updated_at": "timestamp",
}

df = generate_from_schema(schema, rows=100, realism="realistic")

Examples of semantic aliases:

User field Interpreted as
cust_nm customer name
emp_name employee name
mbr_id member identifier
txn_amt transaction amount
created_ts created timestamp
dob date of birth

Clean data-quality defaults

Realistic mode now aims to produce clean data by default:

  • ages stay in realistic ranges
  • date_of_birth aligns with age when both fields exist
  • created, updated, order, payment, and transaction dates are not future dates by default
  • updated_at follows created_at
  • end_date follows start_date
  • delivery_date follows order_date when delivery exists
  • IDs are unique and are not treated like normal integers
  • totals use quantity, unit price, discount, and tax when those fields exist
  • status fields influence dates, such as no payment_date for pending payments

If users accidentally pass realism="realsitic", Great Generator treats it as realism="realistic" and emits a warning.

Validation and reports

from great_generator import validate_generated_data

result = validate_generated_data(df, schema)
print(result["passed"])
print(result["summary"])

You can also ask generation to return a validation report:

df, report = generate_from_schema(
    schema,
    rows=100,
    validate=True,
    return_report=True,
)

Explain the generation plan

from great_generator import explain_generation_plan

plan = explain_generation_plan(schema)
print(plan["semantic_coverage"])
print(plan["fields"])

The plan explains each field's semantic type, confidence, reason, and generator.

Faker usage

Faker is used internally where helpful, especially in pandas mode. Great Generator is not just a Faker wrapper: it adds domain packs, relationships, CDC, anomalies, scale profiles, pandas/Spark engines, and export behavior.

Reproducibility

data1 = generate_domain("banking", realism="realistic", seed=42)
data2 = generate_domain("banking", realism="realistic", seed=42)

assert data1["customers"].equals(data2["customers"])

Clone this wiki locally