Recursively convert JSON including json-string to YAML
Project description
rj2y
This CLI tool is a simple utility to convert JSON to YAML. Especially useful when you want to convert JSON including JSON-embedded string.
It may be convenient to reading server logs. Using with jq
and yq
is recommended.
Installation
pipx install rj2y
Usage
cat some.json | rj2y
rj2y some.json
Example
input json and output yaml
Using yq make it easier to read.
cat some.json | rj2y | yq
aaa: !!str AAA
bbb: !!bool true
ccc: !!int 123
ccc2: !!str 123
ddd: !!float 123.456
ddd2: !!str 123.456
eee:
- !!str e
- !!str ee
- !!str eee
fff:
f: !!str f
ff: !!str ff
fff: !!str fff
ggg:
- g: !!str g
gg: !!str gg
ggg: !!str ggg
- g: !!str g
gg: !!str gg
ggg: !!str ggg
hhh:
h: !!str h
hh: !!str hh
hhh: !!str hhh
iii:
i:
ii: !!str ii
ii: !!str ii
jjj: !!str |-
jj1
jj2
jj3
kkk:
k:
kk: !!str |-
kk1
kk2
kk3
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rj2y-0.1.2.tar.gz
(4.5 kB
view hashes)
Built Distribution
rj2y-0.1.2-py3-none-any.whl
(3.4 kB
view hashes)