Identity

The following generator functions are available in the Identity provider:

Impostor.prefixFunction
prefix(n::Integer = 1; kws...)
prefix(options::Vector{String}, n::Integer; kws...)
prefix(mask::Vector{<:AbstractString}; kws...)

Generate n name prefixes, e.g. "Mr." and "Ms.", from a given locale.

Parameters

  • n::Integer = 1: number of prefixes to generate.
  • options::Vector{<:AbstractString}: vector with options restricting the possible values generated.
  • mask::Vector{<:AbstractString}: mask vector with element-wise option restrictions.

Options

The valid options values for options and mask are:

  • "M" for "male"
  • "F" for "female"

Kwargs

  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.

Example

julia> prefix(["F", "M", "F"])
3-element Vector{String}:
"Ms."
"Mr."
"Ms."
source
Impostor.birthdateFunction
birthdate(n::Integer = 1; start::Date, stop::Date)

Generate n birth date entries between the start and stop dates.

Parameters

  • n::Int = 1: number of dates to generate.
  • start::Date = Date(1900, 1, 1): start of the sampling period.
  • stop::Date = Dates.today(): end of the sampling period.
source
Impostor.bloodtypeFunction
bloodtype(n::Integer = 1)

Generate n blood type entries e.g. "AB-", "O+" and "A+".

Parameters

  • n::Integer = 1: number blood type entries to be generated
source
Impostor.complete_nameFunction
complete_name(n::Integer = 1; kws...)
complete_name(options::Vector{<:AbstractString}, n::Integer; kws...)
complete_name(mask::Vector{<:AbstractString}; kws...)

Generate n or length(mask) full (complete) names from a given locale.

Parameters

  • n::Integer = 1: number of complete names to generate.

Options

The valid options values for options and mask are:

  • "M" for "male"
  • "F" for "female"

Kwargs

  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.
  • max_surnames::Integer = 3: maximum number of surnames in each of the generated entries, note that the actual number may be smaller than max_surnames.

Examples

julia> Impostor.complete_name(["F"], 5)
5-element Vector{String}:
"Melissa Sheffard"
"Kate Collins"
"Melissa Cornell Fraser"
"Abgail Cornell"
"Abgail Fraser Jameson"

julia> complete_name(["F", "M", "F", "F", "M"])
5-element Vector{String}:
"Melissa Sheffard Jameson Cornell"
"Alfred Collins"
"Mary Sheffard Fraser"
"Milly Jameson Fraser"
"Alfred Fraser Collins"
source
Impostor.highschoolFunction
highschool(n::Integer = 1; kwargs...)

Parameters

  • n::Integer = 1: number of highschool names to generate.

Kwargs

  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.
source
Impostor.nationalityFunction
nationality(n::Integer = 1; kws...)
nationality(options::Vector{<:AbstractString}, n::Integer; level::Symbol, kws...)
nationality(mask::Vector{<:AbstractString}; level::Symbol, kws...)

Parameters

  • n::Integer = 1: number of nationality entries to generate.
  • options::Vector{<:AbstractString}: vector with options restricting the possible values generated.
  • mask::Vector{<:AbstractString}: mask vector with element-wise option restrictions.

Kwargs

  • level::Symbol = :district_name: Level of values in options or mask when using option-based or mask-based eneration. Valid level values are:
    • :sex
    • :country_code
  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.
source
Impostor.universityFunction
university(n::Integer = 1; kws...)
university(fields::Vector{<:AbstractString}, n::Integer; kws...)
university(field_mask::Vector{<:AbstractString}; kws...)

Parameters

  • n::Integer = 1: number of university entries to generate.
  • options::Vector{<:AbstractString}: vector with options restricting the possible values generated.
  • mask::Vector{<:AbstractString}: mask vector with element-wise option restrictions.

Options

The valid options values for elements in options and mask are:

  • "business"
  • "humanities"
  • "social-sciences"
  • "natural-sciences"
  • "formal-sciences"
  • "public-administration"
  • "military"

Kwargs

  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.
source
Impostor.occupationFunction
occupation(n::Integer = 1; kws...)
occupation(options::Vector{<:AbstractString}, n::Integer; kws...)
occupation(mask::Vector{<:AbstractString}; kws...)

Generate n or length(mask) occupation entries.

Parameters

  • n::Integer = 1: number of prefixes to generate.
  • options::Vector{<:AbstractString}: vector with options restricting the possible values generated.
  • mask::Vector{<:AbstractString}: mask vector with element-wise option restrictions.

Options

The valid options values for the elements in options and mask are:

  • "business"
  • "humanities"
  • "social-sciences"
  • "natural-sciences"
  • "formal-sciences"
  • "public-administration"
  • "military"

Kwargs

  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.
source
Impostor.firstnameFunction
firstname(n::Integer = 1; kws...)
firstname(sexes::Vector{<:AbstractString}, n::Integer; kws...)
firstname(sexes::Vector{<:AbstractString}; kws...))

Generate n or length(mask) first names.

Parameters

  • n::Integer = 1: number of first names to generate.
  • options::Vector{<:AbstractString}: vector with options restricting the possible values generated.
  • mask::Vector{<:AbstractString}: mask vector with element-wise option restrictions.

Options

The valid options values for options and mask are:

  • "M" for "male"
  • "F" for "female"

Kwargs

  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.

Examples

julia> firstname(["F"], 4)
4-element Vector{String}:
"Sophie"
"Abgail"
"Sophie"
"Mary"

julia> firstname(["F", "M", "F", "F", "M"])
5-element Vector{String}:
"Sophie"
"Carl"
"Milly"
"Amanda"
"John"
source
Impostor.surnameFunction
surname(n::Integer = 1; kws...)

Generate a surname using the provided locale as source.

Parameters

  • n::Integer = 1: number of surnames to generate.

Kwargs

  • locale::Vector{String}: locale(s) from which entries are sampled. If no locale is provided, the current session locale is used.
source