Back to Faker

Generators

GENERATORS.md

3.8.022.5 KB
Original Source

Generators

This is the full list of generators available, organized by most popular use cases and by their comprehensive list.

[!TIP] If you run into any issues with a generator not being available, see A note about the Generators versions.

By Use Case

Internet

Generate email addresses, passwords, domains, etc.

Date and Time

Travel back in time or to future.

Person

Generate names, genders, bios, job titles, and more.

Number and String

Generate random numbers and strings.

Location

Generate addresses, zip codes, street names, states, and countries.

Finance

Create account details, transactions, and crypto addresses.

Image

Generate avatars with lots of customization.

Food

Generate coffee, beer, tea and other entries.

Animal

Generate breeds, names, sizes, etc.

Arts and Media

Generate entries for artistic needs, from TV Shows to Japanese media.

Movies

Generate movies titles, quotes, characters, etc.

Music

Generate genres, artists, song names, etc.

Books

Generate genres, titles, authors, etc.

TV Shows

Generate titles, characters, quotes and more from a variety of TV shows.

All generators

Want to see a comprehensive list of all generators? Expand the sections below to find all the available generators, categorized by their namespaces.

<details> <summary>Default</summary> </details> <details> <summary>Blockchain</summary> </details> <details> <summary>Books</summary> </details> <details> <summary>Fantasy</summary> </details> <details> <summary>Travel</summary> </details> <details> <summary>Creature</summary> </details> <details> <summary>Games</summary> </details> <details> <summary>Japanese Media</summary> </details> <details> <summary>Movies</summary> </details> <details> <summary>Music</summary> </details> <details> <summary>Quotes</summary> </details> <details> <summary>Sports</summary> </details> <details> <summary>TV Shows</summary> </details> <details> <summary>Locations</summary> </details>

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:

ruby
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:

ruby
# Faker::TvShows::ParksAndRec.character

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