← All writing

Generating India, one row at a time

· Indian-fakedata · 2 min read

Most fake data is not fake enough. A random name generator will happily produce a 19-year-old named something no 19-year-old in that state is named, living in a city that does not match the pin code, with a language that does not match the region. The test suite passes. The product still fails when real data arrives.

Indian-fakedata is a dependency-free library that generates Indian profile data from Census 2011 statistics. Instead of inventing plausible-looking rows, it samples from real distributions: state, age, gender, and the layers that hang off them. The result is data that looks like the country it claims to describe.

Why not just use a package?

Existing faker libraries are good at generating fields. They are less good at generating a coherent person. A profile is not a bag of independent values; it is a set of values that constrain each other. The library models those constraints so that the output holds together across multiple fields.

Keeping it dependency-free was a deliberate constraint. It installs fast, runs anywhere, and does not drag a data stack into a test suite that only needs a hundred fake users.

Built for LLM testing too

The same generator produces LLM-ready personas. When you are testing a retrieval system or an agent, you need users with consistent backgrounds, not ten random strings. Census distributions give the personas enough texture to expose bad assumptions in prompts and evaluation sets.

The library has passed 100 downloads. The next problem is maintenance: census data ages, and a generator is only as honest as the distribution behind it.

Fake data should behave like real data.

Try it at abhay557.github.io/Indian-fakedata.

↑ Back to posts