npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

racing-data-converter

v1.4.0

Published

Converts motorsport data into formats from popular data analysis software

Downloads

14

Readme

Racing Data Converter

Converts time series data into popular motorsport Data Logger formats.

This library was developed at B'Energy Racing, a Formula SAE Electric Team from the Facens University Center.

Formats supported

| Format | Extension | Software | Support | |----------------------------------|------------|---------------------|---------------| | Pro Tune | .dlf | Pro Tune Analyzer | Writer | | EFI Analytics ASCII | .msl | MegaLogViewer | Writer | | EFI Analytics Binary MLG (MLVLG) | .mlg | MegaLogViewer | Writer | | MoTeC CSV | .csv | MoTeC i2 | Writer | | Pi ASCII | .txt | Cosworth Pi Toolbox | Writer | | BOSCH Darab ASCII | .txt | Bosch WinDarab | Writer | | RacePak ASCII | .txt | RacePak DataLink II | Writer | | Excel CSV | .csv | Microsoft Excel | Writer | | CSV | .csv, .tsv | - | Reader/Writer | | B'Energy Meteor Log | .met | - | Reader/Writer | | JSON (raw data frames) | .json | - | Reader/Writer |

Command Line Interface

The CLI allows converting without writing a single line of code.

By default, it reads CSV files and outputs any format. The CSV file must have the first column as the timestamp in seconds. Columns can follow the format Name (unit) or Name (unit) [key].

Install

You need NodeJS (16+ is recommended) installed first. Then, run the following command:

npm install -g racing-data-converter

Usage

Run racing-data-converter --help for a list of options.

Example

racing-data-converter ./input.csv ./output.dlf --output-format protune

This command will convert an input CSV file named input.csv to a Pro Tune's log file named output.dlf.

Application Programming Interface

  1. Create an input stream. This can be a simple passthrough stream such as DataFrameStream or read from a CsvReader, MeteorReader or a JsonReader.
  2. Define the list of channels that you will work with, including information such as the unit of measure.
  3. Create a writer. This can be a CsvWriter, MeteorWriter, ExcelCsvWriter, MslWriter, MlgWriter, MotecCsvWriter, PiToolboxAsciiWriter, ProtuneWriter, RacePakWriter, WinDarabWriter or a JsonWriter.
  4. Create a writer stream from the writer class, receiving the input stream created earlier.
  5. The file is successfully converted!

Install

npm install racing-data-converter

Sample

import { DataFrameStream, ProtuneWriter, SensorChannel } from 'racing-data-converter';
import * as fs from 'node:fs';

// Creates a plain data frame stream. This will be the input
const dataFrameStream = new DataFrameStream();

// Creates a Protune writer with two channels
const writer = new ProtuneWriter({
  channels: [
    {
      key: SensorChannel.GPS_SPEED,
      name: 'Speed',
      unit: 'Km/h',
    },
    {
      key: 'happy-sensor',
      name: 'Happy Sensor',
      unit: 'm',
      decimalPlaces: 2,
    }
  ]
});

// Creates a Protune stream using the data frame stream as the input
const protuneStream = writer.createStream(dataFrameStream);

// Pipes the Protune stream into the output file
protuneStream.pipe(fs.createWriteStream('sample-output.dlf'));

// Writes a few data frames
dataFrameStream.write({
  channel: SensorChannel.GPS_SPEED,
  value: 53,
  timestamp: 10,
});

dataFrameStream.write({
  channel: 'happy-sensor',
  value: 3925,
  timestamp: 15,
});

dataFrameStream.write({
  channel: SensorChannel.GPS_SPEED,
  value: 59,
  timestamp: 20,
});

// Finishes writing
dataFrameStream.end();

There are more samples available.