You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`-R` raw string input (don't auto convert input to dict/list)
77
77
-`-s` print the JSON schema in grep-able format
78
78
-`-t` print type annotations in schema view
79
79
-`-h` help
@@ -152,6 +152,30 @@ while read -r value; do
152
152
done < <(cat data.json | jello -rl _.foo)
153
153
```
154
154
155
+
### Non-JSON Data Input (YAML, CSV, etc.)
156
+
You can work with other types of data with the `-R` (raw string input) option. For example,
157
+
if you would like to read in YAML data you can load the data as a raw string, import
158
+
the `yaml` library, and load the string data into `_` with the `yaml` library:
159
+
160
+
```bash
161
+
$ cat values.yaml
162
+
163
+
var1: value1
164
+
var2: value2
165
+
var3: value3
166
+
167
+
$ jello -Rr '
168
+
import yaml
169
+
_ = yaml.safe_load(_)
170
+
_["var2"]
171
+
' -f values.yaml
172
+
173
+
value2
174
+
```
175
+
176
+
> Note: Dot notation is not supported with the `-R` option unless the library used to
177
+
> convert the raw string supports this. (e.g. `python-benedict`)
178
+
155
179
### Setting Custom Colors via Environment Variable
156
180
Custom colors can be set via the `JELLO_COLORS` environment variable. Any colors set in the environment variable will take precedence over any colors set in the initialization file. (see [Advanced Usage](https://github.com/kellyjonbrazil/jello/blob/master/ADVANCED_USAGE.md))
0 commit comments