-
Notifications
You must be signed in to change notification settings - Fork 4
Rich Dictionary Schema
Ravi Kiran Pagidi edited this page Jun 28, 2026
·
1 revision
Partially supported. Inline field metadata is planned. Equivalent business rules are supported today through a separate custom_rules mapping.
A schema where every field carries its type and generation constraints.
This shape is useful for reusable data contracts and business-rule-heavy lower environments. Until inline metadata is implemented, split types and rules.
from great_generator import generate_from_schema
schema = {
"customer_id": "string",
"customer_name": "string",
"age": "int",
"balance": "float",
"status": "string",
}
rules = {
"customer_id": {"prefix": "CUST"},
"customer_name": {"type": "full_name"},
"age": {"min": 18, "max": 85},
"balance": {"min": 0, "max": 100000},
"status": {"values": ["Active", "Inactive", "Pending"]},
}
df = generate_from_schema(schema, rows=1000, custom_rules=rules)
print(df.head())
df.to_parquet("customers.parquet", index=False)customer_id customer_name age balance status
CUST000001 Ava Johnson 34 4812.37 Active
# Planned, not runnable today
schema = {"age": {"type": "int", "min": 18, "max": 85}}Do not pass nested field metadata as the schema value today. It will be interpreted as a dtype string rather than metadata.