# Cheat Sheet
A quick reference for the most commonly used random data generator functions.
## [Address](`NeoFaker.Address`)
{: .col-2}
### [`building_number(range \\ 1..100, opts \\ [])`](`NeoFaker.Address.building_number/2`)
```elixir
iex> NeoFaker.Address.building_number(1..100)
"25"
iex> NeoFaker.Address.building_number(1..100, type: :integer)
25
```
### [`city(opts \\ [])`](`NeoFaker.Address.city/1`)
```elixir
iex> NeoFaker.Address.city()
"Saint Marys City"
iex> NeoFaker.Address.city(locale: :id_id)
"Palu"
```
`NeoFaker.Address.country/1` behaves the same way, generating a random country name.
### [`coordinate(opts \\ [])`](`NeoFaker.Address.coordinate/1`)
```elixir
iex> NeoFaker.Address.coordinate()
{11.5831672, 165.3662683}
iex> NeoFaker.Address.coordinate(type: :latitude)
11.5831672
iex> NeoFaker.Address.coordinate(type: :longitude)
165.3662683
iex> NeoFaker.Address.coordinate(precision: 2)
{11.58, 165.37}
```
## [App](`NeoFaker.App`)
{: .col-2}
### [`author(opts \\ [])`](`NeoFaker.App.author/1`)
```elixir
iex> NeoFaker.App.author()
"José Valim"
```
### [`description(opts \\ [])`](`NeoFaker.App.description/1`)
```elixir
iex> NeoFaker.App.description()
"Elixir library for generating fake data in tests and development."
iex> NeoFaker.App.description(locale: :id_id)
"Pustaka Elixir untuk menghasilkan data palsu dalam pengujian dan pengembangan."
```
### [`license()`](`NeoFaker.App.license/0`)
```elixir
iex> NeoFaker.App.license()
"MIT License"
```
### [`name(opts \\ [])`](`NeoFaker.App.name/1`)
```elixir
iex> NeoFaker.App.name()
"Neo Faker"
iex> NeoFaker.App.name(style: :camel_case)
"neoFaker"
iex> NeoFaker.App.name(locale: :id_id)
"Garuda Web"
```
### [`semver(opts \\ [])`](`NeoFaker.App.semver/1`)
```elixir
iex> NeoFaker.App.semver()
"1.2.3"
iex> NeoFaker.App.semver(type: :pre_release)
"1.2.3-beta.1"
iex> NeoFaker.App.semver(type: :build)
"1.2.3+20250325"
iex> NeoFaker.App.semver(type: :pre_release_build)
"1.2.3-rc.1+20250325"
```
### [`version()`](`NeoFaker.App.version/0`)
```elixir
iex> NeoFaker.App.version()
"1.2"
```
## [Blood](`NeoFaker.Blood`)
{: .col-2}
### [`group()`](`NeoFaker.Blood.group/0`)
```elixir
iex> NeoFaker.Blood.group()
"B+"
```
### [`type()`](`NeoFaker.Blood.type/0`)
```elixir
iex> NeoFaker.Blood.type()
"B"
```
## [Boolean](`NeoFaker.Boolean`)
{: .col-1}
### [`boolean(true_ratio \\ 50, opts \\ [])`](`NeoFaker.Boolean.boolean/2`)
```elixir
iex> NeoFaker.Boolean.boolean()
false
iex> NeoFaker.Boolean.boolean(75)
true
iex> NeoFaker.Boolean.boolean(75, integer: true)
1
```
## [Color](`NeoFaker.Color`)
{: .col-2}
### [`cmyk(opts \\ [])`](`NeoFaker.Color.cmyk/1`)
```elixir
iex> NeoFaker.Color.cmyk()
{0, 25, 50, 100}
iex> NeoFaker.Color.cmyk(format: :w3c)
"cmyk(0%, 25%, 50%, 100%)"
```
`NeoFaker.Color.hsl/1`, `NeoFaker.Color.hsla/1`, `NeoFaker.Color.rgb/1` and
`NeoFaker.Color.rgba/1` behave the same way, generating colors in HSL, HSLA, RGB, and RGBA formats
respectively.
### [`hex(opts \\ [])`](`NeoFaker.Color.hex/1`)
```elixir
iex> NeoFaker.Color.hex()
"#613583"
iex> NeoFaker.Color.hex(format: :three_digit)
"#365"
```
### [`keyword(opts \\ [])`](`NeoFaker.Color.keyword/1`)
```elixir
iex> NeoFaker.Color.keyword()
"blueviolet"
iex> NeoFaker.Color.keyword(category: :basic)
"purple"
iex> NeoFaker.Color.keyword(locale: :id_id)
"ungu"
```
## [Crypto](`NeoFaker.Crypto`)
{: .col-1}
### [`md5(opts \\ [])`](`NeoFaker.Crypto.md5/1`)
```elixir
iex> NeoFaker.Crypto.md5()
"afc4c626c55e4166421d82732163857d"
iex> NeoFaker.Crypto.md5(case: :upper)
"AFC4C626C55E4166421D82732163857D"
```
`NeoFaker.Crypto.sha1/1` and `NeoFaker.Crypto.sha256/1` behave the same way, generating
SHA-1 and SHA-256 hashes respectively.
## [Date](`NeoFaker.Date`)
{: .col-2}
### [`add(range \\ -365..365, opts \\ [])`](`NeoFaker.Date.add/2`)
```elixir
iex> NeoFaker.Date.add()
~D[2025-03-25]
iex> NeoFaker.Date.add(0..31)
~D[2025-03-30]
iex> NeoFaker.Date.add(0..31, format: :iso8601)
"2025-03-25"
```
### [`between(start \\ ~D[1970-01-01], finish \\ NaiveDateTime.to_date(NaiveDateTime.local_now()), opts \\ [])`](`NeoFaker.Date.between/3`)
```elixir
iex> NeoFaker.Date.between()
~D[2025-03-25]
iex> NeoFaker.Date.between(~D[2020-01-01], ~D[2025-01-01])
~D[2022-08-17]
iex> NeoFaker.Date.between(~D[2025-03-25], ~D[2025-03-25], format: :iso8601)
"2025-03-25"
```
### [`birthday(min_age \\ 18, max_age \\ 65, opts \\ [])`](`NeoFaker.Date.birthday/3`)
```elixir
iex> NeoFaker.Date.birthday()
~D[1997-01-02]
iex> NeoFaker.Date.birthday(18, 65)
~D[1998-03-04]
iex> NeoFaker.Date.birthday(18, 65, format: :iso8601)
"1999-05-06"
```
## [Gravatar](`NeoFaker.Gravatar`)
{: .col-1}
### [`display(email \\ nil, opts \\ [])`](`NeoFaker.Gravatar.display/2`)
```elixir
iex> NeoFaker.Gravatar.display()
"https://gravatar.com/avatar/<hashed_email>?d=identicon&s=80"
iex> NeoFaker.Gravatar.display("john.doe@example.com")
"https://gravatar.com/avatar/<hashed_email>?d=identicon&s=80"
iex> NeoFaker.Gravatar.display("john.doe@example.com", size: 100)
"https://gravatar.com/avatar/<hashed_email>?d=identicon&s=100"
iex> NeoFaker.Gravatar.display("john.doe@example.com", fallback: :monsterid)
"https://gravatar.com/avatar/<hashed_email>?d=monsterid&s=80"
```
## [HTTP](`NeoFaker.HTTP`)
{: .col-2}
### [`referrer_policy()`](`NeoFaker.HTTP.referrer_policy/0`)
```elixir
iex> NeoFaker.HTTP.referrer_policy()
"no-referrer"
```
### [`request_method()`](`NeoFaker.HTTP.request_method/0`)
```elixir
iex> NeoFaker.HTTP.request_method()
"GET"
```
### [`status_code(opts \\ [])`](`NeoFaker.HTTP.status_code/1`)
```elixir
iex> NeoFaker.HTTP.status_code()
"200 OK"
iex> NeoFaker.HTTP.status_code(type: :simple)
"200"
iex> NeoFaker.HTTP.status_code(group: :client_error)
"404 Not Found"
```
### [`user_agent(opts \\ [])`](`NeoFaker.HTTP.user_agent/1`)
```elixir
iex> NeoFaker.HTTP.user_agent()
"Mozilla/5.0 (X11; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0"
iex> NeoFaker.HTTP.user_agent(type: :browser)
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0"
iex> NeoFaker.HTTP.user_agent(type: :crawler)
"Mozilla/5.0 (compatible; Google-InspectionTool/1.0)"
```
## [Internet](`NeoFaker.Internet`)
{: .col-2}
### [`username(opts \\ [])`](`NeoFaker.Internet.username/1`)
```elixir
iex> NeoFaker.Internet.username()
"josé_valim"
iex> NeoFaker.Internet.username(word_count: 3, joiner: :dot)
"abigail.bethany.crawford"
iex> NeoFaker.Internet.username(username_type: :word, number: true, number_range: 1..2025)
"elixir_alchemist_2012"
```
### [`domain_name(opts \\ [])`](`NeoFaker.Internet.domain_name/1`)
```elixir
iex> NeoFaker.Internet.domain_name()
"example"
iex> NeoFaker.Internet.domain_name(word_count: 3)
"alpha-beta-gamma"
iex> NeoFaker.Internet.domain_name(type: :popular, popular_type: :email)
"gmail.com"
iex> NeoFaker.Internet.domain_name(type: :custom, domain_name: "elixir-lang.org")
"elixir-lang.org"
```
### [`tld(opts \\ [])`](`NeoFaker.Internet.tld/1`)
```elixir
iex> NeoFaker.Internet.tld()
".com"
iex> NeoFaker.Internet.tld(dot: false)
"org"
iex> NeoFaker.Internet.tld(type: :safe)
".example"
iex> NeoFaker.Internet.tld(type: :country_code)
".id"
```
### [`email(opts \\ [])`](`NeoFaker.Internet.email/1`)
```elixir
iex> NeoFaker.Internet.email()
"josé@example.com"
iex> NeoFaker.Internet.email(word_count: 3, joiner: :dot, number: true)
"abigail.bethany.crawford_202"
iex> NeoFaker.Internet.email(domain_type: :popular, popular_type: :email)
"jane.doe@gmail.com"
iex> NeoFaker.Internet.email(domain_type: :custom, domain_name: "elixir-lang.org")
"josé@elixir-lang.org"
iex> NeoFaker.Internet.email(tld_type: :country_code, dot: false)
"josé@example.id"
```
### [`ipv4()`](`NeoFaker.Internet.ipv4/0`)
```elixir
iex> NeoFaker.Internet.ipv4()
"183.235.34.108"
```
### [`ipv6(opts \\ [])`](`NeoFaker.Internet.ipv6/1`)
```elixir
iex> NeoFaker.Internet.ipv6()
"E0E6:7E24:EC6E:E44C:FC69:9C25:CD85:CE08"
iex> NeoFaker.Internet.ipv6(uppercase: false)
"e0e6:7e24:ec6e:e44c:fc69:9c25:cd85:ce08"
```
### [`mac_address(opts \\ [])`](`NeoFaker.Internet.mac_address/1`)
```elixir
iex> NeoFaker.Internet.mac_address()
"74:4E:44:B0:D0:93"
iex> NeoFaker.Internet.mac_address(uppercase: false)
"74:4e:44:b0:d0:93"
```
## [Lorem](`NeoFaker.Lorem`)
{: .col-1}
### [`sentence(opts \\ [])`](`NeoFaker.Lorem.sentence/1`)
```elixir
iex> NeoFaker.Lorem.paragraph()
"Suspendisse ac justo venenatis, tincidunt sapien nec, accumsan augue. Vestibulum urna
risus, egestas ut ultrices non, aliquet eget massa. Mauris id diam eget augue sagittis
convallis sit amet nec diam. Morbi ut blandit est, et placerat neque."
iex> NeoFaker.Lorem.paragraph(type: "meditations")
"Do the things external which fall upon thee distract thee? Give thyself time to learn
something new and good, and cease to be whirled around. But then thou must also avoid being
carried about the other way. For those too are triflers who have wearied themselves in life
by their activity, and yet have no object to which to direct every movement, and, in a word,
all their thoughts."
```
`NeoFaker.Lorem.sentence/1` and `NeoFaker.Lorem.word/1` behave the same way, generating random
sentences or words.
## [Number](`NeoFaker.Number`)
{: .col-2}
### [`between(min \\ 0, max \\ 100)`](`NeoFaker.Number.between/2`)
```elixir
iex> NeoFaker.Number.between()
27
iex> NeoFaker.Number.between(1, 100)
28
iex> NeoFaker.Number.between(20, 100.0)
29.481745280074264
iex> NeoFaker.Number.between(10.0, 100.0)
29.481745280074264
```
### [`digit()`](`NeoFaker.Number.digit/0`)
```elixir
iex> NeoFaker.Number.digit()
5
```
### [`float(left_digit \\ 10..100, right_digit \\ 10_000..100_000)`](`NeoFaker.Number.float/2`)
```elixir
iex> NeoFaker.Number.float()
30.94372
iex> NeoFaker.Number.float(1..9, 10..90)
1.44
```
## [Person](`NeoFaker.Person`)
{: .col-2}
### [`age(min \\ 0, max \\ 120)`](`NeoFaker.Person.age/2`)
```elixir
iex> NeoFaker.Person.age()
44
iex> NeoFaker.Person.age(7, 44)
27
```
### [`binary_gender(opts \\ [])`](`NeoFaker.Person.binary_gender/1`)
```elixir
iex> NeoFaker.Person.binary_gender()
"Male"
iex> NeoFaker.Person.binary_gender(locale: :id_id)
"Perempuan"
```
`NeoFaker.Person.non_binary_gender/1` and `NeoFaker.Person.short_binary_gender/1` behave the same
way, generating non-binary or short binary genders.
### [`first_name(opts \\ [])`](`NeoFaker.Person.first_name/1`)
```elixir
iex> NeoFaker.Person.first_name()
"Julia"
iex> NeoFaker.Person.first_name(sex: :male)
"José"
iex> NeoFaker.Person.first_name(locale: :id_id)
"Jaka"
```
`NeoFaker.Person.middle_name/1` and `NeoFaker.Person.last_name/1` behave the same way,
generating middle or last names.
### [`full_name(opts \\ [])`](`NeoFaker.Person.full_name/1`)
```elixir
iex> NeoFaker.Person.full_name()
"Abigail Bethany Crawford"
iex> NeoFaker.Person.full_name(sex: :male)
"Daniel Edward Fisher"
iex> NeoFaker.Person.full_name(middle_name: false)
"Gabriella Harrison"
```
### [`prefix(opts \\ [])`](`NeoFaker.Person.prefix/1`)
```elixir
iex> NeoFaker.Person.prefix()
"Mr."
iex> NeoFaker.Person.prefix(locale: :id_id)
"Tn."
```
`NeoFaker.Person.suffix/1` behaves the same way, generating a suffix for the person's name.
## [Text](`NeoFaker.Text`)
{: .col-2}
### [`character(opts \\ [])`](`NeoFaker.Text.character/1`)
```elixir
iex> NeoFaker.Text.character()
"a"
iex> NeoFaker.Text.character(type: :digit)
"0"
```
### [`characters(number \\ 11, opts \\ [])`](`NeoFaker.Text.characters/2`)
```elixir
iex> NeoFaker.Text.characters()
"XfELJU1mRMg"
iex> NeoFaker.Text.characters(20, type: :alphabet_upper)
"BVAJHRGSCEVJFNYSWCJE"
```
### [`emoji(opts \\ [])`](`NeoFaker.Text.emoji/1`)
```elixir
iex> NeoFaker.Text.emoji()
"✨"
iex> NeoFaker.Text.emoji(category: :activities)
"🎉"
```
### [`word()`](`NeoFaker.Text.word/0`)
```elixir
iex> NeoFaker.Text.word()
"computer"
```
## [Time](`NeoFaker.Time`)
{: .col-2}
### [`add(range \\ -24..24, opts \\ [])`](`NeoFaker.Time.add/1`)
```elixir
iex> NeoFaker.Time.add()
~T[15:22:10]
iex> NeoFaker.Time.add(-2..2, unit: :minute)
~T[07:23:10]
iex> NeoFaker.Time.add(0..10, format: :iso8601)
"15:22:10"
```
### [`between(start \\ ~T[00:00:00], finish \\ ~T[23:59:59], opts \\ [])`](`NeoFaker.Time.between/1`)
```elixir
iex> NeoFaker.Time.between()
~T[15:22:10]
iex> NeoFaker.Time.between(~T[00:00:00], ~T[23:59:59])
~T[19:30:11]
iex> NeoFaker.Time.between(~T[00:00:00], ~T[23:59:59], format: :iso8601)
"15:22:10"
```
### [`time_zone()`](`NeoFaker.Time.time_zone/0`)
```elixir
iex> NeoFaker.Time.time_zone()
"Asia/Makassar"
```