Add lambda function to write json to dynamo db

This commit is contained in:
2024-02-28 19:16:40 +01:00
parent c9118f96db
commit bf2e2a295a
12 changed files with 215 additions and 7 deletions

10
main.py
View File

@@ -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))