Skip to main content

Indian Fake Data Generator

Indian Fake Data Generator

CI NPM Version PyPI Version Python TypeScript License Open In Colab

A library that generates realistic fake Indian profiles, built to match Census 2011 and other public survey numbers.

Many fake-data tools mix details that don't fit together (like a Sikh named Mohammed Sharma from Mizoram). This library links the fields to each other, so the details of each profile fit together the way they do in real life.

This repository provides two native implementations:

  1. A Node.js / TypeScript package: @abhay557/indian-fakedata
  2. A Python package: indian-fakedata

All data is synthetic. Names, IDs, and numbers are randomly generated and do not correspond to any real individuals. See Acceptable Use.

Links: Docs · Tutorial · Changelog · Colab demo

Table of Contents


Installation

Current release: 2.2.1 on npm and PyPI.

Node.js / TypeScript

npm install @abhay557/indian-fakedata

Requires Node.js >= 18. The package is ESM-only: use import, not require().

Python

pip install indian-fakedata

Requires Python 3.8+.


Quick Start

Node.js / TypeScript

import { generateUser } from '@abhay557/indian-fakedata';

const user = generateUser({ seed: 7 });

Python

from indian_fakedata import generate_user

user = generate_user(seed=7)

CLI

indian-fakedata -c 1000 -f csv -o profiles.csv

Seeds: the same seed always gives the same profile, as long as you use the same version and the same language (Node or Python). The two languages use random numbers differently, so one seed gives different results in each. A new release can also change what a seed gives. In a batch, each profile uses the base seed plus its index, so a profile's seed field reproduces that profile on its own. See the Changelog.


Output Sample

One profile, seed = 7, generated by the Python implementation.

Click to expand the full JSON profile
{
  "id": "d6e2a61e-e297-4eb4-9866-5fb355fbc2ea",
  "synthetic": true,
  "generator": "indian-fakedata@2.2.1",
  "firstName": "Sarwan",
  "lastName": "Das",
  "fatherName": "Shetan Das",
  "motherName": "Girijarani Kumari",
  "spouseName": "Kishan Das",
  "gender": "female",
  "age": 40,
  "dateOfBirth": "1986-02-17",
  "bloodGroup": "B+",
  "heightCm": 144.0,
  "weightKg": 44.1,
  "bmi": 21.3,
  "appearance": {
    "heightCm": 144.0,
    "build": "average",
    "faceShape": "round",
    "skinTone": "deep_brown",
    "noseType": "button",
    "eyeColor": "dark_brown",
    "eyeShape": "almond",
    "hairColor": "black",
    "hairTexture": "wavy",
    "hairLength": "medium",
    "facialHair": null
  },
  "aadhaarNumber": "839128189565",
  "panNumber": "FMMPD7406C",
  "voterIdNumber": "YSR0818288",
  "phoneNumber": "9444448053",
  "email": "sarwan.das645@gmail.com",
  "nativeScript": {
    "script": "Telugu",
    "language": "Telugu",
    "firstName": "సర్వన",
    "lastName": "దస",
    "district": "గుంతుర",
    "addressLine": "492/గ, జయనగర, గుంతుర"
  },
  "state": "Andhra Pradesh",
  "stateCode": "AP",
  "district": "Guntur",
  "areaType": "urban",
  "addressLine": "492/G, Jayanagar, Guntur",
  "locality": "Jayanagar",
  "pinCode": "500766",
  "geo": {
    "latitude": 15.7495,
    "longitude": 80.2038
  },
  "religion": "Hindu",
  "caste": "Madiga",
  "socialCategory": "SC",
  "motherTongue": "Telugu",
  "secondLanguage": "Hindi",
  "education": "graduate",
  "occupation": "other_worker",
  "employmentTimeline": [
    {
      "jobTitle": "Receptionist",
      "sector": "private",
      "occupation": "other_worker",
      "employerType": "private",
      "startYear": 2007,
      "status": "completed",
      "monthlyWageINR": 48000,
      "location": "Guntur",
      "endYear": 2009
    },
    {
      "jobTitle": "Sales Executive",
      "sector": "private",
      "occupation": "other_worker",
      "employerType": "private",
      "startYear": 2009,
      "status": "completed",
      "monthlyWageINR": 74200,
      "location": "Guntur",
      "endYear": 2022
    },
    {
      "jobTitle": "IT Support Executive",
      "sector": "private",
      "occupation": "other_worker",
      "employerType": "private",
      "startYear": 2022,
      "status": "current",
      "monthlyWageINR": 102900,
      "location": "Guntur"
    }
  ],
  "employmentSector": "private",
  "maritalStatus": "married",
  "annualIncomeINR": 1235000,
  "monthlyExpenditureINR": 89100,
  "numberOfChildren": 1,
  "dietaryPreference": "non_vegetarian",
  "disability": "none",
  "isMigrant": true,
  "migrationOriginState": "Karnataka",
  "bankIFSC": "KKBK0682206",
  "bankName": "Kotak Mahindra Bank",
  "bankAccountNumber": "50991831492",
  "rationCardType": "APL",
  "healthInsurance": "none",
  "landOwnershipAcres": 0,
  "vehicleRegistration": "AP 28 SF 4832",
  "vehicleType": "two_wheeler",
  "hasInternetAccess": true,
  "hasSmartphone": true,
  "usesSocialMedia": false,
  "upiId": "9444448053@apl",
  "personality": {
    "openness": 59,
    "conscientiousness": 36,
    "extraversion": 64,
    "agreeableness": 49,
    "neuroticism": 57
  },
  "personalityTraits": {
    "summary": "An outgoing, people-oriented person who is open-minded, easy-going and assertive. They feel things deeply and care about those around them.",
    "strengths": [
      "creative and curious",
      "adapts to change quickly",
      "stands their ground"
    ],
    "weaknesses": [
      "worries about small things",
      "needs company to feel energised",
      "procrastinates under pressure"
    ],
    "traitLabels": [
      "open-minded",
      "easy-going",
      "outgoing",
      "assertive",
      "sensitive"
    ],
    "communicationStyle": "expressive",
    "decisionStyle": "intuitive",
    "socialBehavior": "outgoing"
  },
  "politicalLeaning": "regionalist",
  "religiosity": "somewhat_religious",
  "cognitiveProfile": {
    "aptitudeScore": 75,
    "numeracyScore": 58,
    "literacyScore": 88,
    "digitalLiteracyScore": 84,
    "financialLiteracyScore": 75
  },
  "interests": {
    "primarySport": "hockey",
    "petPreference": "cats",
    "entertainment": [
      "Bollywood",
      "TV Serials",
      "Cricket Matches",
      "Religious Programs"
    ],
    "readingHabit": "rare",
    "musicPreference": "Bollywood",
    "preferredSocialMedia": "Facebook"
  },
  "habits": {
    "tobaccoUse": "none",
    "alcoholUse": "none",
    "exerciseFrequency": "daily",
    "avgSleepHours": 6.7,
    "cooksAtHome": true,
    "chronotype": "moderate"
  },
  "educationDetails": {
    "fieldOfStudy": "Computer Science/IT",
    "institutionType": "government",
    "mediumOfInstruction": "English",
    "qualificationYear": 2008,
    "competitiveExamPercentile": null
  },
  "educationTimeline": [
    {
      "level": "primary",
      "stageName": "Primary School",
      "institutionName": "Government Primary School, Guntur",
      "institutionType": "government",
      "boardOrUniversity": "AP State Board",
      "startYear": 1991,
      "endYear": 1997,
      "status": "completed",
      "score": "52.8%"
    },
    {
      "level": "middle",
      "stageName": "Middle School",
      "institutionName": "Government Middle School, Guntur",
      "institutionType": "government",
      "boardOrUniversity": "AP State Board",
      "startYear": 1997,
      "endYear": 2000,
      "status": "completed",
      "score": "56.7%"
    },
    {
      "level": "secondary",
      "stageName": "Secondary School",
      "institutionName": "Government High School, Guntur",
      "institutionType": "government",
      "boardOrUniversity": "AP State Board",
      "startYear": 2000,
      "endYear": 2002,
      "status": "completed",
      "score": "61.0%"
    },
    {
      "level": "higher_secondary",
      "stageName": "Higher Secondary School",
      "institutionName": "Government Higher Secondary School, Guntur",
      "institutionType": "government",
      "boardOrUniversity": "AP State Board",
      "startYear": 2002,
      "endYear": 2004,
      "status": "completed",
      "stream": "PCM",
      "score": "52.8%"
    },
    {
      "level": "graduate",
      "stageName": "Bachelor's Degree",
      "institutionName": "Government Post Graduate College, Guntur",
      "institutionType": "government",
      "boardOrUniversity": "University of Andhra Pradesh",
      "startYear": 2004,
      "endYear": 2008,
      "status": "completed",
      "fieldOfStudy": "Computer Science/IT",
      "score": "56.5%"
    }
  ],
  "moviePreferences": {
    "genres": [
      "Drama",
      "Sports drama/Biopic",
      "Family drama"
    ],
    "favoriteLanguages": [
      "Telugu",
      "Hindi"
    ],
    "anime": false,
    "animePreferences": null,
    "favoriteAnimeTitles": null,
    "primaryPlatform": "television",
    "watchFrequency": "occasional"
  },
  "culturalProfile": {
    "entrepreneurialScore": 37,
    "academicOrientation": 32,
    "artisticInclination": 40,
    "militaryTradition": 8,
    "agriculturalRootedness": 15,
    "artisanTradition": 22,
    "bureaucraticOrientation": 5,
    "socialActivism": 86,
    "communityBonding": 63,
    "migrationTendency": 38,
    "careerPreference": "teaching",
    "familyStructure": "extended_family",
    "savingsOrientation": 21,
    "riskAppetite": 15
  },
  "householdSize": 1,
  "householdAssets": {
    "hasRadioTransistor": false,
    "hasTelevision": true,
    "hasComputer": true,
    "hasPhone": true,
    "hasBicycle": false,
    "hasScooter": true,
    "hasCar": false,
    "bankingService": true,
    "treatedWaterSource": true,
    "latrineFacility": true,
    "numberOfRooms": 5,
    "roofMaterial": "metal_sheet",
    "wallMaterial": "burnt_brick",
    "cookingFuel": "lpg",
    "lightingSource": "electricity",
    "drinkingWaterSource": "handpump"
  },
  "probabilityMetrics": {
    "nationalReligionFreq": 0.803301791826052,
    "stateGivenReligionProb": 0.04704225981630054,
    "casteGivenContextProb": 0.09917355371900827,
    "lastNameGivenCasteProb": 0.2857142857142857,
    "socialCategoryProb": 0.19834710743801653,
    "educationProb": 0.14598540145985403,
    "occupationProb": 0.4087193460490463,
    "jointProbability": 6.388948194089085e-05
  },
  "seed": 7,
  "skills": {
    "technical": [
      "Commercial Cooking"
    ],
    "soft": [
      "Teamwork",
      "Time Management"
    ],
    "certifications": [],
    "languages": [
      {
        "language": "Telugu",
        "speaking": "native",
        "reading": "fluent",
        "writing": "fluent"
      },
      {
        "language": "Hindi",
        "speaking": "intermediate",
        "reading": "intermediate",
        "writing": "intermediate"
      },
      {
        "language": "English",
        "speaking": "intermediate",
        "reading": "intermediate",
        "writing": "intermediate"
      }
    ]
  },
  "lifeEvents": [
    {
      "year": 1986,
      "event": "born",
      "detail": "Born in Guntur."
    },
    {
      "year": 2004,
      "event": "migrated",
      "detail": "Migrated from Karnataka to Andhra Pradesh."
    },
    {
      "year": 2007,
      "event": "job_started",
      "detail": "Started working as Receptionist."
    },
    {
      "year": 2009,
      "event": "job_changed",
      "detail": "Changed job to Sales Executive."
    },
    {
      "year": 2009,
      "event": "married",
      "detail": "Married Kishan Das."
    },
    {
      "year": 2010,
      "event": "child_born",
      "detail": "Birth of child 1."
    },
    {
      "year": 2022,
      "event": "job_changed",
      "detail": "Changed job to IT Support Executive."
    }
  ],
  "householdEconomy": {
    "monthlyBudget": {
      "food": 46324,
      "housing": 19007,
      "transport": 8691,
      "education": 6372,
      "health": 8706,
      "other": 0
    },
    "loans": [],
    "creditHistory": {
      "score": 782,
      "activeLoans": 0,
      "missedPayments12m": 0,
      "oldestAccountYears": 0
    }
  }
}

The 4 Data Layers

Layer Name Description
1 Core Demographics State, gender, religion, caste, names, languages, biological markers, address
2 Socio-Economic Outcomes CIBIL credit score, health risk, literacy, employment vulnerability (configurable bias)
3 Narrative Documents Loan applications, OPD records, Hinglish WhatsApp chats, school admissions
4 Agent Persona Prompts LLM-ready system prompts + full roleplay prompts (education timeline, personality traits, movie/anime preferences), worldview beliefs, stress responses, memory seeds

CLI Usage (Both Languages)

Both packages ship with the indian-fakedata CLI binary. The arguments are identical across both versions.

# Node.js
npx @abhay557/indian-fakedata [options]

# Python (or globally installed Node package)
indian-fakedata [options]

Run with no arguments to display the full help menu.

Core Options

Flag Alias Description Default
--count <n> -c Number of profiles to generate 100
--output <path> -o File path to save output stdout
--format <fmt> -f Output format: json, jsonl, csv json
--seed <value> -s Reproducibility seed (number or string, e.g. 011) random
--no-metrics Exclude probability metrics from output included
--family Generate a full family (head + spouse + parents + children + siblings) from one seed off
--version -v Show the installed version
--check-latest Check npm for a newer release
--help -h Show help screen

Demographic Constraints

Filter generated profiles to specific demographic slices:

Flag Values
--religion <string> Hindu, Muslim, Christian, Sikh, Buddhist, Jain
--state <string> e.g. Maharashtra, Tamil Nadu, Punjab
--motherTongue <lang> e.g. Tamil, Bengali, Hindi
--gender <gender> male, female, other
--caste <string> e.g. Brahmin, Maratha, Jat
--socialCategory <cat> SC, ST, OBC, General
--areaType <type> urban, rural
--minAge <n> Minimum age (0–100)
--maxAge <n> Maximum age (0–100)
--education <level> illiterate, primary, secondary, graduate, etc.
--occupation <sector> cultivator, other_worker, non_worker, etc.
--maritalStatus <status> never_married, married, widowed, etc.

--motherTongue must be a language present in the database. Unknown values fail with an error instead of silently falling back to Hindi.

Enrichment Layers (Progressive Depth)

Flag Description
--enrich Enable all enrichment layers (outcomes + narrative all + persona)
--outcomes [Layer 2] Add credit score, health risk, employment outcome, education attainment
--bias <0-1> Bias dial for outcome simulation. 0.0 = pure meritocracy, 1.0 = max historical discrimination. Default: 0.3
--narrative <type> [Layer 3] Generate realistic Indian text documents. Repeat for multiple types: loan_application, medical_consultation, school_enrollment, ration_card_application, hinglish_conversation, all
--persona [Layer 4] Generate LLM-ready agent persona (system prompt + full roleplay prompt, beliefs, memory seeds)

Quick Examples

# 1000 profiles as CSV
indian-fakedata -c 1000 -f csv -o profiles.csv

# 50K Tamil Nadu Hindus as JSONL
indian-fakedata -c 50000 -f jsonl -o tn_data.jsonl --state "Tamil Nadu" --religion Hindu

# All enrichment layers with moderate bias
indian-fakedata -c 100 --enrich --bias 0.3 -f jsonl -o enriched.jsonl

# SC community fairness audit
indian-fakedata -c 5000 --outcomes --bias 0.5 --socialCategory SC -f jsonl -o sc_bias.jsonl

Programmatic API

User / Family / Persona (faker-style)

Both runtimes expose ergonomic entry points built on top of generate.

Node.js / TypeScript

import { generateUser, generateUsers, generateFamily, generatePersona } from '@abhay557/indian-fakedata';

// One user, same shape as the "Output Sample" above. Seed may be a
// number (7) or string ('011'); string seeds are hashed deterministically.
const user = generateUser({ seed: 7 });

// Many users driven by a single seed
const users = generateUsers({ count: 5, seed: '011' });

// A highly educated female IT professional from Karnataka
const dev = generateUser({ highlyEducated: true, gender: 'female', constraints: { state: 'Karnataka' } });

// Full relational household from one seed: spouse, parents, children,
// siblings all share the head's state/religion/caste/surname and keep
// age-consistent relationships. Fully reproducible for the same seed.
const family = generateFamily({ seed: '011' });
family.spouse?.lastName;         // === family.head.lastName
family.children.map(c => c.age); // younger than head

// User + LLM-ready agent persona (system prompt, beliefs, memory seeds)
const { user: u, persona } = generatePersona({ seed: '011' });
persona.systemPrompt; // ready to inject into any LLM system role
persona.fullPrompt;   // complete self-contained roleplay prompt: identity,
                      // education timeline, personality traits, movie/anime
                      // preferences, habits, beliefs, behaviour rules

Python

from indian_fakedata import generate_user, generate_users, generate_family, generate_persona

user = generate_user(seed=7)
users = generate_users(count=5, seed="011")
dev = generate_user(highly_educated=True, gender="female", constraints={"state": "Karnataka"})
family = generate_family(seed="011")
out = generate_persona(seed="011")   # {"user": ..., "persona": ...}
out["persona"]["fullPrompt"]         # complete roleplay prompt (see above)

Core API

Node.js / TypeScript

import { generate, generateEnriched } from '@abhay557/indian-fakedata';

const profiles = generate({ count: 10 });
const enriched = generateEnriched({ count: 5, includeOutcomes: true });

Python

from indian_fakedata import generate, generate_enriched

profiles = generate(count=10)
enriched = generate_enriched(count=5, include_outcomes=True)

See TUTORIAL.md for comprehensive, side-by-side code snippets including data exporting, streams, and narratives.


Data Sources & Real-World Accuracy

The generator is tuned to match public survey data. The numbers inside the package are close estimates based on published reports, not the raw census tables. The original spreadsheets are in data/ for reference, but they are not included in the package when it is built.

Source Used for Confidence
Census of India 2011, D-Series and C-Series tables Religion shares, state populations, mother-tongue frequencies Medium: hand-adjusted aggregates with a 2011 baseline
National Family Health Survey (NFHS-5) Dietary preferences, BMI, blood groups, height and weight by age Medium: published aggregates, synthetic individual variation
MSME Census Occupation sectors, vocational rates, industry divisions Low to medium: coarse calibration
Public identifier formats (UIDAI, RTO, and others) Aadhaar, Voter ID, PAN, IFSC, and RTO syntax High for format only; values are synthetic
CSDS and Lokniti election studies Political leaning and religiosity biases Low: broad directional signal only

Aadhaar numbers use a true Verhoeff checksum. PAN's 10th character is self-consistent but not the official check digit.

Note: All data is synthetic mock data. Names, IDs, and numbers are randomly generated and do not correspond to any real individuals. The distributions are approximations, not a statistical model validated against every subgroup.


Contributing

Contributions are welcome. Please read CONTRIBUTING.md and the Code of Conduct first. To report a vulnerability, see SECURITY.md.

Scripts

Command Description
npm run build Compile TypeScript to dist/
npm run build:docs Rebuild the browser bundle in docs/assets/lib.js
npm run dev Run src/index.ts via tsx
npm run cli Run src/cli.ts via tsx
npm test Run vitest test suite
npm run benchmark -- 10000 Measure TypeScript stream throughput
python python/scripts/benchmark.py 10000 Measure Python stream throughput
npm run demo Run demo script
npm run lint Type-check without emitting

Benchmarks

Sample stream throughput for 5,000 profiles with seed 42 on one Windows laptop. Run the scripts above on your own machine for realistic numbers.

Runtime Profiles per second
TypeScript about 7,100
Python about 990

For large datasets, use streaming output and write each profile as it arrives instead of keeping the whole batch in memory.


For AI Agents

SKILL.md teaches AI coding agents how to correctly use this library: install commands, the full API matrix (TS/Python), CLI reference, seed semantics, output shape, verification assertions, and common mistakes.


Acceptable Use

This library generates synthetic mock data intended for software testing, development, ML/AI research, education, and simulation. By using it you agree not to use it, or data derived from it, for:

  • Creating fake identity documents, or bypassing KYC / identity / age verification systems
  • Operating fake accounts, bots, or personas that interact with real people, including social-media manipulation, astroturfing, and fake reviews
  • Disinformation, impersonation, harassment, spam, or scam content of any kind
  • Presenting generated profiles or statistics as real data about real individuals, or publishing datasets derived from this library without clearly labeling them synthetic
  • Any purpose that is illegal under applicable law

All identifiers (Aadhaar, PAN, voter ID, phone, email) are fabricated and exist in no government or commercial database. Every profile is fictional; any resemblance to a real person is coincidental. You are responsible for how you deploy the output of this library. If you are unsure whether your use case is acceptable, it probably isn't.

Every generated profile carries self-labeling fields ("synthetic": true and "generator": "indian-fakedata@...") so the data stays identifiable as fake wherever it travels.


License

MIT © Abhay Mourya (abhay557)

Metadata

Release files for indian-fakedata 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for indian-fakedata 2.2.1
File Size Uploaded Provenance Actions
indian_fakedata-2.2.1.tar.gz 238.8 kB Without provenance Details for indian_fakedata-2.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for indian-fakedata 2.2.1
File Interpreter ABI Platform Actions
indian_fakedata-2.2.1-py3-none-any.whl Python 3 none any Details for indian_fakedata-2.2.1-py3-none-any.whl

Total release size: 456.4 kB

Release files / indian_fakedata-2.2.1.tar.gz

Download URL indian_fakedata-2.2.1.tar.gz
Size 238.8 kB
Tags Source
SHA-256 checksum
How to use checksums
496f64d0ef7c6e30728a7af22ba05d5f270ba52b64da9375889030c74c6a75fd
BLAKE2b-256 checksum
How to use checksums
c42f133a4b1734b72fbae3f42e07e9b1365df4242df08fa1f9e91e33b8d5b669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / indian_fakedata-2.2.1-py3-none-any.whl

Download URL indian_fakedata-2.2.1-py3-none-any.whl
Size 217.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc010afcb548ccdbb2609223ab2ebdb41d493135d0f3e72a99091c6337f44ffc
BLAKE2b-256 checksum
How to use checksums
f29c4448c4bb71d57cab238286cbedf6c9057b006ad278b2b4a5d9f1e1f76a00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for indian-fakedata 2.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page