This project extracts text from an image of a store receipt and converts it into a structured JSON object using OCR and AI.
- Python 3.x
- OpenCV
- Pytesseract
- OpenAI Python client
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install the required packages:
pip install -r requirements.txt
-
Add your OpenAI API key in [main.py]:
ai_client = OpenAI( api_key="YOUR_OPEN_AI_API_KEY" )
-
Add an image of a receipt named
receipt.jpgto the project directory. -
Run the script:
python main.py
-
The extracted JSON data will be saved in
receipt.json.
- main.py: The main script that processes the image, extracts text, and converts it to JSON.
- requirements.txt: The list of required Python packages.
- readme.md: Project documentation.
This project is licensed under the MIT License.
This project was created by Tom Shaw