Identity
The following generator functions are available in the Identity provider:
┌────────────────────┬───────────────────┬────────────────┐
│ Generator Function │ Available Locales │ Unique Entries │
│ String │ Int64 │ Int64 │
├────────────────────┼───────────────────┼────────────────┤
│ firstname │ 81 │ 18659 │
│ highschool │ 2 │ 5 │
│ nationality │ 2 │ 5 │
│ occupation │ 2 │ 14 │
│ prefix │ 58 │ 208 │
│ surname │ 81 │ 24901 │
│ university │ 2 │ 14 │
└────────────────────┴───────────────────┴────────────────┘Impostor.prefix — Functionprefix(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 nolocaleis provided, the current session locale is used.
Example
julia> prefix(["F", "M", "F"])
3-element Vector{String}:
"Ms."
"Mr."
"Ms."Impostor.birthdate — Functionbirthdate(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.
Impostor.bloodtype — Functionbloodtype(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
Impostor.complete_name — Functioncomplete_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 nolocaleis 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 thanmax_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"Impostor.highschool — Functionhighschool(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 nolocaleis provided, the current session locale is used.
Impostor.nationality — Functionnationality(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 inoptionsormaskwhen using option-based or mask-based eneration. Validlevelvalues are::sex:country_code
locale::Vector{String}: locale(s) from which entries are sampled. If nolocaleis provided, the current session locale is used.
Impostor.university — Functionuniversity(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 nolocaleis provided, the current session locale is used.
Impostor.occupation — Functionoccupation(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 nolocaleis provided, the current session locale is used.
Impostor.firstname — Functionfirstname(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 nolocaleis 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"Impostor.surname — Functionsurname(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 nolocaleis provided, the current session locale is used.