hosh
hosh copied to clipboard
CSV, JSON and XML support
Problem Right now Hosh provides some very basic support for sorting, filtering, splitting, etc. Explore and experiment some new commands around data manipulation.
Solution Existing solutions of data manipulation of CSV, TSV, JSON are: https://github.com/johnkerl/miller https://github.com/stedolan/jq https://github.com/nushell/nushell
Benefit
Be able to apply built-in commands like take drop select filter to produce/consume CSV/TSV/XML/JSON.
TSV and CSV could be covered by http://commons.apache.org/proper/commons-csv/ (a 44KB library with no additional dependencies).
JUnit5 is using https://github.com/uniVocity/univocity-parsers but jar file is quite big (400KB).
JSON could be covered by:
- GSON 240KB, no additional dependencies
- JSR 374 implementation is also needed (glassfish provides one)
- joy another implementation for JSR 374
Please note that JSR 374 supports JsonPointer (https://tools.ietf.org/html/rfc6901).
XML could be covered without any additional dependency. Sample:
xpath file.xml expression | ..., to extract data from any document