52 lines
1.6 KiB
Python
52 lines
1.6 KiB
Python
import asyncio
|
|
import datetime
|
|
import sys
|
|
|
|
import pandas as pd
|
|
from db_calls import db_post
|
|
|
|
|
|
async def main(args):
|
|
start_time = datetime.datetime.now()
|
|
print(f'Running basic batting...')
|
|
b_basic = await db_post(
|
|
'battingcardratings/calculate/basic'
|
|
)
|
|
if b_basic is not None:
|
|
p_run_time = datetime.datetime.now() - start_time
|
|
print(f'Finished basic batting in {round(p_run_time.total_seconds())} seconds')
|
|
|
|
start_time1 = datetime.datetime.now()
|
|
print(f'Running full batting...')
|
|
b_full = await db_post(
|
|
'battingcardratings/calculate/scouting'
|
|
)
|
|
if b_full is not None:
|
|
p_run_time = datetime.datetime.now() - start_time1
|
|
print(f'Finished complete batting in {round(p_run_time.total_seconds())} seconds')
|
|
|
|
start_time2 = datetime.datetime.now()
|
|
print(f'Running basic pitching...')
|
|
p_basic = await db_post(
|
|
'pitchingcardratings/calculate/basic'
|
|
)
|
|
if p_basic is not None:
|
|
p_run_time = datetime.datetime.now() - start_time2
|
|
print(f'Finished basic pitching in {round(p_run_time.total_seconds())} seconds')
|
|
|
|
start_time3 = datetime.datetime.now()
|
|
print(f'Running full batting...')
|
|
p_full = await db_post(
|
|
'pitchingcardratings/calculate/scouting'
|
|
)
|
|
if p_full is not None:
|
|
p_run_time = datetime.datetime.now() - start_time3
|
|
print(f'Finished complete pitching in {round(p_run_time.total_seconds())} seconds')
|
|
|
|
full_run_time = datetime.datetime.now() - start_time
|
|
print(f'Full run took {round(full_run_time.total_seconds())} seconds')
|
|
|
|
|
|
if __name__ == '__main__':
|
|
asyncio.run(main(sys.argv[1:]))
|