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

@lume-ai/typescript-sdk

v4.0.7

Published

Lume SDK for Typescript to automate data mappings with AI. Learn more at docs.lume.ai

Downloads

1,150

Readme

Status

The Lume Typescript SDK is currently in beta. Please reach out to support if you have any questions, encounter any bugs, or have any feature requests.

Installation

npm install @lume-ai/typescript-sdk
yarn add @lume-ai/typescript-sdk
pnpm add @lume-ai/typescript-sdk

Quickstart

Retrieve your input data and target schema.

const targetSchema = {
    type: "object",
    properties: {
        first_name: {
            type: "string",
            description: "The first name of the user",
        },
        last_name: {
            type: "string",
            description: "The last name of the user",
        },
    },
    required: ["first_name", "last_name"],
}

const sourceData = [
    { first_name: "John", last_name: "Doe", nickname: "JDoe" },
    { first_name: "Jane", last_name: "Smith", nickname: "JSmith" }
]

Create a new pipeline and map data.

import { Lume } from '@lume-ai/typescript-sdk';

const lume: Lume = new Lume('api_key');

// create a new pipeline
const pipeline = await lume.PipelineService.createPipeline({
    name: 'user_normalization',
    description: 'Mapping from API user data to internal schema.',
    target_schema: targetSchema,
    sample_data: sourceData,
});

// get the first run
const run = await pipeline.getRun(0, ['mappings']);

// get the mappings
const mappings: Mapping[] = run.mappings.items;

Edit a mapper


// create a new mapper version with edits
const mapper = await pipeline.createMapper({
    field_edits: [{
        field_name: 'first_name',
        transformation: {
            extract: 'nickname',
        },
    }],
    sample_data: sourceData,
});

// get the first run by a mapper version
const run = await pipeline.getRun(0, ['mappings'], mapper.version);

const mappings: Mapping[] = run.mappings.items;  // Mappings can be inspected to verify edits are correct.

// apply the new edits
await pipeline.update({
    mapper_version: mapper.id,
})

Documentation

See the full documentation.

Issues / Questions

Please reach out to support if you encounter any bugs, have any questions, or have any feature requests.