Skip to content

v2.5.1

Compare
Choose a tag to compare
@ryuichiueda ryuichiueda released this 03 Jan 14:38
· 10 commits to master since this release

With an option -t <json/yaml/xml>, opy reads contents of a file as json/yaml/xml data and sets it to an object "T".

examples:

$ echo '{"hoge":["a","b"]}' | opy -t json '[*T["hoge"]]'
a
b
$ echo -e 'aho:\n  boke: ["a","b"]' | opy -t yaml '[*T["aho"]["boke"]]'
a
b
$ echo -e '<?xml version="1.0" encoding="utf-8"?>\n<foo>bar</foo>' | opy -t xml '[e.text for e in T.iter("foo")]'
bar