Json file
JsonFileExtract
Bases: ExtractionMethod
Takes an input list of string to extract from the json file.
Method name: json_file
Example configuration
.. code-block:: yaml
- method: json_file
inputs:
path: /path/to/file.json
properties:
- key: MIP_ERA
output_key: mip_era
Source code in extraction_methods/plugins/json_file.py
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 102 103 104 105 106 107 | |
extract_terms(path)
Extract terms from JSON file(s) at path.
:param path: path to file :type path: Path
:return: extracted terms :rtype: dict
Source code in extraction_methods/plugins/json_file.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
JsonFileInput
Bases: Input
Model for JSON File Input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to directory of JSON files or single JSON file. |
required |
properties
|
list[KeyOutputKey]
|
list of properties to extract. |
required |
output_key
|
str
|
Key to output to. if none output is merged. |
None
|
Source code in extraction_methods/plugins/json_file.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |