BharatSim is an open-source agent-based-modelling framework for the Indian population. It can simulate populations at multiple scales, from small communities to states. BharatSim uses a synthetic population created by applying statistical methods and machine learning algorithms to survey data from multiple sources, including the Census of India, the India Human Development Survey, the National Sample Survey, and the Gridded Population of the World. This synthetic population defines individual agents with multiple attributes, among them age, gender, home and work locations, pre-existing health conditions, and socio-economic and employment status. BharatSim's domain-specific language provides a framework for the simulation of diverse models. Its computational core, coded in Scala, supports simulations of a large number of individual agents, up to 50 million. Here, we describe the design and implementation of BharatSim, using it to address three questions motivated by the COVID-19 pandemic in India: (i) When can schools be safely reopened given specified levels of hybrid immunity?, (ii) How do new variants alter disease dynamics in the background of prior infections and vaccinations? and (iii) How can the effects of varied non-pharmaceutical interventions (NPIs) be quantified for a model Indian city? Through its India-specific synthetic population, BharatSim allows disease modellers to address questions unique to this country. It should also find use in the computational social sciences, potentially providing new insights into emergent patterns in social behaviour.