Relational Data (Families)
Generate an entire household from a single seed.
# CLI
indian-fakedata --family --seed 011 -f jsonl
# Python
from indian_fakedata import generate_family
family = generate_family(seed="011")
# TypeScript
import { generateFamily } from '@abhay557/indian-fakedata';
const family = generateFamily({ seed: '011' });
Output shape
{
"head": { "...profile..." },
"spouse": { "...profile..." },
"parents": { "father": { "...profile..." }, "mother": { "...profile..." } },
"children": [ { "...profile..." } ],
"siblings": [ { "...profile..." } ]
}
spouseis present only when the head is married.parents.father/parents.motherare present when the head's age allows.childrenandsiblingsare arrays (possibly empty).
Consistency guarantees
Every member of the family is consistent with the head:
- Same surname (children also inherit the father's surname)
- Same state, district, religion, caste, social category
- Logically ordered ages — parents older than the head; children younger; siblings close in age
- Spouse has opposite gender to the head
- Same surname constraint applies when you pin
surnamein constraints
Options
| Option | Description |
|---|---|
seed | Number or string seed; default random |
constraints | Same as generate — inherited by the head, then propagated |
includeProbabilityMetrics | Include per-profile probability chains |
Seeds
Seeds can be numbers or strings. "011" is a string seed —
supported by both runtimes. Same seed, same family, within a runtime.
Programmatic example
from indian_fakedata import generate_family
family = generate_family(seed="011", constraints={"state": "Punjab"})
head = family["head"]
print(head["firstName"], head["lastName"], "|", head["state"])
for child in family["children"]:
assert child["lastName"] == head["lastName"]
assert child["age"] < head["age"]
if family["spouse"]:
assert family["spouse"]["gender"] != head["gender"]