vividvilla / csvtotable

Simple command-line utility to convert CSV files to searchable and sortable HTML table.
MIT License
1.12k stars 116 forks source link

Read from STDIN, STDOUT and from URL #12

Open vishnus opened 7 years ago

vishnus commented 7 years ago

Should be possible to pass CSV/JSON data in STDIN or read from STDOUT of another command or from URL download. This helps in visualizing JSON or CSV responses

chfw commented 7 years ago

You can try this:

$ pyexcel transcode --sheet-index 0 https://github.com/vividvilla/csvtotable/raw/master/sample/goog.csv goog.sortable.html

and what you will need is:

$ pip install pyexcel pyexcel-cli pyexcel-sortable

pyexcel-sortable wraps csvtotable to pyexcel.

chfw commented 7 years ago

And you can do from stdin too:

curl -L https://github.com/vividvilla/csvtotable/raw/master/sample/goog.csv | pyexcel transcode --sheet-index 0 --source-file-type csv - goog2.sortable.html

What's more, you can render xls, xlsx and ods using csvtotable as well:

$ pyexcel transcode --sheet-index 0 https://github.com/pyexcel/excel2table/raw/master/sample/goog.ods goog.ods.sortable.html
$ pyexcel transcode --sheet-index 0 https://github.com/pyexcel/excel2table/raw/master/sample/goog.xls goog.xls.sortable.html

if you would install:

$ pip install pyexcel-xls
$ pip install pyexcel-odsr
chfw commented 7 years ago

Finally for stdout:

$ curl -L https://github.com/vividvilla/csvtotable/raw/master/sample/goog.csv | pyexcel transcode --sheet-index 0 --source-file-type csv --output-file-type 'sortable.html' - -
migs2173 commented 7 years ago

hi I tried to install and run but always an error invalid value input file