Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erikboesen/ocrspace
A Python API wrapper for the ocr.space Optical Character Recognition API.
https://github.com/erikboesen/ocrspace
Last synced: 7 days ago
JSON representation
A Python API wrapper for the ocr.space Optical Character Recognition API.
- Host: GitHub
- URL: https://github.com/erikboesen/ocrspace
- Owner: ErikBoesen
- License: mit
- Created: 2017-07-02T12:16:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-21T21:47:05.000Z (over 2 years ago)
- Last Synced: 2024-10-29T16:20:12.420Z (10 days ago)
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 63
- Watchers: 6
- Forks: 22
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `ocrspace`
> A Python wrapper for using the [ocr.space API](https://ocr.space/ocrapi).
## Installation
Simply install from `pip`:
```sh
pip install ocrspace
```## Use
First you'll need to import and instantiate the API wrapper:
```py
import ocrspace
api = ocrspace.API()
# Or if you have a custom API host, API key or desired language, pass those:
api = ocrspace.API(endpoint='https://example.host', api_key='Insert key here', language=ocrspace.Language.Croatian)
```
To perform recognition on an image hosted at some URL:
```py
api.ocr_url('URL of image goes here')
```
Or, if you have an image locally upon which to perform recognition:
```py
api.ocr_file('image.jpg')
# or:
api.ocr_file(open('image.jpg', 'rb')) # or any other file pointer
```
That's it! Look at [`example.py`](example.py) for a demonstration.## Authorship
This package was created by [Ali Najafi](https://github.com/a4fr) and is maintained by [Erik Boesen](https://github.com/ErikBoesen).## License
[MIT](LICENSE)