Spaces:
Runtime error
Runtime error
File size: 922 Bytes
bc0973c 3fefafb bc0973c 3fefafb bc0973c 2d12f2a fd7a815 |
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 32 33 34 35 36 37 38 39 40 41 42 43 44 |
from git import Repo
import os
GITHUB_PAT = os.environ['GITHUB']
if not os.path.exists('repo_directory'):
Repo.clone_from(f'https://tracinginsights:{GITHUB_PAT}@github.com/TracingInsights/fastf1api.git', 'repo_directory' )
from repo_directory import *
import datetime
import os
import streamlit as st
import numpy as np
import math
import fastf1
import pandas as pd
from fastapi import FastAPI, Response
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse, HTMLResponse
from pydantic import BaseModel
import functools
import math
import numpy as np
import concurrent.futures
import available_data
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
FASTF1_CACHE_DIR = 'cache' #os.environ['FASTF1_CACHE_DIR']
fastf1.Cache.enable_cache(FASTF1_CACHE_DIR)
|