11 lines
276 B
Python
11 lines
276 B
Python
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
|