# aws-lambda-tesseract-french

> Tesseract 4.1 (with French training data) to fit inside AWS Lambda, forked from shelf.io's work

Latest version **1.0.0** (published 2022-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install aws-lambda-tesseract-french
pnpm add aws-lambda-tesseract-french
yarn add aws-lambda-tesseract-french
bun add aws-lambda-tesseract-french
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-09-15 |
| First published | 2022-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 2 |
| Unpacked size | 4.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Charlie Henin |
| Maintainers | kimchicharlie |
| Keywords | aws, lambda, ocr, tesseract |

## Links

- npm: https://www.npmjs.com/package/aws-lambda-tesseract-french
- Repository: https://github.com/kimchicharlie/aws-lambda-tesseract
- Homepage: https://github.com/kimchicharlie/aws-lambda-tesseract#readme
- Issues: https://github.com/kimchicharlie/aws-lambda-tesseract/issues
- npm.io page: https://npm.io/package/aws-lambda-tesseract-french

## Dependencies (2)

- [tar](https://npm.io/package/tar.md) 6.1.11
- [is-image](https://npm.io/package/is-image.md) 3.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-09-15
- 1.0.0-rc1 (next) — 2022-09-15

## README

# aws-lambda-tesseract [![CircleCI](https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/aws-lambda-tesseract/tree/master) ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![Tesseract](https://img.shields.io/badge/tesserract-6_MB-brightgreen.svg)](bin/)

Tesseract 5.1 (with French training data) to fit inside AWS Lambda

Forked from https://github.com/shelfio/aws-lambda-tesseract, all the credits go to shelf.io, I just compiled Tesseract 5.1 for french language, changed the params passed to the cli and published it !

Inspired by [chrome-aws-lambda](https://github.com/alixaxel/chrome-aws-lambda) & [lambda-scanner-ocr](https://github.com/philippkeller/lambda-scanner-ocr)

## Install

```
$ yarn add aws-lambda-tesseract-french
```

Works for Node 16.x runtime and compiled with **Tesseract 5.1.0**. It works with x86_64 CPUs for now only.

## How does it work?

This package contains an archive with [Tesseract 5.1](https://github.com/tesseract-ocr/tesseract) compiled for usage in AWS Lambda environment.

When a Lambda starts, it unpacks an archive with a binary to the `/tmp` folder and makes sure it's done only once per Lambda cold start.

## Usage

```js
const {getTextFromImage, isSupportedFile} = require('aws-lambda-tesseract-french');

module.exports.handler = async event => {
  // assuming there is a photo.jpg inside /tmp dir
  // original file will be deleted afterwards

  if (!isSupportedFile('/tmp/photo.jpg')) {
    return false;
  }

  return getTextFromImage('/tmp/photo.jpg');
};
```

`isSupportedFile` checks that file has image-like file extension and it's not in the list of
unsupported by Tesseract file extensions.

## Compile It Yourself

See [compile-tesseract.sh](compile-tesseract.sh)

Smoke test that it works by running `test.sh` script

## See Also

- [aws-lambda-libreoffice](https://github.com/shelfio/aws-lambda-libreoffice)
- [chrome-aws-lambda-layer](https://github.com/shelfio/chrome-aws-lambda-layer)
- [ghostscript-lambda-layer](https://github.com/shelfio/ghostscript-lambda-layer)

## Publish

```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```

## License

MIT © [Shelf](https://shelf.io)

---
_Source: https://npm.io/package/aws-lambda-tesseract-french · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
