...the only fake-data-generation library you'd need on the JVM
Kotlin-faker is a comprehensive data-generation library which provides realistic-looking, fake-data-generation capabilities within a variety of domains, like names ๐, addresses ๐ก, internet ๐, banking ๐ธ, books ๐, games ๐ฎ, and many more.
It can be used with Kotlin, Java, Android, Scala, and other JVM-based projects.
Ensure your application data looks as if it was real, just like our really fake logo, but not quite so.
We fake it.
You make it.
In fact, kotlin-faker is so good at generating fake data,
it almost fooled us into thinking it was real! ๐ฑ
From names that sound like they belong to secret agents ๐ด๏ธ
to addresses where superheroes ๐ฆธ might live.
What kind of data?
Our focus is on creating realistically-looking fake data that is most suitable for development, testing, and data anonymization purposes through data generators that provide...
Movies and TV
Tell me more...
โฆdata in 60+ locales:
โฆunique data generation capabilities:
Unique values within a domain
Unique values within a function
โฆcli app for generator functionality lookup:
faker-bot lookup name --verbose
#Faker()
#โโโ address
#โ โโโ cityName() // => Port Olinstad
#โ โโโ countryByName() // => NR
#โ โโโ streetName() // => Lance Roads
#โโโ animal
#โ โโโ name() // => gnat
#โโโ app
#โ โโโ name() // => Bamity
#โโโ artist
#โ โโโ names() // => Cezanne
#โโโ bank
#โ โโโ name() // => ABN AMRO HOARE GOVETT SECURITIES
#โโโ beer
#โ โโโ name() // => Oaked Arrogant Bastard Ale
# rest of output that matches query
โฆand more:
Random instance of any classโฆ
โฆwith pre-configured type generation
fun string() = "X3a8s813dcb"
fun uuid() = "00000000-0000-0000-0000-000000000000"
class Baz(
val id: Int,
val uuid: UUID,
val username: String
)
val baz: Baz = faker.randomClass.randomClassInstance {
// ใฝ(^o^)ไธฟ แ(แ)แ Prepend string type parameter
// values with parameter name!
typeGenerator<String> { parameterInfo ->
"${parameterInfo.name}_${string()}"
}
typeGenerator<UUID> { UUID.fromString(uuid()) }
typeGenerator<Int> {
faker.random.nextInt(min = 0, max = 9)
}
}
assertEquals(baz.username, "username_${string()}")
assertEquals( baz.uuid, UUID.fromString(uuid()))
assertTrue(baz.id in 0..9)
String templating
Random numbers, strings, enums, UUIDs, and moreโฆ
WARNING
โ ๏ธ โ ๏ธ โ ๏ธ
All names, addresses, bank accounts, and other data generated by this library - even those based on real strings - are entirely fictional. ๐ฆน
All produced data is fake and generated... poorly ๐ฉ
The data is completely made up, but the problems that it tries to solve are real ๐ฝ
We take no responsibility for any existential crises caused by the eerily convincing fake data.
Use with caution!
Why ?
While other data fakers exist, kotlin-faker is built from the ground up to be the most powerful, flexible, and developer-friendly choice for the modern JVM ecosystem.
Blazing Fast & Actively Maintained
Supported Tech-Stack