A summary of data about the Ruby ecosystem.

https://github.com/faker-ruby/faker

A library for generating fake data such as names, addresses, and phone numbers.
https://github.com/faker-ruby/faker

Keywords

fake ruby

Keywords from Contributors

activerecord mvc activejob rubocop rubygems static-code-analysis code-formatter rack rspec crash-reporting

Last synced: about 9 hours ago
JSON representation

Repository metadata

A library for generating fake data such as names, addresses, and phone numbers.

README.md

logotype a happy-07

Faker

Tests
Gem Version
Inline docs

Faker is a port of Perl's Data::Faker library.
It's a library for generating fake data such as names, addresses, and phone numbers.

Faker helps you generate realistic test data, and populate your
database with more than a couple of records while you're doing development.

It comes in very handy for taking screenshots (taking screenshots for a personal project)
and it was the original impetus for the creation of this gem.

Quick links

In the media

Table of Contents

Notes

  • While Faker generates data at random, returned values are not guaranteed to be unique by default.
    To explicitly specify when you require unique values, see Ensuring Unique Values.
    Values also can be deterministic if you use the deterministic feature, see Deterministic Random
  • This is the main branch of Faker and may contain changes that are not yet released.
    Please refer to the README of your version for the available methods.
    The list of all versions is available here.

Getting Started

Start by including faker in your Gemfile:

gem 'faker'

Then run bundle install.

Usage

Here are some examples of how to use Faker:

require 'faker'

Faker::Name.name      #=> "Christophe Bartell"

Faker::Address.full_address #=> "5479 William Way, East Sonnyhaven, LA 63637"

Faker::Markdown.emphasis #=> "Quo qui aperiam. Amet corrupti distinctio. Sit quia *dolor.*"

Faker::TvShows::RuPaul.queen #=> "Violet Chachki"

Faker::Alphanumeric.alpha(number: 10) #=> "zlvubkrwga"

Faker::ProgrammingLanguage.name #=> "Ruby"

For a complete list of the generators, see Generators.

A note about the Generators versions

If you get a uninitialized constant Faker::[some_class] error, your version of
the gem is behind main.

To make sure that your gem is the one
documented here, change the line in your Gemfile to:

gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'

The generators have the @faker.version tag on top of their implementation.
From the tags, you can identify the version the generator was added:

# Faker::TvShows::ParksAndRec.character

# @faker.version 1.9.0
def character
  fetch('parks_and_rec.characters')
end

Ensuring unique values

To ensure Faker generates unique values, prefix your method call with unique:

Faker::Name.unique.name # This will return a unique name every time it is called

If too many unique values are requested from a generator that has a limited
number of potential values, a Faker::UniqueGenerator::RetryLimitExceeded
exception may be raised. It is possible to clear the record of unique values
that have been returned, for example between tests.

Faker::Name.unique.clear # Clears used values for Faker::Name
Faker::UniqueGenerator.clear # Clears used values for all generators

You also can give some already used values to the unique generator if you have
collisions with the generated data (i.e: using FactoryBot with random and
manually set values).

# Usage:
# Faker::<generator>.unique.exclude(method, arguments, list)

# Add 'azerty' and 'wxcvbn' to the string generator with 6 char length
Faker::Lorem.unique.exclude :string, [number: 6], %w[azerty wxcvbn]

Deterministic Random

Faker supports seeding of its pseudo-random number generator (PRNG)
to provide deterministic output of repeated method calls.

Faker::Config.random = Random.new(42)
Faker::Company.bs #=> "seize collaborative mindshare"
Faker::Company.bs #=> "engage strategic platforms"
Faker::Config.random = Random.new(42)
Faker::Company.bs #=> "seize collaborative mindshare"
Faker::Company.bs #=> "engage strategic platforms"

Faker::Config.random = nil # seeds the PRNG using default entropy sources
Faker::Config.random.seed #=> 185180369676275068918401850258677722187
Faker::Company.bs #=> "cultivate viral synergies"

Customization

You may want Faker to print information depending on your location in the world.
To assist you in this, Faker uses the I18n gem to store strings and formats to
represent the names and postal codes of the area of your choosing.

Just set the locale you want as shown below, and Faker will take care of the rest.

Faker::Config.locale = 'es'
# or
Faker::Config.locale = :es

To override Faker's locales, and set it on threaded server environments
check out the locales README.

Minitest and Faker >= 2.22

To prevent Faker (version >= 2.22) from generating duplicate values when using Minitest,
you might need to add the following to the test_helper.rb or rails_helper.rb file:

  Faker::Config.random = Random.new

See Issue #2534 for more details.

Generators

This is the full list of generators available with this gem. If you need details about any of them, make sure to consult the documentation.

NOTE: Some of the generators below aren't released yet. If you want to use them, change the line in your gemfile to:

gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'

Contributing

Note: We are not accepting proposals for new generators and locales. The Contributing guide has a few notes about this decision.

Take a look at the Contributing document for
instructions on setting up the repo on your machine, opening bug reports, understanding the codebase,
and creating a good pull request.

There is a Discord channel to discuss anything
regarding improvements or feature requests.

Thank you, contributors!

Versioning

Faker follows Semantic Versioning 2.0 as defined at https://semver.org.

License

This code is free to use under the terms of the MIT license.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 2,549
Total Committers: 1,011
Avg Commits per committer: 2.521
Development Distribution Score (DDS): 0.901

Commits in past year: 76
Committers in past year: 22
Avg Commits per committer in past year: 3.455
Development Distribution Score (DDS) in past year: 0.671

Name Email Commits
Vitor Oliveira v****o@g****m 253
Benjamin Curtis b****s@g****m 186
dependabot[bot] 4****] 131
dependabot-preview[bot] 2****] 67
Connor Shea c****a@g****m 52
Juha j****s@o****m 48
Stefanni Brasil s****l@g****m 46
danielTiringer 5****r 30
Stefanni Brasil s****l@p****e 30
Koichi ITO k****o@g****m 25
Stephen A. Wilson s****6@h****m 25
Sibi s****i@p****n 24
Thiago Araujo t****o@g****m 19
Katrina Owen k****n@g****m 17
gkunwar g****9@g****m 16
Steven Atkinson m****k@g****m 14
Simon Fish si@m****h 13
Sudeep Tarlekar s****r@g****m 13
salexzee s****b@c****m 13
Geremia Taglialatela t****a 12
Bryan Mytko b****o@g****m 11
Yuko Miura 4****n 11
danielTiringer t****l@g****m 10
Akira Matsuda r****e@d****p 10
Pascal Schumacher p****r@g****t 10
Cathy Cramer c****r@r****m 9
Tiago Farias a****m@g****m 9
Maxmiliano Franco Braga m****o@g****m 8
Nate n****a@g****m 8
Keshav Biswa k****1@g****m 7
and 981 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 7 days ago

Total issues: 78
Total pull requests: 565
Average time to close issues: 7 months
Average time to close pull requests: 20 days
Total issue authors: 67
Total pull request authors: 133
Average comments per issue: 4.88
Average comments per pull request: 0.92
Merged pull request: 312
Bot issues: 1
Bot pull requests: 247

Past year issues: 12
Past year pull requests: 152
Past year average time to close issues: 7 days
Past year average time to close pull requests: 20 days
Past year issue authors: 12
Past year pull request authors: 27
Past year average comments per issue: 1.17
Past year average comments per pull request: 0.72
Past year merged pull request: 46
Past year bot issues: 1
Past year bot pull requests: 88

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/faker-ruby/faker

Top Issue Authors

  • stefannibrasil (7)
  • thdaraujo (2)
  • PhiliGor (2)
  • ozydingo (2)
  • rocket-turtle (2)
  • alextaujenis (2)
  • schwern (1)
  • Oli0li (1)
  • calvinballing (1)
  • elangovan-selvaraj (1)
  • sjjbirch (1)
  • nsilva-ta (1)
  • dependabot[bot] (1)
  • theycallmeswift (1)
  • AngusDSR (1)

Top Pull Request Authors

  • dependabot[bot] (247)
  • stefannibrasil (42)
  • thdaraujo (21)
  • keshavbiswa (11)
  • alextaujenis (11)
  • sudeeptarlekar (10)
  • wonderer007 (6)
  • connie-feng (5)
  • jimgraham (4)
  • matthewmayer (4)
  • francktrouillez (4)
  • lexisvar (4)
  • capak07 (4)
  • garrettgregor (4)
  • likhondocs (4)

Top Issue Labels

  • 🐞 Issue: Bug (36)
  • 💡 Issue: Feature Request (13)
  • 🎒 Beginner Friendly (6)
  • 🏷️ Issue: Has Attached PR (4)
  • ⚒️ Improvement (3)
  • 💭 Discussion (3)
  • 🙏🏽 Issue: PR Welcome (2)
  • 🤔 Needs Decision (2)
  • 🙏🏽 Issue: Needs More Information (2)
  • Chores (1)
  • Deprecation (1)
  • rubyconf2023 (1)
  • 🤔 Issue: Needs to Investigate (1)
  • 🥐 Issue: Flaky Spec (1)
  • Won't Fix (1)
  • dependencies (1)

Top Pull Request Labels

  • dependencies (247)
  • ruby (56)
  • 🙏🏽 PR: Needs Further Updates (20)
  • ⏲️ PR: In Queue for Review (15)
  • ⚒️ Improvement (9)
  • 🌐 Update Locales (9)
  • 🐞 PR: Bugfix (8)
  • ⭐ PR: Feature (8)
  • 🏃🏽 PR: In Progress (7)
  • rubyconf2023 (7)
  • Stale (4)
  • 🙏🏽 PR: Needs Documentation (4)
  • 🙏🏽 PR: Needs Tests (4)
  • ⌛ PR: Needs More Information (2)
  • 🤔 Needs Decision (2)
  • Deprecation (2)
  • 💭 Discussion (1)
  • 💡 Issue: Feature Request (1)

Package metadata

gem.coop: faker

Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.

  • Homepage: https://github.com/faker-ruby/faker
  • Documentation: http://www.rubydoc.info/gems/faker/
  • Licenses: MIT
  • Latest release: 3.5.3 (published 7 days ago)
  • Last Synced: 2025-12-06T06:15:32.484Z (4 days ago)
  • Versions: 93
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 297,480,500 Total
  • Docker Downloads: 287,195,445
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.027%
    • Downloads: 0.08%
  • Maintainers (4)
rubygems.org: faker

Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.

  • Homepage: https://github.com/faker-ruby/faker
  • Documentation: http://www.rubydoc.info/gems/faker/
  • Licenses: MIT
  • Latest release: 3.5.3 (published 7 days ago)
  • Last Synced: 2025-12-06T09:31:58.204Z (4 days ago)
  • Versions: 93
  • Dependent Packages: 1,074
  • Dependent Repositories: 143,796
  • Downloads: 297,488,614 Total
  • Docker Downloads: 287,195,445
  • Rankings:
    • Dependent packages count: 0.046%
    • Downloads: 0.084%
    • Forks count: 0.098%
    • Dependent repos count: 0.105%
    • Stargazers count: 0.109%
    • Average: 0.157%
    • Docker downloads count: 0.502%
  • Maintainers (4)
proxy.golang.org: github.com/faker-ruby/faker

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/faker-ruby/faker#section-documentation
  • Licenses: mit
  • Latest release: v3.5.3+incompatible (published 7 days ago)
  • Last Synced: 2025-12-04T22:04:32.621Z (5 days ago)
  • Versions: 86
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%

Dependencies

.github/workflows/ruby.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
.github/workflows/codeql.yml actions
  • actions/checkout v4 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
Gemfile rubygems
  • benchmark >= 0
  • minitest = 5.26.1
  • pry = 0.15.2
  • rake = 13.3.1
  • rubocop = 1.81.7
  • rubocop-minitest = 0.38.2
  • rubocop-rake = 0.7.1
  • simplecov = 0.22.0
  • test-unit = 3.7.1
  • timecop = 0.9.10
  • yard = 0.9.37
faker.gemspec rubygems
  • i18n >= 1.8.11, < 2
Gemfile.lock rubygems
  • ast 2.4.3
  • benchmark 0.5.0
  • bundler 2.4.22
  • coderay 1.1.3
  • concurrent-ruby 1.3.5
  • docile 1.4.1
  • faker 3.5.3
  • i18n 1.14.7
  • json 2.16.0
  • language_server-protocol 3.17.0.5
  • lint_roller 1.1.0
  • method_source 1.1.0
  • minitest 5.26.1
  • parallel 1.27.0
  • parser 3.3.10.0
  • power_assert 3.0.1
  • prism 1.6.0
  • pry 0.15.2
  • racc 1.8.1
  • rainbow 3.1.1
  • rake 13.3.1
  • regexp_parser 2.11.3
  • rubocop 1.81.7
  • rubocop-ast 1.48.0
  • rubocop-minitest 0.38.2
  • rubocop-rake 0.7.1
  • ruby-progressbar 1.13.0
  • simplecov 0.22.0
  • simplecov-html 0.13.2
  • simplecov_json_formatter 0.1.4
  • test-unit 3.7.1
  • timecop 0.9.10
  • unicode-display_width 3.2.0
  • unicode-emoji 4.1.0
  • yard 0.9.37

Score: 37.15626769495127