faker 0.5.0

Faker is a pure Elixir library for generating fake data.

Platform: Hex

Language: Elixir

License: MIT

Repository: https://github.com/igas/faker

View on registry: https://hex.pm/packages/faker/

Documentation: http://hexdocs.pm/faker/0.5.0


Faker VersionLicenseBuild StatusIssuesDownloadsDonation

Faker is a pure Elixir library for generating fake data.

Inspired by:

Install

In your mix.exs file, add the :faker project to your dependencies (optionally include the version):

 defp deps do
 [{:faker, "~> 0.5", only: :test}]
 end

Do a mix deps.get to fetch the dependency. That's it.

If you want to use faker outside tests remove , only: :test part.

Usage

You nead to start :faker application. Cause of many usages of fake data can be (seed database, tests, etc) it's no right place to start it. For example, if you want to use it in tests, just add Faker.start to test/test_helper.exs, and use any function decribed below. For example, if you nead random name use Faker.Name.name.

Generators / Providers

  • Address
    • building_number()
    • city()
    • city_prefix()
    • city_suffix()
    • country()
    • latitude()
    • longitude()
    • postcode()
    • secondary_address()
    • state()
    • state_abbr()
    • street_address(secondary_address \\ false)
    • street_name()
    • street_suffix()
    • time_zone()
    • zip()
    • zip_code()
  • Avatar
    • image_url()
    • image_url(slug)
    • image_url(width, height)
    • image_url(slug, width, height)
  • Code
    • isbn()
    • isbn10()
    • isbn13()
    • issn()
  • Commerce
    • color()
    • department()
    • price()
    • product_name()
    • product_name_adjective()
    • product_name_material()
    • product_name_product()
  • Company
    • bs()
    • bullshit()
    • bullshit_prefix()
    • bullshit_suffix()
    • buzzword()
    • buzzword_prefix()
    • buzzword_suffix()
    • catch_phrase()
    • name()
    • suffix()
  • Internet
    • domain_name()
    • domain_suffix()
    • domain_word()
    • email()
    • free_email()
    • free_email_service()
    • image_url()
    • ip_v4_address()
    • ip_v6_address()
    • mac_address()
    • safe_email()
    • url()
    • user_name()
  • Lorem
    • characters(range \\ 15..255)
    • characters(num)
    • paragraph(range \\ 2..5)
    • paragraph(num)
    • paragraphs(range \\ 2..5)
    • paragraphs(num)
    • sentence(range \\ 4..10)
    • sentence(num, mark)
    • sentences(range \\ 2..5)
    • sentences(num)
    • word()
    • sentences(range \\ 3..6)
    • sentences(num)
  • Name
    • first_name()
    • last_name()
    • name()
    • prefix()
    • suffix()
    • title()
  • Team
    • creature()
    • name()

Thanks

Sponsored by Evil Martians

TODO

  • Add more generators
  • Check performance
  • Add documentation
  • Promote library

Troubleshooting

  • If you get a message like the one below when you call Faker.Address.city, you need to add :faker to your application's mix file, in the applications function, as above.
** (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

Faker designed as lightweight library, because of it it can be easily used with other tools.

Templating

You can build templates for testing purposes with the Blacksmith project. See the Blacksmith readme for details.

License

Released under the MIT License.

веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей

Dependencies


GitHub Repository

igas/faker igas/faker

Faker is a pure Elixir library for generating fake data.

Language: Elixir

Created: April 08, 2014 20:05

Last updated: March 15, 2015 02:02

Last pushed: March 14, 2015 03:35

Size: 604 KB

Stars: 39

Forks: 8

Watchers: 2

Open issues: 2

Top Contributors

Igor Kapkov Andrea Leopardi Low Kian Seong Jared Norman Bryan Joseph Tres Trantham Vova batate

Releases

  • 0.5.0 - January 24, 2015 13:29
  • 0.4.1 - December 27, 2014 07:44
  • 0.4.0 - September 13, 2014 08:14
  • 0.3.2 - July 13, 2014 02:57
  • 0.3.1 - July 04, 2014 07:25
  • 0.3.0 - June 12, 2014 19:04
  • 0.2.0 - April 27, 2014 19:53
  • 0.1.0 - April 23, 2014 20:51

Related Projects

blacksmith 0.1.2
Elixir fake data generation for testing and development
Hex - Elixir - Apache-2.0 - Updated 8 days ago - 28 stars
cryptex 0.0.1
An Elixir library for encrypting/decrypting, signing/verifying data.
Hex - Elixir - MIT - Published 8 months ago - 6 stars
earmark 0.1.15
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call ...
Hex - Elixir - Other - Updated 7 days ago - 64 stars
event_source_encoder 0.0.3
EventSourceEncoder is a Elixir library to encode data into EventSource compliant data.
Hex - Elixir - MIT - Updated 7 months ago - 1 stars
kalends 0.6.1
Kalends is a datetime library in pure Elixir with up-to-date timezone support using the Olson dat...
Hex - Elixir - MIT - Updated 11 days ago - 21 stars
веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей