Ratalyzer analyzes product ratings from CSV and outputs statistics as JSON.
Ratalyzer reads input either from a file or stdin and similarly writes output either to a file or to stdout.
To read from a file, use the --input-file
or -i
switch:
sbt "run --input-file src/test/resources/input.csv"
To write to a file, use the --output-file
or -o
switch:
sbt "run --input-file src/test/resources/input.csv --output-file foo.json"
If either flag is omitted, corresponding IO defaults to stdin/stdout. This allows placing the tool as a part of a standard Unix pipeline. For example:
curl http://example.com/product-rating.csv | sbt -error run | jq .mostRatedProduct
sbt test