https://github.com/blocoio/faker
A Kotlin and Android-ready port of the Faker ruby gem
https://github.com/blocoio/faker
android faker java kotlin kotlin-android kotlin-library localization testing testing-tools
Last synced: 16 days ago
JSON representation
A Kotlin and Android-ready port of the Faker ruby gem
- Host: GitHub
- URL: https://github.com/blocoio/faker
- Owner: blocoio
- License: mit
- Created: 2015-11-10T13:03:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T16:53:58.000Z (over 2 years ago)
- Last Synced: 2026-05-02T00:33:30.770Z (about 1 month ago)
- Topics: android, faker, java, kotlin, kotlin-android, kotlin-library, localization, testing, testing-tools
- Language: Kotlin
- Homepage:
- Size: 1.36 MB
- Stars: 191
- Watchers: 9
- Forks: 28
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](http://144.217.6.255/nexus/r/io.bloco/faker?server=https%3A%2F%2Fs01.oss.sonatype.org)
Generates fake data for testing or populating a development database.
Run your tests with realistic data like names, emails, dates, countries...
A Kotlin port of the [Faker ruby gem](https://github.com/stympy/faker/) that's suitable to use in Android development.
The goal is to reuse their locale data files without changes.
## Installing
```groovy
repositories {
// ...
mavenCentral()
}
dependencies {
implementation 'io.bloco:faker:${fakerVersion}'
}
```
You can use ```testImplementation``` or ```androidTestImplementation```, if you only want to use Faker for testing.
## Usage
```kotlin
val faker = Faker()
faker.name.firstName() // Returns "Aaron"
faker.company.name() // Returns "Hirthe-Ritchie"
val faker = Faker("nl")
faker.name.firstName() // Returns "Thijs"
```
For full list of available options, check the [original source](https://github.com/stympy/faker/blob/master/README.md).
We have tried to keep the operations as close as possible.
You can also check our [blog post](https://www.bloco.io/blog/faker-a-library-to-generate-fake-data-for-java-android).
### Available components
- Address
- App
- Artist
- Avatar
- Book
- Bool
- Business
- Color
- Commerce
- Company
- Date
- Food
- Internet
- Lorem
- Name
- Number
- PhoneNumber
- Placeholdit
- SlackEmoji
- Team
- Time
- University
### Warnings
- Currently, we don't support locale specific operations
like ```Address.postcode_by_state``` or ```Business.swedish_organisation_number```.
## Proguard
If you are using R8, the shrinking and obfuscation rules are included automatically.
Otherwise, you will need to add the following options:
```
-keep class org.yaml.snakeyaml.** { public protected private *; }
-keep class org.yaml.snakeyaml.** { public protected private *; }
-dontwarn org.yaml.snakeyaml.**
```
## Contact
Feedback and contributions are welcome.
Feel free to send an [email](mailto:hello@bloco.io) or submit a pull request.