{"id":13593361,"url":"https://github.com/bhimrazy/receipt-ocr","last_synced_at":"2025-04-09T21:15:00.300Z","repository":{"id":210162903,"uuid":"725886413","full_name":"bhimrazy/receipt-ocr","owner":"bhimrazy","description":"Efficient OCR engine for receipt image processing using Python, FastAPI, and Tesseract","archived":false,"fork":false,"pushed_at":"2024-12-04T08:55:15.000Z","size":23870,"stargazers_count":76,"open_issues_count":0,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T21:14:49.193Z","etag":null,"topics":["invoice-ocr","invoice-ocr-python","ocr","ocr-engine","pytesseract","python-ocr","tesseract-ocr"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhimrazy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-01T04:28:14.000Z","updated_at":"2025-04-07T01:17:03.000Z","dependencies_parsed_at":"2024-09-14T23:29:27.133Z","dependency_job_id":"0d37b365-1ffa-45be-8b1e-f3cb67a44c2d","html_url":"https://github.com/bhimrazy/receipt-ocr","commit_stats":null,"previous_names":["bhimrazy/receipt-ocr"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Freceipt-ocr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Freceipt-ocr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Freceipt-ocr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhimrazy%2Freceipt-ocr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhimrazy","download_url":"https://codeload.github.com/bhimrazy/receipt-ocr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111971,"owners_count":21049578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["invoice-ocr","invoice-ocr-python","ocr","ocr-engine","pytesseract","python-ocr","tesseract-ocr"],"created_at":"2024-08-01T16:01:19.626Z","updated_at":"2025-04-09T21:15:00.261Z","avatar_url":"https://github.com/bhimrazy.png","language":"Python","readme":"# Receipt OCR Engine\n\nThis repository hosts a script and a Docker-compose setup for performing Optical Character Recognition (OCR) on receipt images.\n\n![image](https://github.com/bhimrazy/receipt-ocr/assets/46085301/305df68d-50d8-41d4-81d0-9324966fb6c9)\n\n## Star History\n\n\u003ca href=\"https://star-history.com/#bhimrazy/receipt-ocr\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=bhimrazy/receipt-ocr\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=bhimrazy/receipt-ocr\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=bhimrazy/receipt-ocr\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n\n## Prerequisites\n\n- Python 3.x\n- Docker\n- Docker-compose\n\n## Installation\n\n### Clone the repository\n\n```bash\ngit clone https://github.com/bhimrazy/receipt-ocr.git\ncd receipt-ocr\n```\n\n### Set up Python environment (if not using Docker)\n- Install [tesseract](https://tesseract-ocr.github.io/tessdoc/Installation.html)\n\n```bash\n# Create and activate a virtual environment (optional but recommended)\npython -m venv venv\nsource venv/bin/activate  # For Windows, use venv\\Scripts\\activate\n\n# Install dependencies\npip install -r requirements.txt\n```\n\n## Usage\n\n### Running the script locally\n\n#### `main.py`\n\nThe `main.py` script performs OCR on an input image of a receipt.\n\n```bash\npython main.py -i images/receipt.jpg\n```\n\nReplace `images/receipt.jpg` with the path to your receipt image.\n\u003ePlease ensure that the image is well-lit and that the edges of the receipt are clearly visible and detectable within the image.\n\u003cimg src=\"https://github.com/bhimrazy/receipt-ocr/assets/46085301/2ea009f0-9e15-42b2-9f15-063a8ec169f1\" alt=\"Receipt Image\" width=\"300\" height=\"400\"\u003e\n\n\n### Using Docker-compose\n\nThe repository includes a Docker-compose setup for running the OCR engine as a service.\n\n```bash\ndocker-compose up\n```\n\nOnce the service is up and running, you can perform OCR on receipt images by sending a POST request to `http://localhost:8000/ocr/` with the image file.\n\n## API Endpoint\n\nThe OCR functionality can be accessed via a FastAPI endpoint:\n\n- **POST** `/ocr/`: Upload a receipt image file to perform OCR. The response will contain the extracted text from the receipt.\n\nExample usage with cURL:\n\n```bash\ncurl -X 'POST' \\\n  'http://localhost:8000/ocr/' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: multipart/form-data' \\\n  -F 'file=@images/paper-cash-sell-receipt-vector-23876532.jpg;type=image/jpeg'\n```\n\n## Using Gemini\n- Gemini Docs:https://ai.google.dev/tutorials/python_quickstart\n- LinkedIn Post: https://www.linkedin.com/feed/update/urn:li:activity:7145860319150505984/\n  \n![image](https://github.com/bhimrazy/receipt-ocr/assets/46085301/ee4a0c82-f134-4a19-a275-93a59c7503b8)\n\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n\n## References\n- [Automatically OCR’ing Receipts and Scans](https://pyimagesearch.com/2021/10/27/automatically-ocring-receipts-and-scans/)\n\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhimrazy%2Freceipt-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhimrazy%2Freceipt-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhimrazy%2Freceipt-ocr/lists"}