Random String
This variable generates a specified number of unique strings, based on a string format pattern.
The list is pre-populated to ensure that each string is unique.
Format
Initial value is a string pattern specified with %s
and %d
, or %g
.
%s
represents one ASCII letter%d
represents one digit between0
and9
%g
represents one complete UUID, cannot be combined with other string patterns
Parts of the string can be static, e.g. not random.
Arguments
count
int (optional) - number of unique strings to generate (default:1
)upper
bool (optional) - if the strings should be in upper case (default:False
)
Example
And value for variable "AtomicRandomString.registration_plate_number" is "%s%sZ%d%d0 | upper=True, count=100"
And value for variable "AtomicRandomString.uuid" is "%g | count=100"
This can then be used in a template:
{
"registration_plate_number": "{{ AtomicRandomString.registration_plate_number }}"
}
AtomicRandomString.registration_plate_number
will then be a string in the format [A-Z][A-Z]Z[0-9][0-9]0
and there will be 100
unique values for disposal.
atomicrandomstring__base_type__
def atomicrandomstring__base_type__(value: str) -> str
Validate values that AtomicRandomString
can be initialized with.