https://github.com/secretshardul/tesseroid-functions
https://github.com/secretshardul/tesseroid-functions
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/secretshardul/tesseroid-functions
- Owner: secretshardul
- License: apache-2.0
- Created: 2019-11-10T12:42:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T14:39:12.000Z (over 3 years ago)
- Last Synced: 2025-12-12T22:42:27.008Z (7 months ago)
- Language: Python
- Size: 278 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# POST request example
```sh
curl -X POST https://4a4tavwbnd.execute-api.us-east-1.amazonaws.com/dev/ocr -d "https://i.imgur.com/zGRdhAT.jpg"
curl -X POST https://4a4tavwbnd.execute-api.us-east-1.amazonaws.com/dev/ocr -d "https://i.etsystatic.com/16235847/r/il/b1e59b/2011957531/il_570xN.2011957531_p39l.jpg"
# webp- works
curl -X POST https://4a4tavwbnd.execute-api.us-east-1.amazonaws.com/dev/ocr -d "https://www.online-convert.com/downloadfile/e1faa392-54fc-4aa3-96e8-764b872f6c5f/180d9d302f6308358ec8b8faaed7e74e"
# tiff - works
curl -X POST https://4a4tavwbnd.execute-api.us-east-1.amazonaws.com/dev/ocr -d "https://www.online-convert.com/downloadfile/eefcbca6-e32f-4746-b48c-b79eab426c2d/5e98fef3ab27e890f09bb70257584ec0"
# gif- works
curl -X POST https://4a4tavwbnd.execute-api.us-east-1.amazonaws.com/dev/ocr -d "https://media3.giphy.com/media/D0Uhua2Z1PC8w/source.gif"
# hebrew post
curl -X POST https://4a4tavwbnd.execute-api.us-east-1.amazonaws.com/dev/ocr -d "https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQdUtag90lRt2LVqV0MCHiO-w-FCbEpkjSOrOaNB6_3wVvr1kj0"
```
# API architecture for POST
1. parameters: config,extension
2. Use form-data instead of x-www-form because it supports files also.
3. pytesseract directly accepts image files, not URLs. But tesseract command line takes url path
# serverless plugins
```sh
sls plugin install -n serverless-python-requirements
sls plugin install -n serverless-pseudo-parameters
# uninstall
serverless plugin uninstall --n serverless-python-requirements
```
# shenanigans
1. don't upgrade python runtime to 3.7, it's causing PIL error- fixed with pipenv
2.