# Fakerer
[](https://github.com/artkay/fakerer/actions/workflows/ci.yaml)
[](https://hex.pm/packages/fakerer)
[](https://hexdocs.pm/fakerer/)
[](https://github.com/artkay/fakerer/blob/main/LICENSE)
[](https://github.com/artkay/fakerer/issues)
[](https://hex.pm/packages/fakerer)
> More Faker than Faker.
**Fakerer** is a maintained fork of [elixirs/faker](https://github.com/elixirs/faker). It is 100% API-compatible - same `Faker.*` modules, same functions, same behavior. Migrating from Faker to Fakerer is a one-line change in your `mix.exs`.
- [Fakerer](#fakerer)
- [Why this exists](#why-this-exists)
- [Credit](#credit)
- [Migration from Faker](#migration-from-faker)
- [Quickstart](#quickstart)
- [Requirements](#requirements)
- [Usage](#usage)
- [Internationalization (i18n)](#internationalization-i18n)
- [Troubleshooting](#troubleshooting)
- [Tools](#tools)
- [Templating](#templating)
- [Contributing](#contributing)
- [License](#license)
## Why this exists
The upstream `faker` package shipped `0.18.0` in February 2024, then a `0.19.0-alpha.1` in February 2025 that has been sitting for over a year without graduating to a stable release. Open issues and PRs going back to 2023 are unaddressed.
Plenty of folks have asked, in issues and PRs, when a stable release might get released. The pre-release was a good sign, but it was never followed up - and after a year of waiting, I'd rather maintain a fork than keep refreshing the upstream tracker. No drama, no hard feelings - this is what open source forks are for.
## Credit
Fakerer stands entirely on the shoulders of the original library. Faker was created by [Igor Kapkov (@igas)](https://github.com/igas) and has been maintained for years by the [elixirs/faker](https://github.com/elixirs/faker) team and an enormous list of contributors. All of the locale data, all of the generators, all of the patterns - that's their work. The MIT license is preserved, and so is Igor's copyright.
If you use Fakerer, you are using Faker. Please go star [elixirs/faker](https://github.com/elixirs/faker).
## Migration from Faker
Change one line in your `mix.exs`:
```elixir
# Before
{:faker, "~> 0.18", only: :test}
# After
{:faker, "~> 1.0", hex: :fakerer, only: :test}
```
The dep atom stays `:faker` because the OTP application name is still `:faker` - only the **Hex package name** changes to `fakerer`. The `hex: :fakerer` option tells Mix to fetch it from Hex under the new package name while everything else (the app, the modules, the config) keeps the original `:faker` identity.
That's it. Every `Faker.*` call you already have keeps working - `Faker.Person.first_name/0`, `Faker.Address.city/0`, `Faker.Internet.email/0`, all of it. `Faker.start()` in your `test_helper.exs` is unchanged. Any `config :faker, locale: :de` (or similar) you have keeps working without modification.
Fakerer `1.0.0` includes everything from Faker `0.18.0` plus the changes from `0.19.0-alpha.1` - an upstream pre-release that shipped to Hex in February 2025 (requiring an exact-version pin to install) but never graduated to a stable release. That covers Elixir 1.17 & 1.18 compatibility, deprecation warning fixes, the Airports IATA nil fix, and more - see the [CHANGELOG](CHANGELOG.md).
## Quickstart
* add the dep to your `mix.exs`:
```elixir
defp deps do
[
{:faker, "~> 1.0", hex: :fakerer, only: :test}
]
end
```
The dep atom is `:faker` (the OTP application name), and `hex: :fakerer` tells Mix where to find the package on Hex.
* run:
```
mix deps.get
```
* add `Faker.start()` to `test/test_helper.exs`:
```elixir
ExUnit.start()
Faker.start()
```
* jump to [usage examples](#usage).
### Requirements
* OTP 26+
* Elixir 1.16+
## Usage
See [documentation](http://hexdocs.pm/fakerer/) and [usage examples](https://github.com/artkay/fakerer/blob/main/USAGE.md).
## Internationalization (i18n)
Fakerer supports multiple locales with Vietnamese (vi) as a first-class citizen. The locale system uses [Gettext](https://hexdocs.pm/Gettext.html) for translatable strings.
### Supported Locales
- `:en` - English (default)
- `:vi` - Vietnamese
- `:da` - Danish
- `:es` - Spanish
- `:fr` - French
- `:hy` - Armenian
- `:it` - Italian
- `:pt_br` - Brazilian Portuguese
- `:ru` - Russian
- `:de` - German
- `:pt_pt` - Portuguese
- `:en_us` - US English
- `:en_gb` - British English
### Setting the Locale
```elixir
# Start with a specific locale
Fakererer.start(:vi)
# Or set it at runtime
Fakererer.locale(:vi)
```
### Gettext Integration
Fakerer includes a Gettext backend for translatable strings. Translations are stored in `priv/gettext/<locale>/LC_MESSAGES/*.po`.
```elixir
# Using Gettext directly
Gettext.put_locale(Fakererer.Gettext.Backend, "vi")
Gettext.gettext(Fakererer.Gettext.Backend, "Hello world")
```
### Vietnamese Locale
The Vietnamese locale (`:vi`) provides localized data for:
- **Person**: Vietnamese names (Nguyễn Văn A, Trần Thị B, etc.)
- **Address**: Vietnamese cities, states, street names, zip codes
- **Color**: Vietnamese color names
- **Company**: Vietnamese company prefixes and buzzwords
- **Commerce**: Vietnamese product names and departments
- **Food**: Vietnamese dishes and ingredients
- **Beer**: Vietnamese beer brands
- **Vehicle**: Vehicle makes and models
- **Phone**: Vietnamese phone number formats
- **Cat**: Vietnamese cat names and breeds
- **Industry**: Vietnamese industry sectors
```elixir
Fakererer.start(:vi)
Fakererer.Person.name()
# => "Nguyễn Văn Minh"
Fakererer.Address.city()
# => "Thành phố Hà Nội"
Fakererer.Food.dish()
# => "Phở"
```
## Troubleshooting
* If you get a message like the one below when you call `Faker.Address.city/0`,
you need to add `:faker` to your application's mix file, in the `applications`
function, as above. (Yes, `:faker` - the Hex package is `:fakerer`, but the OTP
application name stays `:faker` so existing code, including `config :faker, ...`
in your application config, continues to work unchanged.)
```
** (FunctionClauseError) no function clause matching in Faker.Address.city_count/1
lib/faker/address.ex:48: Faker.Address.city_count(nil)
lib/faker/address.ex:41: Faker.Address.city/0
```
## Tools
Fakerer was designed as a lightweight library, that's why it can be easily used
with other tools.
## Templating
You can build templates for testing purposes with the
[Blacksmith](https://github.com/batate/blacksmith) project. See the Blacksmith
[readme](https://github.com/batate/blacksmith#readme) for details.
## Contributing
Contributions are welcome - see [CONTRIBUTING.md](https://github.com/artkay/fakerer/blob/main/CONTRIBUTING.md). Review cadence is roughly monthly.
## [License](https://github.com/artkay/fakerer/blob/main/LICENSE)
Released under the MIT License.
Original copyright © Igor Kapkov; fork maintenance copyright © Art Kay.