Spaces:
Running
Running
Rename test.py to main.py
Browse files- test.py β main.py +10 -0
test.py β main.py
RENAMED
@@ -31,6 +31,16 @@ GOOGLE_REDIRECT_URI = "https://omkar008-receipt-radar-test.hf.space/test"
|
|
31 |
logging.basicConfig(level=logging.DEBUG)
|
32 |
logger = logging.getLogger(__name__)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
@app.get("/")
|
36 |
async def login_google():
|
|
|
31 |
logging.basicConfig(level=logging.DEBUG)
|
32 |
logger = logging.getLogger(__name__)
|
33 |
|
34 |
+
@app.post("/getReceiptData")
|
35 |
+
async def get_gmail_data(request:Request):
|
36 |
+
data = await request.json()
|
37 |
+
access_token = data.get("access_token")
|
38 |
+
user_input = data.get("brand_name")
|
39 |
+
data = GmailDataExtractor(access_token,user_input)
|
40 |
+
print(data.error)
|
41 |
+
print(data.json())
|
42 |
+
return data.error
|
43 |
+
|
44 |
|
45 |
@app.get("/")
|
46 |
async def login_google():
|