Skip to content

get

Source

Hook for getting a key based on a key path which is a list with keys and numbers for indexes in a list.

Inputs

Name Type Default Required Description
path Union[list, str] True A list or string with a separator for the path to the value you want to update with strings for keys and ints for indexes in the list.
sep str / True For string paths, a separator for key path.
fallback Any None True Fallback value if the keys is not found.

Arguments

Position Argument Type
1 path Union[list, str]
2 fallback Any

Returns

None

Examples

Get a key based on a key path

stuff:
  and: things
get->: get stuff/and

stuff:
  and: things
get: things