Add lambda function to write json to dynamo db
This commit is contained in:
10
main.py
10
main.py
@@ -1,15 +1,19 @@
|
||||
import src.wheaterAPI as wapi
|
||||
import time
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
wheather_api_current = wapi.WheatherAPI()
|
||||
wheater_api_forecast = wapi.WheatherAPI()
|
||||
max_forecast = 3
|
||||
last_datetime = datetime.now().strftime('%Y-%m-%d-%H')
|
||||
bucket_name = 'bucket weather_data_2024'
|
||||
folder_current = 'current_test'
|
||||
folder_forecast = 'forecast_test'
|
||||
wheather_api_current = wapi.WheatherAPI(bucket_name, folder_current)
|
||||
wheater_api_forecast = wapi.WheatherAPI(bucket_name, folder_forecast)
|
||||
last_datetime = (datetime.now() + timedelta(hours=-1)).strftime('%Y-%m-%d-%H')
|
||||
next_run = datetime.today().strftime('%Y-%m-%d')
|
||||
hour_of_forecast_run = datetime.now().strftime('%H')
|
||||
logging.info('The max_forecast variable has the value: ' + str(max_forecast))
|
||||
|
||||
Reference in New Issue
Block a user