@@ -55,6 +55,9 @@ parser.find_key(data, 'key')
55
55
parser.find_keys(data, [' rope' , ' cable' ])
56
56
[[5 , False ], [7 , True ]]
57
57
58
+ parser.find_keys(data, [' cable' , ' rope' ])
59
+ [[5 , False ], [7 , True ]]
60
+
58
61
59
62
parser.find_key_chain(data, [' my' , ' key' , ' chain' ])
60
63
[' A' ]
@@ -78,27 +81,26 @@ parser.find_key_value(data, 'chain', 'B')
78
81
## API
79
82
` find_key(data: dict | list, key: str) -> list `
80
83
81
- - Provide JSON data as a dictionary or a list, as well as the key as a string
84
+ - Provide JSON data as a dictionary or a list. The key to be found is a string.
82
85
83
86
- Returns a list of values that match the corresponding key.
84
87
85
88
` find_keys(data: dict | list, keys: list) -> list `
86
89
87
- - Provide JSON data as a dictionary or a list, as well as a list of keys
90
+ - Provide JSON data as a dictionary or a list. The keys are a list of strings. The order of the keys does not matter.
88
91
89
- - Returns a two dimensional list of values matching the keys
92
+ - Returns a two dimensional list of values matching the keys. The order of values is returned in the same order as the original data.
90
93
91
94
` find_key_chain(data: dict | list, keys: list) -> list `
92
95
93
- - Provide JSON data as a dictionary or a list, as well as a list of keys as strings.
96
+ - Provide JSON data as a dictionary or a list. The key chain is a list of keys that are all strings. The order of the keys ** does ** matter .
94
97
95
- - Returns a list of values that match the corresponding key chain.
98
+ - Returns a list of values that match the corresponding key chain. The order of values is returned in the same order as the original data.
96
99
97
100
> Wildcard ** '* '** can be used as key(s) to match any.
98
101
99
102
` find_key_value(data: dict | list, key: str, value: str | int | float | bool | None) -> list `
100
103
101
- - Provide JSON data as a dictionary or a list, a key as a string,
102
- and a value as a string, integer, float, boolean, or None.
104
+ - Provide JSON data as a dictionary or a list. The key is a string. The value is a string, integer, float, boolean, or None.
103
105
104
- - Returns a list of set(s) that contain the key: value pair.
106
+ - Returns a list of dictionaries that contain the key: value pair.
0 commit comments