Add main.py
This commit is contained in:
10
main.py
Normal file
10
main.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from fastapi import FastAPI, UploadFile
|
||||||
|
from extract import extract_weight_report
|
||||||
|
|
||||||
|
app = FastAPI()
|
||||||
|
|
||||||
|
@app.post("/extract")
|
||||||
|
async def extract(file: UploadFile, lab: str):
|
||||||
|
text = (await file.read()).decode("utf-8")
|
||||||
|
data = extract_weight_report(text, lab)
|
||||||
|
return data
|
||||||
Reference in New Issue
Block a user