Giter Site home page Giter Site logo

joedalton24 / amazon-textract-response-tocsv Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 77 KB

**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.

License: MIT License

JavaScript 94.10% Dockerfile 0.94% Shell 4.97%
nodejs csv amazon-textract

amazon-textract-response-tocsv's Introduction

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 โœ”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.