add data prototype for testing; start.sh for launching things

This commit is contained in:
Agnosto Dvonik 2024-02-24 11:46:12 -05:00
parent 9ff0eac50e
commit d51bb4a562
4 changed files with 28 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
venv
api_key

20
data.py Executable file
View File

@ -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
"""

View File

@ -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__)

5
start.sh Normal file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
export OPENAI_API_KEY="$(cat api_key)"
python3 main.py