open-index/open-npm huggingface dataset:
npm package: @polarisoffice_ai/polaris-ai-datainsight
Description: TypeScript SDK for Polaris AI DataInsight - Converts documents in various formats into structured JSON data
Author: Polaris Office
Latest version: 0.1.3

# ![logo](https://raw.githubusercontent.com/PolarisOffice/PolarisAIDataInsight/main/assets/logo/polarisoffice-logo-small.svg) polaris-ai-datainsight

This package is TypeScript SDK for Polaris AI DataInsight.

Converts documents in various formats—including Word, HWP, Sheets, and Slides—into structured JSON data.

## Installation and Setup

You need to install a npm package:

```bash
npm install polaris-ai-datainsight
```

And you should configure credentials by setting the following environment variables:

```bash
export POLARIS_AI_DATA_INSIGHT_API_KEY="your-api-key"
```

Refer to [here](https://datainsight.polarisoffice.com/documentation/quickstart) how to get an Polaris AI DataInsight API key.


## Document Extractor

Set the file path to extract and the directory path to store resource files included in the file:

```typescript
import { PolarisAIDataInsightExtractor } from 'polaris-ai-datainsight';

const extractor = new PolarisAIDataInsightExtractor({
    filePath: "path/to/file",
    resourcesDir: "path/to/dir"
});
```

Extract document data:

```typescript
const dictData = await extractor.extract();
```


## Document Loaders

```typescript
import { PolarisAIDataInsightLoader } from 'polaris-ai-datainsight';

const loader = new PolarisAIDataInsightLoader({
    filePath: "path/to/file",
    resourcesDir: "path/to/dir"
});
```

Load documents:

```typescript
const docs = await loader.load();
```