@prisme.ai/format-collection
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

An utility tool dedicated to updated Prisme.ai Collections directly from a CSV file.

This utility can be used as a CLI or Node module.

Install.

npm i @prisme.ai/format-collection

Use

As a module

import { formatCollection } from "@prisme.ai/format-collection";

const result = await formatCollection("./data.csv", { excludeBom: true });

The first parameter represents the file path of the file you want to format (it can be .json or .csv). The second parameter is an object representing all the flags detailed in the CLI README.

As a CLI

Directly in your favorite terminal :

format-collection "/Users/ulysse/Documents/myData.csv" --save "/Users/ulysse/Documents/transformedData.json" --inputSeparator ";" --excludeBom "true"

For more informations about how to use the CLI.

About configuration.

This package is intended to use your env variables to define which API to call and how to identify. However, as sometimes you cannot change env variables (such as into a javascript function hosted by a third party), we allow you to change the config using setConfig method.

const {
  setConfig,
  formatCollection,
} = require("@prisme.ai/format-collection");

setConfig({
  SESSION_TOKEN: "r:myPrismeaiSessionToken",
  GOOGLE_GEOCODE_API_KEY: "MyGoogleGeocodeAPIKey",
  API_CORE_URL: "https://api.prisme.ai",
  APP_ID: "gogowego-2016",
});

formatCollection(...);

Readme

Keywords

none

Package Sidebar

Install

npm i @prisme.ai/format-collection

Weekly Downloads

2

Version

1.0.5

License

ISC

Unpacked Size

70.5 kB

Total Files

18

Last publish

Collaborators

  • youssef.zamani
  • hadrien.eu
  • aamarcha
  • brokray
  • dulis31
  • florian-prisme-ai