Current section
Files
Jump to
Current section
Files
README.md
# 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) - [Troubleshooting](#troubleshooting) - [Tools](#tools) - [Templating](#templating) - [Contributing](#contributing) - [License](#license)## Why this existsThe 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.## CreditFakerer 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 FakerChange 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+## UsageSee [documentation](http://hexdocs.pm/fakerer/) and [usage examples](https://github.com/artkay/fakerer/blob/main/USAGE.md).## 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 OTPapplication 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 ```## ToolsFakerer was designed as a lightweight library, that's why it can be easily usedwith other tools.## TemplatingYou 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.## ContributingContributions 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.