-
Notifications
You must be signed in to change notification settings - Fork 4
Quick Start with generate_from_schema
Ravi Kiran Pagidi edited this page Jun 28, 2026
·
2 revisions
pip install great-generatorfrom great_generator import generate_from_schema
schema = {
"customer_id": "string",
"customer_name": "string",
"email": "string",
"age": "int",
"balance": "double",
"created_at": "timestamp",
"account_status": "string",
}
df = generate_from_schema(schema, rows=1000)
print(df.head())from great_generator import generate_relational
data = generate_relational(
tables={
"customers": {
"schema": "customer_id int primary key, customer_name string",
"rows": 1000,
},
"orders": {
"schema": "order_id int primary key, customer_id int references customers.customer_id, order_amount double",
"rows": 5000,
},
}
)
customers_df = data["customers"]
orders_df = data["orders"]The returned dictionary keeps every table as a DataFrame while preserving declared relationships.
df = generate_from_schema(
schema,
rows=1000,
custom_rules={
"customer_id": {"prefix": "CUST"},
"age": {"min": 18, "max": 85},
"balance": {"min": 0, "max": 100000},
"account_status": {"values": ["Active", "Inactive", "Pending"]},
},
)df.to_csv("customers.csv", index=False)
df.to_parquet("customers.parquet", index=False)Next: Relationship-Aware Data Generation, then Supported Schema Input Types.