from typing import Annotated, List from fastapi import FastAPI, Query from million.model.filter.MessageFilter import MessageFilter from million.model.message import Message from million.analyze.filter import filter import million.parse.fb_exports as fb DATA_PATH = './data/' export = fb.parse_dirfiles(DATA_PATH) app = FastAPI() @app.get("/messages") def read_messages(form: Annotated[MessageFilter, Query()]) -> List[Message]: return filter(export.messages, form)