Skip to main content

Convert Wrangles

Convert wrangles, with recipe examples, parameters, and behavior.

Convert Case​

Change the letter case of text values.

Use convert.case to normalize capitalization while keeping the source column or writing the result to a new column.

Behavior​

  • Supported modes are lower, upper, title, and sentence.
  • Omitting output overwrites the input column.
  • Input and output lists must have equal lengths.
  • Non-string values are passed through unchanged and produce a warning.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName, index, or list of input columns.string, integer, array—Yes
outputName or list of output columns. If omitted, each input column is overwritten.string, arraynullNo
Options
caseLetter case to apply. Sentence case lowercases the value and capitalizes sentence starts.string; one of:
  • lower
  • upper
  • title
  • sentence
"lower"No
Conditions
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No

Examples​

wrangles:
- convert.case:
input: product
output: product_upper
case: upper
product
Cordless Drill
bearing seal
product_upper
CORDLESS DRILL
BEARING SEAL
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID5
Catalog keyconvert.case
Recipe keyconvert.case
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.case
Legacy UUID12ff4120-3613-4801-8653-99c793477fbc

Sources


Convert Data Type​

Convert values to strings, numbers, booleans, or datetimes.

Use convert.data_type when a recipe needs consistent Python-compatible values rather than display-only formatting.

Behavior​

  • Supported target types are str, float, int, bool, and datetime.
  • Omitting data_type uses the runtime default str.
  • Omitting output overwrites the input column.
  • Failed conversions retain the original value unless default is supplied.
  • Additional undocumented keyword arguments are implementation details and are not part of the public Registry contract.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName, index, or list of input columns.string, integer, array—Yes
outputName or list of output columns. If omitted, each input column is overwritten.string, arraynullNo
Options
data_typeData type to produce.string; one of:
  • str
  • float
  • int
  • bool
  • datetime
"str"No
Conditions
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
Errors
defaultValue returned when conversion fails. If omitted, the original value is retained.string, number, array, object, boolean, nullnullNo

Examples​

wrangles:
- convert.data_type:
input: quantity
output: quantity_integer
data_type: int
default: 0
quantity
12
not available
quantity_integer
12
0
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID6
Catalog keyconvert.data_type
Recipe keyconvert.data_type
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.data_type
Legacy UUID52384f01-7164-404f-8615-063e7677a588

Sources


Fraction to Decimal​

Convert fractions to decimals.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output colum.string, array, nullnullNo
Formatting
decimalsNumber of decimals to round fraction.integer4No
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No

Examples​

wrangles:
- convert.fraction_to_decimal:
input: fractions
output: decimals
decimals: 3
fractions
3/32
25/64
decimals
0.094
0.391
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID7
Catalog keyconvert.fraction_to_decimal
Recipe keyconvert.fraction_to_decimal
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.fraction_to_decimal
Legacy UUID7c55752e-70ab-4809-8298-c59436127457

Sources


Convert From JSON​

Parse JSON text into lists, objects, scalars, booleans, or null values.

Use convert.from_json when a column contains JSON text that later wrangles need to treat as structured values.

Behavior​

  • Each non-fallback value is parsed with Python's JSON parser.
  • Omitting output overwrites the input column.
  • Multiple input columns may share one fallback or use one fallback per input.
  • Invalid JSON raises an error unless a non-null fallback is supplied.
  • Permissive Python-literal or YAML-like parsing is outside this wrangle's contract.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName, index, or list of columns containing valid JSON text.string, integer, array—Yes
outputName or list of output columns. If omitted, each input column is overwritten.string, arraynullNo
Conditions
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
Errors
defaultValue returned for empty or invalid JSON. A list may supply one fallback per input column.string, number, array, object, boolean, nullnullNo

Examples​

wrangles:
- convert.from_json:
input: attributes_json
output: attributes
attributes_json
{"material":"steel","voltage":18}
["corded","variable speed"]
attributes
{"material":"steel","voltage":18}
["corded","variable speed"]
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID8
Catalog keyconvert.from_json
Recipe keyconvert.from_json
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.from_json
Legacy UUIDe370dfcf-b0fe-4c48-8a52-6f34c47e7978

Sources


From YAML​

Convert a YAML representation into an object.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column. If omitted, the input column will be overwritten.string, array, nullnullNo
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No
Errors
defaultValue to return if the row is empty or fails to be parsed as YAML. If input is a list, default may also be a list - either a single value to apply to all columns, or one value per input column.string, array, object, number, boolean, nullnullNo

Examples​

wrangles:
- convert.from_yaml:
input: column 1
Product Specs:
length: 6 inch
voltage: 24V
weight: 3lb
{
'Product Specs': {
'length': '6 inch',
'voltage': '24V',
'weight': '3lb'
}
}
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID9
Catalog keyconvert.from_yaml
Recipe keyconvert.from_yaml
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.from_yaml
Legacy UUIDb1c20004-5f80-41c2-84d2-2d4601a033b5

Sources


To JSON​

Convert an object to a JSON representation.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column. If omitted, the input column will be overwritten.string, array, nullnullNo
Formatting
ensure_asciiIf true, non-ASCII characters will be escaped. Default is false.booleanfalseNo
indentIf indent is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, negative, or "" will only insert newlines. None (the default) selects the most compact representation. Using a positive integer indent indents that many spaces per level. If indent is a string (such as '\t'), that string is used to indent each level.string, integer—No
sort_keysIf sort_keys is true (defaults to False), then the output of dictionaries will be sorted by key.boolean—No
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No

Examples​

wrangles:
- convert.to_json:
input: column
output: new column
column
['a', 'python', 'list']
{'python': 'dict'}
new column
["a","python","list"]
{"python":"dict"}
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID10
Catalog keyconvert.to_json
Recipe keyconvert.to_json
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.to_json
Legacy UUID94e54eb7-2b8c-4047-89d0-fb5d16baf396

Sources


To YAML​

Convert an object to a YAML representation.

Parameters​

NameDescriptionAccepted ValuesDefaultRequired
I/O
inputName of the input column.string, integer, array—Yes
outputName of the output column. If omitted, the input column will be overwritten.string, array, nullnullNo
Formatting
sort_keysIf sort_keys is true (default: False), then the output of dictionaries will be sorted by key.booleanfalseNo
allow_unicodeAllow Unicode value accepted by the runtime.booleantrueNo
indentSpecify the number of spaces for indentation to specify nested elements.integer—No
Conditions
ifCondition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}.string—No
whereFilter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'.string—No
where_paramsValues used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name.array, object—No

Examples​

wrangles:
- convert.to_yaml:
input: column 1
indent: 2
{
'Product Specs': {
'length': '6 inch',
'voltage': '24V',
'weight': '3lb'
}
}
Product Specs:
length: 6 inch
voltage: 24V
weight: 3lb
Access
RequirementValue
AI-poweredNo
Requires WrangleWorks accountNo
Requires subscriptionNo
Requires external API keyNo
Technical details
FieldValue
Catalog ID11
Catalog keyconvert.to_yaml
Recipe keyconvert.to_yaml
Catalog statusactive
Lifecycle statusactive
Recipe Writer eligibleYes
Namespaceconvert
Documentation groupconvert
AliasesNone
Runtime symbolwrangles.recipe_wrangles.convert.to_yaml
Legacy UUID4cd6252f-ce47-4a9d-8272-3d87e875b72a

Sources