"""use http://127.0.0.1:8000/docs or http://127.0.0.1:8000/redoc for auto documentation of this API
1. A simple frequency plotter (A Quick histogram for the given data)
"""
from typing import Optional
from pydantic import BaseModel
from fastapi import FastAPI
import uvicorn

pi = "3.141592653589793238462643383279502884197169399375105820974944592307816406286 208998628034825342117067982148086513282306647093844609550582231725359408128481 117450284102701938521105559644622948954930381964428810975665933446128475648233 786783165271201909145648566923460348610454326648213393607260249141273724587006 606315588174881520920962829254091715364367892590360011330530548820466521384146 951941511609433057270365759591953092186117381932611793105118548074462379962749 567351885752724891227938183011949129833673362440656643086021394946395224737190 702179860943702770539217176293176752384674818467669405132000568127145263560827"
app = FastAPI()

class Item(BaseModel):
    name: str
    price: float
    is_offer: Optional[bool] = None


@app.get("/")                       
def read_root():
    return {"Hello, go to /inp?q=<Number of digits of pi you wanna see> "}

@app.get("/inp")
def take_input(q:Optional[int]=3):
    return float(pi[:q+2])

if __name__ == '__main__':
     uvicorn.run(app, port=8000, host="0.0.0.0")
    
