The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Faker

ABSTRACT

Extensible Fake Data Generator

SYNOPSIS

  package main;

  use Faker;

  my $f = Faker->new;

DESCRIPTION

This package provides generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker makes it easy to generate fake data.

INTEGRATES

This package integrates behaviors from:

Data::Object::Role::Pluggable

Data::Object::Role::Proxyable

Data::Object::Role::Throwable

Faker::Maker

LIBRARIES

This package uses type constraints from:

Types::Standard

SCENARIOS

This package supports the following scenarios:

autoloading

  package Faker::Plugin::FileExt;

  use Data::Object::Class;
  use Data::Object::ClassHas;

  has 'faker';

  sub execute {
    'video/mpeg'
  }

  package main;

  use Faker;

  my $f = Faker->new;

  $f->_file_ext

This package supports the auto-loading of plugins, which means that anyone can create non-core plugins (fake data generators) and load and control them using Faker.

autoloading-under

  package Faker::Plugin::JaJp::PersonName;

  use Data::Object::Class;
  use Data::Object::ClassHas;

  has 'faker';

  sub execute {
    '鈴木 陽一'
  }

  package main;

  use Faker;

  my $f = Faker->new;

  $f->_person_name(under => 'ja_jp')

This package also supports auto-loading plugins under a specific sub-namespace which is typical in creating fake data plugins for locales.

METHODS

This package implements the following methods:

address_city_name

  address_city_name(Any %args) : Str

The address_city_name method returns a random fake address city name. See the Faker::Plugin::AddressCityName plugin for more information.

address_city_name example #1
  # given: synopsis

  $f->address_city_name

  # Lolastad

address_city_prefix

  address_city_prefix(Any %args) : Str

The address_city_prefix method returns a random fake address city prefix. See the Faker::Plugin::AddressCityPrefix plugin for more information.

address_city_prefix example #1
  # given: synopsis

  $f->address_city_prefix

  # South

address_city_suffix

  address_city_suffix(Any %args) : Str

The address_city_suffix method returns a random fake address city suffix. See the Faker::Plugin::AddressCitySuffix plugin for more information.

address_city_suffix example #1
  # given: synopsis

  $f->address_city_suffix

  # berg

address_country_name

  address_country_name(Any %args) : Str

The address_country_name method returns a random fake address country name. See the Faker::Plugin::AddressCountryName plugin for more information.

address_country_name example #1
  # given: synopsis

  $f->address_country_name

  # Iraq

address_latitude

  address_latitude(Any %args) : Str

The address_latitude method returns a random fake address latitude. See the Faker::Plugin::Address::Latitude plugin for more information.

address_latitude example #1
  # given: synopsis

  $f->address_latitude

  # 2338952

address_line1

  address_line1(Any %args) : Str

The address_line1 method returns a random fake address line1. See the Faker::Plugin::AddressLine1 plugin for more information.

address_line1 example #1
  # given: synopsis

  $f->address_line1

  # 4 Schaefer Parkway

address_line2

  address_line2(Any %args) : Str

The address_line2 method returns a random fake address line2. See the Faker::Plugin::AddressLine2 plugin for more information.

address_line2 example #1
  # given: synopsis

  $f->address_line2

  # Apt. 092

address_lines

  address_lines(Any %args) : Str

The address_lines method returns a random fake address lines. See the Faker::Plugin::AddressLines plugin for more information.

address_lines example #1
  # given: synopsis

  $f->address_lines

  # 3587 Thiel Avenue
  # Suite 335
  # Tobinmouth, ME 96440-0239

address_longitude

  address_longitude(Any %args) : Str

The address_longitude method returns a random fake address longitude. See the Faker::Plugin::AddressLongitude plugin for more information.

address_longitude example #1
  # given: synopsis

  $f->address_longitude

  # -28.920235

address_number

  address_number(Any %args) : Str

The address_number method returns a random fake address number. See the Faker::Plugin::AddressNumber plugin for more information.

address_number example #1
  # given: synopsis

  $f->address_number

  # 67

address_postal_code

  address_postal_code(Any %args) : Str

The address_postal_code method returns a random fake address postal code. See the Faker::Plugin::AddressPostalCode plugin for more information.

address_postal_code example #1
  # given: synopsis

  $f->address_postal_code

  # 02475

address_state_abbr

  address_state_abbr(Any %args) : Str

The address_state_abbr method returns a random fake address state abbr. See the Faker::Plugin::AddressStateAbbr plugin for more information.

address_state_abbr example #1
  # given: synopsis

  $f->address_state_abbr

  # OH

address_state_name

  address_state_name(Any %args) : Str

The address_state_name method returns a random fake address state name. See the Faker::Plugin::AddressStateName plugin for more information.

address_state_name example #1
  # given: synopsis

  $f->address_state_name

  # Georgia

address_street_name

  address_street_name(Any %args) : Str

The address_street_name method returns a random fake address street name. See the Faker::Plugin::AddressStreetName plugin for more information.

address_street_name example #1
  # given: synopsis

  $f->address_street_name

  # Reyna Avenue

address_street_suffix

  address_street_suffix(Any %args) : Str

The address_street_suffix method returns a random fake address street suffix. See the Faker::Plugin::AddressStreetSuffix plugin for more information.

address_street_suffix example #1
  # given: synopsis

  $f->address_street_suffix

  # Avenue

color_hex_code

  color_hex_code(Any %args) : Str

The color_hex_code method returns a random fake color hex code. See the Faker::Plugin::ColorHexCode plugin for more information.

color_hex_code example #1
  # given: synopsis

  $f->color_hex_code

  # #b9fe40

color_name

  color_name(Any %args) : Str

The color_name method returns a random fake color name. See the Faker::Plugin::ColorName plugin for more information.

color_name example #1
  # given: synopsis

  $f->color_name

  # LightSteelBlue

color_rgbcolors

  color_rgbcolors(Any %args) : Str

The color_rgbcolors method returns a random fake color rgbcolors. See the Faker::Plugin::ColorRgbcolors plugin for more information.

color_rgbcolors example #1
  # given: synopsis

  $f->color_rgbcolors

  # 77,186,28

color_rgbcolors_array

  color_rgbcolors_array(Any %args) : ArrayRef

The color_rgbcolors_array method returns a random fake color rgbcolors array. See the Faker::Plugin::ColorRgbcolorsArray plugin for more information.

color_rgbcolors_array example #1
  # given: synopsis

  $f->color_rgbcolors_array

  # [77,186,28]

color_rgbcolors_css

  color_rgbcolors_css(Any %args) : Str

The color_rgbcolors_css method returns a random fake color rgbcolors css. See the Faker::Plugin::ColorRgbcolorsCss plugin for more information.

color_rgbcolors_css example #1
  # given: synopsis

  $f->color_rgbcolors_css

  # rgb(115,98,44)

color_safe_hex_code

  color_safe_hex_code(Any %args) : Str

The color_safe_hex_code method returns a random fake color safe hex code. See the Faker::Plugin::ColorSafeHexCode plugin for more information.

color_safe_hex_code example #1
  # given: synopsis

  $f->color_safe_hex_code

  # #ff0078

color_safe_name

  color_safe_name(Any %args) : Str

The color_safe_name method returns a random fake color safe name. See the Faker::Plugin::ColorSafeName plugin for more information.

color_safe_name example #1
  # given: synopsis

  $f->color_safe_name

  # blue

company_buzzword_type1

  company_buzzword_type1(Any %args) : Str

The company_buzzword_type1 method returns a random fake company buzzword type1. See the Faker::Plugin::CompanyBuzzwordType1 plugin for more information.

company_buzzword_type1 example #1
  # given: synopsis

  $f->company_buzzword_type1

  # implement

company_buzzword_type2

  company_buzzword_type2(Any %args) : Str

The company_buzzword_type2 method returns a random fake company buzzword type2. See the Faker::Plugin::CompanyBuzzwordType2 plugin for more information.

company_buzzword_type2 example #1
  # given: synopsis

  $f->company_buzzword_type2

  # interactive

company_buzzword_type3

  company_buzzword_type3(Any %args) : Str

The company_buzzword_type3 method returns a random fake company buzzword type3. See the Faker::Plugin::CompanyBuzzwordType3 plugin for more information.

company_buzzword_type3 example #1
  # given: synopsis

  $f->company_buzzword_type3

  # bandwidth

company_description

  company_description(Any %args) : Str

The company_description method returns a random fake company description. See the Faker::Plugin::CompanyDescription plugin for more information.

company_description example #1
  # given: synopsis

  $f->company_description

  # Excels at impactful pre-emptive decisions

company_jargon_buzz_word

  company_jargon_buzz_word(Any %args) : Str

The company_jargon_buzz_word method returns a random fake company jargon buzz word. See the Faker::Plugin::CompanyJargonBuzzWord plugin for more information.

company_jargon_buzz_word example #1
  # given: synopsis

  $f->company_jargon_buzz_word

  # parallelism

company_jargon_edge_word

  company_jargon_edge_word(Any %args) : Str

The company_jargon_edge_word method returns a random fake company jargon edge word. See the Faker::Plugin::CompanyJargonEdgeWord plugin for more information.

company_jargon_edge_word example #1
  # given: synopsis

  $f->company_jargon_edge_word

  # Customer-focused

company_jargon_prop_word

  company_jargon_prop_word(Any %args) : Str

The company_jargon_prop_word method returns a random fake company jargon prop word. See the Faker::Plugin::CompanyJargonPropWord plugin for more information.

company_jargon_prop_word example #1
  # given: synopsis

  $f->company_jargon_prop_word

  # upward-trending

company_name

  company_name(Any %args) : Str

The company_name method returns a random fake company name. See the Faker::Plugin::CompanyName plugin for more information.

company_name example #1
  # given: synopsis

  $f->company_name

  # Boehm, Rutherford and Roberts

company_name_suffix

  company_name_suffix(Any %args) : Str

The company_name_suffix method returns a random fake company name suffix. See the Faker::Plugin::CompanyNameSuffix plugin for more information.

company_name_suffix example #1
  # given: synopsis

  $f->company_name_suffix

  # Group

company_tagline

  company_tagline(Any %args) : Str

The company_tagline method returns a random fake company tagline. See the Faker::Plugin::CompanyTagline plugin for more information.

company_tagline example #1
  # given: synopsis

  $f->company_tagline

  # cultivate end-to-end partnerships

internet_domain_name

  internet_domain_name(Any %args) : Str

The internet_domain_name method returns a random fake internet domain name. See the Faker::Plugin::InternetDomainName plugin for more information.

internet_domain_name example #1
  # given: synopsis

  $f->internet_domain_name

  # kassulke-cruickshank.biz

internet_domain_word

  internet_domain_word(Any %args) : Str

The internet_domain_word method returns a random fake internet domain word. See the Faker::Plugin::InternetDomainWord plugin for more information.

internet_domain_word example #1
  # given: synopsis

  $f->internet_domain_word

  # raynor-beier

internet_email_address

  internet_email_address(Any %args) : Str

The internet_email_address method returns a random fake internet email address. See the Faker::Plugin::InternetEmailAddress plugin for more information.

internet_email_address example #1
  # given: synopsis

  $f->internet_email_address

  # rose@maggio-pfannerstill-and-marquardt.com

internet_email_domain

  internet_email_domain(Any %args) : Str

The internet_email_domain method returns a random fake internet email domain. See the Faker::Plugin::InternetEmailDomain plugin for more information.

internet_email_domain example #1
  # given: synopsis

  $f->internet_email_domain

  # gmail.com

internet_ip_address

  internet_ip_address(Any %args) : Str

The internet_ip_address method returns a random fake internet ip address. See the Faker::Plugin::InternetIpAddress plugin for more information.

internet_ip_address example #1
  # given: synopsis

  $f->internet_ip_address

  # 193.199.217.87

internet_ip_address_v4

  internet_ip_address_v4(Any %args) : Str

The internet_ip_address_v4 method returns a random fake internet ip address v4. See the Faker::Plugin::InternetIpAddressV4 plugin for more information.

internet_ip_address_v4 example #1
  # given: synopsis

  $f->internet_ip_address_v4

  # 45.212.129.22

internet_ip_address_v6

  internet_ip_address_v6(Any %args) : Str

The internet_ip_address_v6 method returns a random fake internet ip address v6. See the Faker::Plugin::InternetIpAddressV6 plugin for more information.

internet_ip_address_v6 example #1
  # given: synopsis

  $f->internet_ip_address_v6

  # 4024:40e9:b107:681d:8ce1:bb12:3380:b476

internet_root_domain

  internet_root_domain(Any %args) : Str

The internet_root_domain method returns a random fake internet root domain. See the Faker::Plugin::InternetRootDomain plugin for more information.

internet_root_domain example #1
  # given: synopsis

  $f->internet_root_domain

  # biz

internet_url

  internet_url(Any %args) : Str

The internet_url method returns a random fake internet url. See the Faker::Plugin::InternetUrl plugin for more information.

internet_url example #1
  # given: synopsis

  $f->internet_url

  # https://krajcik-goyette.biz/

lorem_paragraph

  lorem_paragraph(Any %args) : Str

The lorem_paragraph method returns a random fake lorem paragraph. See the Faker::Plugin::LoremParagraph plugin for more information.

lorem_paragraph example #1
  # given: synopsis

  $f->lorem_paragraph

  # id tempore eum. vitae optio rerum enim nihil perspiciatis omnis et. ut
  # voluptates dicta qui culpa. a nam at nemo fugiat.

lorem_paragraphs

  lorem_paragraphs(Any %args) : Str

The lorem_paragraphs method returns a random fake lorem paragraphs. See the Faker::Plugin::LoremParagraphs plugin for more information.

lorem_paragraphs example #1
  # given: synopsis

  $f->lorem_paragraphs

  # modi minus pariatur accusamus possimus eaque id velit porro. voluptatum
  # natus saepe. non in quas est. ut quos autem occaecati quo.

  # saepe quae unde. vel hic consequuntur. quia aut ut nostrum amet. et
  # consequuntur occaecati.

lorem_sentence

  lorem_sentence(Any %args) : Str

The lorem_sentence method returns a random fake lorem sentence. See the Faker::Plugin::LoremSentence plugin for more information.

lorem_sentence example #1
  # given: synopsis

  $f->lorem_sentence

  # amet id id culpa reiciendis minima id corporis illum quas.

lorem_sentences

  lorem_sentences(Any %args) : Str

The lorem_sentences method returns a random fake lorem sentences. See the Faker::Plugin::LoremSentences plugin for more information.

lorem_sentences example #1
  # given: synopsis

  $f->lorem_sentences

  # laboriosam ipsam ipsum. animi accusantium quisquam repellendus. occaecati
  # itaque reiciendis perferendis exercitationem.

lorem_word

  lorem_word(Any %args) : Str

The lorem_word method returns a random fake lorem word. See the Faker::Plugin::LoremWord plugin for more information.

lorem_word example #1
  # given: synopsis

  $f->lorem_word

  # quos

lorem_words

  lorem_words(Any %args) : Str

The lorem_words method returns a random fake lorem words. See the Faker::Plugin::LoremWords plugin for more information.

lorem_words example #1
  # given: synopsis

  $f->lorem_words

  # autem assumenda commodi eum dolor

payment_card_expiration

  payment_card_expiration(Any %args) : Str

The payment_card_expiration method returns a random fake payment card expiration. See the Faker::Plugin::PaymentCardExpiration plugin for more information.

payment_card_expiration example #1
  # given: synopsis

  $f->payment_card_expiration

  # 01/21

payment_card_number

  payment_card_number(Any %args) : Str

The payment_card_number method returns a random fake payment card number. See the Faker::Plugin::PaymentCardNumber plugin for more information.

payment_card_number example #1
  # given: synopsis

  $f->payment_card_number

  # 544772628796996

payment_vendor

  payment_vendor(Any %args) : Str

The payment_vendor method returns a random fake payment vendor. See the Faker::Plugin::PaymentVendor plugin for more information.

payment_vendor example #1
  # given: synopsis

  $f->payment_vendor

  # Visa

person_first_name

  person_first_name(Any %args) : Str

The person_first_name method returns a random fake person first name. See the Faker::Plugin::PersonFirstName plugin for more information.

person_first_name example #1
  # given: synopsis

  $f->person_first_name

  # Sandrine

person_last_name

  person_last_name(Any %args) : Str

The person_last_name method returns a random fake person last name. See the Faker::Plugin::PersonLastName plugin for more information.

person_last_name example #1
  # given: synopsis

  $f->person_last_name

  # Langosh

person_name

  person_name(Any %args) : Str

The person_name method returns a random fake person name. See the Faker::Plugin::PersonName plugin for more information.

person_name example #1
  # given: synopsis

  $f->person_name

  # Eveline Wintheiser

person_name_prefix

  person_name_prefix(Any %args) : Str

The person_name_prefix method returns a random fake person name prefix. See the Faker::Plugin::PersonNamePrefix plugin for more information.

person_name_prefix example #1
  # given: synopsis

  $f->person_name_prefix

  # Ms.

person_name_suffix

  person_name_suffix(Any %args) : Str

The person_name_suffix method returns a random fake person name suffix. See the Faker::Plugin::PersonNameSuffix plugin for more information.

person_name_suffix example #1
  # given: synopsis

  $f->person_name_suffix

  # Sr.

person_username

  person_username(Any %args) : Str

The person_username method returns a random fake person username. See the Faker::Plugin::PersonUsername plugin for more information.

person_username example #1
  # given: synopsis

  $f->person_username

  # Cayla25

telephone_number

  telephone_number(Any %args) : Str

The telephone_number method returns a random fake telephone number. See the Faker::Plugin::TelephoneNumber plugin for more information.

telephone_number example #1
  # given: synopsis

  $f->telephone_number

  # 549-844-2061

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

ACKNOWLEDGEMENTS

Parts of this library were inspired by the following implementations:

PHP Faker

Ruby Faker

Python Faker

JS Faker

Elixir Faker

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues