Skip to main content

Added v0.4

A useful connector to create test data. Either fixed values can be set or data can be randomly generated.

Tabset

Read​

Recipe​

read:
- test:
rows: 2
values:
fixed value: example string
code: <code(10)>
boolean: <boolean>
number: <number(2.718-3.141)>
int: <int(0-100)>
char: <char>
word: <word>
sentence: <sentence>
random_choice: <random(["apple","strawberry","pear"])>

Output​

fixed valuecodebooleannumberintcharwordsentencerandom_choice
example stringE4CO2KRBG2True2.76723mnequeAdipisci dolor quisquam labore dolorem dolorapple
example string8G7DT4H7ABFalse2.87369rtemporaAmet numquam quiquia numquam adipisci laborepear

Function​

from wrangles.connectors import test
df = test.read(rows=2, values={'header1':'a','header2':'b'})

Output​

header1header2
ab
ab

Parameters​

ParameterRequiredData TypeNotes
rows✓intNumber of rows to generate.
values✓dictDictionary of header/values defining the table. See special inputs for special codes to create random data.
order_bystrUses SQL syntax to sort the input.
ifstrA condition that will determine whether the action runs or not as a whole.

Special Inputs​

  • &lt;code> or <code(8)> : Random alphanumeric codes - (8) sets the length. e.g. J1RSB7X9
  • &lt;char> : Random letters
  • &lt;word> : Random nonsense words
  • &lt;sentence> : Random nonsense sentences
  • &lt;boolean> : Randomly True or False
  • &lt;number(2.718-3.141)> : Random numbers - (2.718-3.141) sets the range and decimal places. Default 0.00-1.00.
  • &lt;int(1-10)> : Random integers - (1-10) sets the range. Default 1-100.
  • <random(["a","b","c"])> : Randomly selected from the list.