2.4.2-alpha.1 • Published 25 days ago

@tidepool/data-tools v2.4.2-alpha.1

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
25 days ago

@tidepool/data-tools

Node streams to work with Tidepool API data

Installation

$ npm install @tidepool/data-tools

Example

import TidepoolDataTools from '@tidepool/data-tools';

// Set up the processing stream
const processingStream = readStream
      .pipe(TidepoolDataTools.jsonParser())
      .pipe(TidepoolDataTools.tidepoolProcessor());

// Now attach multiple parallel output streams
processingStream
        .pipe(TidepoolDataTools.xlsxStreamWriter(xlsxStream));

processingStream
        .pipe(someOtherOutputStream);

Methods

TidepoolDataTools.jsonParser()

Convenience function to return a JSONStream.parse('*').
See also the JSONStream NPM Module.

TidepoolDataTools.tidepoolProcessor()

Returns a through stream that processes the JSON Object data according the the config.

TidepoolDataTools.xlsxStreamWriter(outputStream)

Writes an xlsx Workbook to outputStream with different Worksheets according to the config.

Command Line Usage

@tidepool/data-tools includes a command-line tool

Install globally:

$ npm i -g @tidepool/data-tools && tidepool-data-tools --help
Usage: tidepool-data-tools [options] [command]

Options:
  -V, --version      output the version number
  -h, --help         output usage information

Commands:
  convert [options]  Convert data between different formats

$ tidepool-data-tools convert --help
Usage: tidepool-data-tools [options]

Options:
  -V, --version                            output the version number
  -i, --input-tidepool-data <file>         csv, xlsx, or json file that contains Tidepool data
  -c, --config <file>                      a JSON file that contains the field export configuration
  --salt <salt>                            salt used in the hashing algorithm (default: "no salt specified")
  -o, --output-data-path <path>            the path where the data is exported (default: "./example-data/export")
  -f, --output-format <format>             the path where the data is exported (default: ["all"])
  --start-date [date]                      filter data by startDate
  --end-date [date]                        filter data by endDate
  --merge-wizard-data                      option to merge wizard data with bolus data. Default is true
  --filterByDatesExceptUploadsAndSettings  upload and settings data can occur before and after start and end dates, so include ALL upload and settings data in export
  -h, --help                               output usage information

License

Licensed under the BSD-2-Clause License

2.4.2-alpha.1

25 days ago

2.4.1

8 months ago

2.4.1-esm.2

10 months ago

2.4.1-esm.3

10 months ago

2.4.0

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago