Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

This package provide system level forecast for Spain ISO

Project description

This package allows you to create System Level Forecast and Actual Load for Spain ISO

It automatically creates all the required tables in the database. This class constructor takes following parameters:

start_date: The start date and time for the API. Example '2019-09-26'

end_date: The end date and time for the API (Inclusive). Example '2019-09-27'

log: The Logging class object

config: The Config class object. Before passing this object make sure all the database

credentials are already setup using config class object.

csv_dir: The directory path where the raw data files will be stored

database_system: The database system to be used (e.g MySql). The value must be from Config class
supported values are
Config.MYSQL   
Config.POSTGRESQL

Default value is Config.MYSQL

To execute the system you can call execute method of the same class.

EXAMPLE

import logging
import os
from datetime import datetime, timedelta

from SpainISOGetDataSystemLevelForecastActualData import SpainISOSystemLevelForecast
from utilsInnowatts import Config, Logging

log = Logging(print_on_console=True, level=logging.INFO)
config = Config()
config.setup_mysql_configuration(host=os.environ['MYSQL_HOST'],
                                 port=os.environ['MYSQL_PORT'],
                                 user=os.environ['MYSQL_USER'],
                                 password=os.environ['MYSQL_PASSWORD'],
                                 database=os.environ['MYSQL_DATABASE'],
                                 )
# Un comment below line if you want to write to mysql on local docker mysql image
# config.setup_mysql_configuration("mysql-db", 3306, "root", "data_lake", "password")

# config.setup_postgresql_configuration(host=os.environ['POSTGRESQL_HOST'],
#                                       port=os.environ['POSTGRESQL_PORT'],
#                                       user=os.environ['POSTGRESQL_USER'],
#                                       password=os.environ['POSTGRESQL_PASSWORD'],
#                                       database=os.environ['POSTGRESQL_DATABASE'],
#                                       )
#

csv_dir = "csv_spain_iso"
end_date = datetime.now()
start_date = end_date - timedelta(days=1)
format_string = "%Y-%m-%d"
spiso = SpainISOSystemLevelForecast(start_date=start_date.strftime(format_string),
                                   end_date=end_date.strftime(format_string), 
                                   log=log, config=config, csvdir=csv_dir,
                                   database_system=Config.MYSQL)
spiso.execute()

Project details


Release history Release notifications

This version

1.0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for SpainISOGetDataSystemLevelForecastActualData, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size SpainISOGetDataSystemLevelForecastActualData-1.0.3.tar.gz (5.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page