Bothify

The Bothify field generates a string by replacing selected symbols with random characters.

Schema

fields:
  - name: Bothify One
    type: Bothify
    args:
      format: "^^ ## ??"
    null_probability: 0.5
  - name: Bothify Two
    type: Bothify
    args:
      format: "^^ ## ??"
    constraints:
      - type: IfNull
        name: Bothify One
  - name: Bothify Three
    type: Bothify
    args:
      format: |
        {%- set one = refs['Bothify One']['raw'] -%}
        {%- set two = refs['Bothify Two']['raw'] -%}
        {%- if one -%}
        Bothify One: {{ one }}
        {%- elif two -%}
        Bothify Two: {{ two }}
        {%- else -%}
        {%- endif -%}

Output

Bothify OneBothify TwoBothify Three
53 09 URBothify One: 53 09 UR
74 91 aRBothify One: 74 91 aR
35 79 jqBothify One: 35 79 jq
85 89 bvBothify Two: 85 89 bv
92 55 tYBothify One: 92 55 tY
24 60 xqBothify Two: 24 60 xq

Arguments

NameTypeDescriptionDefault
formatstringThe format of the string to generate.

Format

The format string is a string that contains symbols that will be replaced with random characters. The following symbols are supported:

SymbolDescription
^A random digit [1-9]
#A random digit [0-9]
?A random letter [a-Z]

Field arguments

NameTypeDescriptionDefault Value
null_probabilityfloatThe probability that the field will be null.0.0
constraintslistA list of constraints to apply to the field.[]

Supported constraints

NameDescription
IfNullThe value must only be non-null if another field is null.