diff --git a/.gitignore b/.gitignore index 5ceb386..3a28a0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ venv +api_key diff --git a/data.py b/data.py new file mode 100755 index 0000000..206e8bc --- /dev/null +++ b/data.py @@ -0,0 +1,20 @@ +from PIL import Image +from openai import OpenAI +import pytesseract as OCR +import os + +OCR.pytesseract.tesseract_cmd = r"/usr/local/bin/tesseract" + +client = OpenAI( + api_key = os.environ.get("OPENAI_API_KEY"), +) + +def app(): + # data shit --> where does it come from??? + data = OCR.image_to_string("input.png") + + print(data) + +""" +UNFINISHED +""" diff --git a/main.py b/main.py index f55d06d..8dc2e3a 100755 --- a/main.py +++ b/main.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 import sqlite3 from flask import Flask, request, jsonify +from flask import render_template +import data app = Flask(__name__) diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..356c1c1 --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +export OPENAI_API_KEY="$(cat api_key)" + +python3 main.py