File size: 975 Bytes
9e13c5c
 
 
 
 
 
 
 
 
 
 
 
6683b47
9e13c5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
db3355a
9e13c5c
 
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
from fastapi import FastAPI
from src.api_toolkit.api_fetch.latest_version_fetch import get_py_latest_version
from src.api_toolkit.api_fetch.news_and_blogs_fetch import get_py_news_and_blogs
from src.api_toolkit.api_fetch.jobs_fetch import get_py_jobs
from src.api_toolkit.api_fetch.feedback_fetch import FeedBackdata, feedback

app = FastAPI(title="Python.org API Toolkit")

@app.get("/")
def home():
    return {
        "Message": "Welcome to the Python.org API Toolkit",
        "Endpoints": ["/py_latest_version", "/py_news_and_blogs", "/py_jobs", "/feedback"],
        "Docs": "/docs"
    }

@app.get("/py_latest_version")
def read_py_latest_version():
    return get_py_latest_version()

@app.get("/py_news_and_blogs")
def read_py_news_and_blogs():
    return get_py_news_and_blogs()

@app.get("/py_jobs")
def read_py_jobs():
    return get_py_jobs()

@app.post("/feedback")
def send_feedback(data: FeedBackdata):
    return feedback(data)