You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.py 475B

123456789101112131415161718
  1. from typing import Annotated, List
  2. from fastapi import FastAPI, Query
  3. from million.model.filter.MessageFilter import MessageFilter
  4. from million.model.message import Message
  5. from million.analyze.filter import filter
  6. import million.parse.fb_exports as fb
  7. DATA_PATH = './data/'
  8. export = fb.parse_dirfiles(DATA_PATH)
  9. app = FastAPI()
  10. @app.get("/messages")
  11. def read_messages(form: Annotated[MessageFilter, Query()]) -> List[Message]:
  12. return filter(export.messages, form)