Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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)