-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwiki.py
More file actions
47 lines (29 loc) · 793 Bytes
/
wiki.py
File metadata and controls
47 lines (29 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from fastapi import FastAPI
from Class import N, FIO, Fio
add = FastAPI()
@add.get("/summ/{number}")
def summ(number: int):
return N(num=number)
# path
@add.get("/summa/")
def summa(name: str, surname: str):
return Fio(F=name, S=surname)
# query
@add.post("/class", response_model=Fio)
def clas(fio: FIO):
return Fio(F=fio.name, S=fio.surname)
# post
# @add.get("/{search}")
# def src(search : str):
# return wikipedia.summary(search, sentences=7)
# @add.get("/next/{search}")
# def low_sentence_summary(search:str,number:int):
# return wikipedia.summary(search, sentences=number)
#
# class wikiinput(BaseModel):
# sear : str
# snt : int
#
# @add.post("/class")
# def rep(src: wikiinput):
# return(wikipedia.search(src.sear, results=src.snt))