Remove
RemoveExtract
Bases: ExtractionMethod
remove keys from body.
Method name: remove
Example Configuration
.. code-block:: yaml
- method: remove
inputs:
keys:
- hello
- world
Source code in extraction_methods/plugins/remove.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
matching_keys(keys, key_regex)
Find all keys that match regex
:param keys: dictionary keys to test :type keys: KeysView :param key_regex: regex to test against :type key_regex: str
:return: matching keys :rtype: list
Source code in extraction_methods/plugins/remove.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
remove_key(body, key_parts)
Remove nested terms
:param body: current body :type body: dict :param key_parts: key parts seperated by delimiter :type key_parts: list
:return: dict :rtype: update body
Source code in extraction_methods/plugins/remove.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
RemoveInput
Bases: Input
Model for Remove Input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keys
|
list[str]
|
list of keys to remove. |
required |
delimiter
|
str
|
delimiter for nested term. |
'.'
|
Source code in extraction_methods/plugins/remove.py
23 24 25 26 27 28 29 30 31 32 33 34 | |