csv2timeseries
v0.0.6
Published
## Overview This package provides a flexible CLI to selectively generate Predix compatible [time-series format](https://www.predix.io/docs/?r=201597#Y5J5gFHz) JSON from a large CSV file, features includes:
Downloads
2
Readme
Time-series generator from CSV
Overview
This package provides a flexible CLI to selectively generate Predix compatible time-series format JSON from a large CSV file, features includes:
- Selectively pick columns with argv "--columns" or env variable "EXPORT_COLUMNS", this shall includes the timestamp column, e.g.
'Time,NGGSEL_GT0534,'
- Specify timestamp column name with argv "-x" or env variable "EXPORT_COLUMN_TIME", default to
'Time'
; - Specify limit number of rows with argv "--length" or env variable "EXPORT_ROW_LIMIT", default to 1e5;
- Specify limit of rows with argv "--interval" or env variable "EXPORT_INTERVAL", in format of time range:
'5minute', '2hour', '5m', '2h'
; - Specify time range length with argv "--range" or env variable "EXPORT_TIMERANGE", in format of time range:
'5day', '2year', '5d', '2y'
; - Specify origin date time formats with argv "--format" or env variable "EXPORT_TIME_FORMAT", multiple time formats are separated by bar (|):
'DD/MM/YYYY HH:mm:ss|MM/DD/YY HH:mm'
;
Usage
Run npm install -g csv2timeseries
to install, from the command line use csv file name as input, you can expect time-series on standard output.
EXPORT_COLUMNS='Time,NGGSEL_GT0534' EXPORT_TIMERANGE='1w' EXPORT_INTERVAL='10m' csv2timeseries ~/Documents/D_VSVA_VSVB.csv