Spaces:
Runtime error
Runtime error
Commit ·
fd7a815
1
Parent(s): 69c4c4c
Update main.py
Browse files
main.py
CHANGED
|
@@ -6,4 +6,38 @@ GITHUB_PAT = os.environ['GITHUB']
|
|
| 6 |
if not os.path.exists('repo_directory'):
|
| 7 |
Repo.clone_from(f'https://tracinginsights:{GITHUB_PAT}@github.com/TracingInsights/fastf1api.git', 'repo_directory' )
|
| 8 |
|
| 9 |
-
from repo_directory import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
if not os.path.exists('repo_directory'):
|
| 7 |
Repo.clone_from(f'https://tracinginsights:{GITHUB_PAT}@github.com/TracingInsights/fastf1api.git', 'repo_directory' )
|
| 8 |
|
| 9 |
+
from repo_directory import *
|
| 10 |
+
|
| 11 |
+
import datetime
|
| 12 |
+
import os
|
| 13 |
+
import streamlit as st
|
| 14 |
+
import numpy as np
|
| 15 |
+
import math
|
| 16 |
+
import fastf1
|
| 17 |
+
import pandas as pd
|
| 18 |
+
from fastapi import FastAPI, Response
|
| 19 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 20 |
+
from fastapi.responses import FileResponse, HTMLResponse
|
| 21 |
+
from pydantic import BaseModel
|
| 22 |
+
|
| 23 |
+
import functools
|
| 24 |
+
import math
|
| 25 |
+
import numpy as np
|
| 26 |
+
import concurrent.futures
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
import available_data
|
| 30 |
+
|
| 31 |
+
app = FastAPI()
|
| 32 |
+
|
| 33 |
+
app.add_middleware(
|
| 34 |
+
CORSMiddleware,
|
| 35 |
+
allow_origins=["*"],
|
| 36 |
+
allow_credentials=True,
|
| 37 |
+
allow_methods=["*"],
|
| 38 |
+
allow_headers=["*"],
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
FASTF1_CACHE_DIR = 'cache' #os.environ['FASTF1_CACHE_DIR']
|
| 42 |
+
|
| 43 |
+
fastf1.Cache.enable_cache(FASTF1_CACHE_DIR)
|