Static data functions

Energy Balance

Get the energy balance of the federal states for a given year. The data is taken from a csv-file that is manually downloaded from the LAK page.

As an automatic download does not work you may have to download the file to get the latest updates. Just rename the downloaded file to energy_balance_federal_states.csv and replace the existing file in the data/static/ directory of the reegis package. Alternatively you can download the file and adapt the path in the config file (energy_balance: energy_balance_states) or use the config module to set a ne path.

Usage with file in the default directory:

from reegis import energy_balance as eb

states=['BB', 'NW']
fuel='lignite (raw)'

print(my_eb.loc[(states, row), fuel])

Usage with alternative file:

from reegis import energy_balance as eb, config as cfg

states=['BB', 'NW']
fuel='lignite (raw)'

cfg.tmp_set('energy_balance', 'energy_balance_states', fn)
print(my_eb.loc[(states, row), fuel])

If no year is passed to the function the whole table will be returned. This can be used to show changes over the time.

from matplotlib import pyplot as plt
from reegis import energy_balance as eb

fuel='lignite (raw)'
ax=plt.figure(figsize=(9, 5)).add_subplot(1, 1, 1)

my_eb.loc[(slice(None), slice(None), 'extraction'), fuel].groupby(
plt.title("Extraction of raw lignite in Germany")
plt.ylabel('energy [TJ]')

The full code of the plot can be found here fig_energy_balance_lignite_extraction().

The reason for the drop for the last year is not that extraction of raw extraction ended but that the data set for 2016 is not complete yet. So be careful with most recent data sets and check them before use.

If you frequently work with energy balances please contact the author and give your feedback or help to improve and maintain the API.

For the full API see energy_balance .

Energy data from the energy ministry (BMWi)

The ministry of energy BMWI provides an excel sheet which is not optimised for automatic data processing. Nevertheless, it is possible to get some basic data from there. Be careful with updates, because the structure of the sheets may vary in the future.

Annual electricity demand

Fetch the annual electricity demand from 1991 on. In the following code example it is used to create a time series.

ax=plt.figure(figsize=(9, 4)).add_subplot(1, 1, 1)
for year in range(1991, 2016):

The full code of the plot can be found here fig_energy_demand_germany_bmwi().

Capacity of renewable energy plants

The example shows the capacity of hydro energy plants in Germany in 2016.

print(re.loc[2016, ('water', 'capacity')])

If you frequently work with BMWi data please contact the author and give your feedback or help to improve and maintain the API.

For the full API see bmwi .

Demand profile from ENTSO-E

The electricity profile is taken from ENTSO-E time series provided by OPSD demand time series.


For the full API see entsoe .