Skip to content

Instantly share code, notes, and snippets.

@hsyyid
Created Aug 25, 2020
Embed
What would you like to do?
# Specify lookup keys
qb_lookup_keys = {'key_prop': 'name', 'value_prop': 'value'}
# Explode these into new columns
invoices = (invoices.pipe(gs.json_tuple_to_cols, 'Line.SalesItemLineDetail.ItemRef',
col_config={'cols': {'key_prop': 'Item', 'value_prop': 'Item Id'},
'look_up': qb_lookup_keys})
.pipe(gs.json_tuple_to_cols, 'Line.SalesItemLineDetail.ItemAccountRef',
col_config={'cols': {'key_prop': 'Item Ref', 'value_prop': 'Item Ref Id'},
'look_up': qb_lookup_keys}))
invoices[['Id', 'Item', 'Item Id', 'Item Ref', 'Item Ref Id']].head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment