Socket
Socket
Sign inDemoInstall

amazon-textract-response-tocsv

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    amazon-textract-response-tocsv

This library loads Amazon Textract API response JSONs into csv with helper methods, for easier post-processing.


Version published
Weekly downloads
26
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Amazon Textract Response to CSV 🧩

Amazon Textract Response to CSV export tables and extract key-value pairs in form documents from JSON returned by Amazon Textract into a comma-separated values (CSV) file. This module work both with ESM and CommonJs

Made-In-Senegal

Export tables from JSON returned by Amazon Textract ✅

import { writeTables } from "amazon-textract-response-tocsv";

const analyze_document_text = async () => {
  try {
    const analyzeDoc = new AnalyzeDocumentCommand(params);
    const response = await textractClient.send(analyzeDoc);

    //call writeTables with the response
    await writeTables(response);
  } catch (err) {
    console.log("Error", err);
  }
};

How to use writeTables ✅

The writeTables function of Amazon Textract Response to CSV take one parameters the JSON returned by Amazon Textract.
And then exports data in an file named : tables_output.csv

import with esm

import { writeTables, writeKeyValuePair } from "amazon-textract-response-tocsv";

await writeTables(response);

import with commonjs

const {
  writeTables,
  writeKeyValuePair,
} = require("amazon-textract-response-tocsv");

await writeTables(response);

Export key-value pairs from JSON returned by Amazon Textract ✅

import { writeKeyValuePair } from "amazon-textract-response-tocsv";

const analyze_document_text = async () => {
  try {
    const analyzeDoc = new AnalyzeDocumentCommand(params);
    const response = await textractClient.send(analyzeDoc);

    //call writeKeyValuePair with the response
    await writeKeyValuePair(response);
  } catch (err) {
    console.log("Error", err);
  }
};

How to use writeKeyValuePair ✅

The writeKeyValuePair function just like the writeTables function of Amazon Textract Response to CSV takes one parameters the JSON returned by Amazon Textract.
The only difference is that the exported file will be named : key_value_output.csv

await writeKeyValuePair(response);

License 🎫

This project is released under the MIT License

Keywords

FAQs

Last updated on 01 Mar 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc