Beispiel #1
0
def query_entsoe_load(start, end):
    client = EntsoePandasClient(api_key=os.environ['ENTSOE_TOKEN'])
    data = client.query_load("ES",
                             start=pd.Timestamp(start, tz='UTC'),
                             end=pd.Timestamp(end, tz='UTC'))

    return data
    def query_entsoe_load(start, end):

        client = EntsoePandasClient(
            api_key='909addb7-e4ae-4702-acc7-6b4f4fd9667b')
        data = client.query_load("ES",
                                 start=pd.Timestamp(start, tz='UTC'),
                                 end=pd.Timestamp(end, tz='UTC'))

        return data
Beispiel #3
0
    def get_entsoe_data(key, country='ES', date=None, period=None):

        start, end = get_date_range()

        client = EntsoePandasClient(api_key=key)

        data = client.query_load(country, start=start, end=end)

        return data
# =============================================================================
# Get Data from Entso-E
# API Wrapper: https://github.com/EnergieID/entsoe-py
# =============================================================================

#"""
key = str(np.genfromtxt('entsoe.txt', dtype='str'))
client = EntsoePandasClient(api_key=key)

# Time Series

# NoMatchingDataError
# ts_day_ahead = client.query_day_ahead_prices(country_code, start=start,end=end)

ts_load = client.query_load(country_code, start=start, end=end)
ts_load.to_csv('data_base/ts_load.csv')

ts_load_forecast = client.query_load_forecast(country_code,
                                              start=start,
                                              end=end)
ts_load_forecast.to_csv('data_base/ts_load_forecast.csv')

ts_generation_forecast = client.query_generation_forecast(country_code,
                                                          start=start,
                                                          end=end)
ts_generation_forecast.to_csv('data_base/ts_generation_forecast.csv')

# Dataframes

df_wind_and_solar_forecast = client.query_wind_and_solar_forecast(
Beispiel #5
0
start, end = pd.Timestamp('20190101', tz='Europe/Brussels'), pd.Timestamp(
    '20190501', tz='Europe/Brussels')
start2, end2 = pd.Timestamp('20200101', tz='Europe/Brussels'), pd.Timestamp(
    '20200501', tz='Europe/Brussels')

for country_code in [
        'DE-LU', 'BE', 'DK', 'AT', 'BG', 'CH', 'CZ', 'EE', 'ES', 'FI', 'FR',
        'GB', 'GR', 'HR', 'HU', 'IE', 'IT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE'
]:

    try:

        #download load data
        pd.concat([
            client.query_load(country_code, start=start, end=end),
            client.query_load(country_code, start=start2, end=end2)
        ]).to_csv('./data/load_' + country_code + '.csv')
        #download generation data
        pd.concat([
            client.query_generation(country_code,
                                    start=start,
                                    end=end,
                                    psr_type=None),
            client.query_generation(country_code,
                                    start=start2,
                                    end=end2,
                                    psr_type=None)
        ]).to_csv('./data/gen' + country_code + '.csv')

    except:
Beispiel #6
0
from entsoe import EntsoePandasClient
import sqlite3
import pandas as pd
from datetime import date, timedelta
import time

end_date = date.today() + timedelta(days=1)
current_date = end_date.strftime("%Y%m%d")

client = EntsoePandasClient(api_key='444fc771-5d0f-499f-9328-90c05c459219')

start = pd.Timestamp('20201109', tz='Europe/Brussels')
end = pd.Timestamp(current_date, tz='Europe/Brussels')
country_code = 'DE'

generation = client.query_load(country_code, start=start, end=end)

generation1.to_csv('outfile1.csv')
print(generation1)

start = pd.Timestamp('20201109', tz='Europe/Brussels')
end_date = date.today() + timedelta(days=2)
current_date = end_date.strftime("%Y%m%d")
end = pd.Timestamp(current_date, tz='Europe/Brussels')
country_code = 'DE'

generation2 = client.query_load_forecast(country_code, start=start, end=end)
generation2.to_csv('outfile2.csv')
print(generation2)