Spaces:
Sleeping
Sleeping
main.py
CHANGED
|
@@ -1,8 +1,29 @@
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
| 5 |
|
| 6 |
@app.get("/")
|
| 7 |
def read_root():
|
| 8 |
-
return {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
+
import matplotlib.pyplot as plt
|
| 5 |
+
import seaborn as sns
|
| 6 |
+
import yfinance as yf
|
| 7 |
+
import datetime as dt
|
| 8 |
+
import xgboost as xgb
|
| 9 |
+
from sklearn.metrics import mean_squared_error
|
| 10 |
+
|
| 11 |
+
color_pal = sns.color_palette()
|
| 12 |
+
plt.style.use("fivethirtyeight")
|
| 13 |
|
| 14 |
app = FastAPI()
|
| 15 |
|
| 16 |
|
| 17 |
@app.get("/")
|
| 18 |
def read_root():
|
| 19 |
+
return {
|
| 20 |
+
"message": "Hello, Please type a ticker at the end of the URL to get LAST TRADING HOUR FORCAST.",
|
| 21 |
+
"format": "https://yaakovy-LastHourforcast.hf.space/ticker/[TICKER]",
|
| 22 |
+
"example": "https://yaakovy-LastHourforcast.hf.space/ticker/msft",
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@app.get("/ticker/{ticker}")
|
| 27 |
+
def read_item(ticker: str):
|
| 28 |
+
|
| 29 |
+
return ticker
|