Skip to content

Commit 771525f

Browse files
committed
improve documentation
1 parent 1aa2bf7 commit 771525f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ parser.find_key(data, 'key')
5555
parser.find_keys(data, ['rope', 'cable'])
5656
[[5, False], [7, True]]
5757

58+
parser.find_keys(data, ['cable', 'rope'])
59+
[[5, False], [7, True]]
60+
5861

5962
parser.find_key_chain(data, ['my', 'key', 'chain'])
6063
['A']
@@ -78,27 +81,26 @@ parser.find_key_value(data, 'chain', 'B')
7881
## API
7982
`find_key(data: dict | list, key: str) -> list`
8083

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.
8285

8386
- Returns a list of values that match the corresponding key.
8487

8588
`find_keys(data: dict | list, keys: list) -> list`
8689

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.
8891

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.
9093

9194
`find_key_chain(data: dict | list, keys: list) -> list`
9295

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.
9497

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.
9699

97100
> Wildcard **'*'** can be used as key(s) to match any.
98101
99102
`find_key_value(data: dict | list, key: str, value: str | int | float | bool | None) -> list`
100103

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.
103105

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

Comments
 (0)