YaakovY commited on
Commit
4b8c03a
·
1 Parent(s): 43e3378
Files changed (1) hide show
  1. main.py +3 -4
main.py CHANGED
@@ -25,7 +25,7 @@ app = FastAPI()
25
  @app.get("/")
26
  def read_root():
27
  return {
28
- "message": "Hello1, Please type a ticker at the end of the URL to get the stock sentiment.",
29
  "format": "https://yaakovy-fin-proj-docker.hf.space/ticker/[TICKER]",
30
  "example": "https://yaakovy-fin-proj-docker.hf.space/ticker/msft",
31
  }
@@ -122,6 +122,5 @@ def get_stock_data(ticker):
122
  @app.get("/ticker/{ticker}")
123
  def read_item(ticker: str):
124
  stock_data = get_stock_data(ticker)
125
- return stock_data
126
- # result = stock_data.to_json(orient="records")
127
- # return result
 
25
  @app.get("/")
26
  def read_root():
27
  return {
28
+ "message": "Hello, Please type a ticker at the end of the URL to get the stock sentiment.",
29
  "format": "https://yaakovy-fin-proj-docker.hf.space/ticker/[TICKER]",
30
  "example": "https://yaakovy-fin-proj-docker.hf.space/ticker/msft",
31
  }
 
122
  @app.get("/ticker/{ticker}")
123
  def read_item(ticker: str):
124
  stock_data = get_stock_data(ticker)
125
+ result = stock_data.to_json(orient="records")
126
+ return result