"""Upload a scanned invoice, get its fields back.""" from fastapi import FastAPI, UploadFile from extractor import extract_invoice app = FastAPI() @app.post("/extract") async def extract(file: UploadFile): return extract_invoice(await file.read(), file.content_type or "application/pdf")