Giter Site home page Giter Site logo

node-data-tools's Introduction

@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

node-data-tools's People

Contributors

krystophv avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mdblp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.