Skip to content

delete

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.

Arguments

Position Argument Type
1 path Union[list, str]

Returns

NoneType

Examples

Delete a key based on a key path

one:
  - that:
      stuff: things
two:
  - that:
      stuff: things
three:
  - that:
      stuff: things

deleter_list:
  ->: delete
  path:
    - one
    - 0
    - that
    - stuff

deleter_str:
  ->: delete
  path: two/0/that/stuff

deleter_str_sep:
  ->: delete
  path: three.0.that.stuff
  sep: .