Skip to content

amazon-trp 4.0.0

Install from the command line:
Learn more about npm packages
$ npm install @scribelabsai/amazon-trp@4.0.0
Install via package.json:
"@scribelabsai/amazon-trp": "4.0.0"

About this version

amazon-trp-node

Amazon Textract Response Parser library for TS.


This is a TS port of the Python TRP script from AWS.

Installation

npm install @scribelabsai/amazon-trp

Usage

  1. Load the blocks into a document (e.g. using GetDocumentAnalysisCommand from @aws-sdk/client-textract)
import { TextractClient, GetDocumentAnalysisCommand } from '@aws-sdk/client-textract';
import { Document } from '@scribelabsai/amazon-trp';

import type { BlockStruct } from '@scribelabsai/amazon-trp';

const client = new TextractClient();
const resp = await client.send(new GetDocumentAnalysisCommand({ JobId: 'MY_JOBID }));
const doc = new Document(resp.blocks as BlockStruct[]);
  1. Do something with the document (e.g. getting tables)
doc.pages.forEach((p) => {
  p.tables.forEach((t) => {
    // Do something with the table
  });
});

License

MIT, see LICENSE file.

Details


Assets

  • amazon-trp-4.0.0.tgz

Download activity

  • Total downloads 1,684
  • Last 30 days 0
  • Last week 0
  • Today 0