Skip to content

Latest commit

 

History

History
126 lines (89 loc) · 5.23 KB

README.md

File metadata and controls

126 lines (89 loc) · 5.23 KB

smard

Bundesnetzagentur Strommarktdaten

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >= 3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/bundesAPI/deutschland.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/bundesAPI/deutschland.git)

Then import the package:

from deutschland import smard

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

from deutschland import smard

Getting Started

Please follow the installation procedure and then run the following:

import time
from deutschland import smard
from pprint import pprint
from deutschland.smard.api import default_api
from deutschland.smard.model.indices import Indices
from deutschland.smard.model.time_series import TimeSeries
# Defining the host is optional and defaults to https://www.smard.de/app/chart_data
# See configuration.py for a list of all supported configuration parameters.
configuration = smard.Configuration(
    host = "https://www.smard.de/app/chart_data"
)



# Enter a context with an instance of the API client
with smard.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = default_api.DefaultApi(api_client)
    filter = 1223 # int | Mögliche Filter:   * `1223` - Stromerzeugung: Braunkohle   * `1224` - Stromerzeugung: Kernenergie   * `1225` - Stromerzeugung: Wind Offshore   * `1226` - Stromerzeugung: Wasserkraft   * `1227` - Stromerzeugung: Sonstige Konventionelle   * `1228` - Stromerzeugung: Sonstige Erneuerbare   * `4066` - Stromerzeugung: Biomasse   * `4067` - Stromerzeugung: Wind Onshore   * `4068` - Stromerzeugung: Photovoltaik   * `4069` - Stromerzeugung: Steinkohle   * `4070` - Stromerzeugung: Pumpspeicher   * `4071` - Stromerzeugung: Erdgas   * `410` - Stromverbrauch: Gesamt (Netzlast)   * `4359` - Stromverbrauch: Residuallast   * `4387` - Stromverbrauch: Pumpspeicher 
filter_copy = 1223 # int | Muss dem Wert von \"filter\" entsprechen. (Kaputtes API-Design) 
region = "DE" # str | Land / Regelzone / Marktgebiet:   * `DE` - Land: Deutschland   * `AT` - Land: Österreich   * `LU` - Land: Luxemburg   * `DE-LU` - Marktgebiet: DE/LU (ab 01.10.2018)   * `DE-AT-LU` - Marktgebiet: DE/AT/LU (bis 30.09.2018)   * `50Hertz` - Regelzone (DE): 50Hertz   * `Amprion`- Regelzone (DE): Amprion   * `TenneT` - Regelzone (DE): TenneT   * `TransnetBW` - Regelzone (DE): TransnetBW   * `APG` - Regelzone (AT): APG   * `Creos` - Regelzone (LU): Creos  (default to "DE")
region_copy = "DE" # str | Muss dem Wert von \"region\" entsprechen. (Kaputtes API-Design) 
resolution = "hour" # str | Auflösung der Daten:   * `hour` - Stündlich   * `quater_hour` - Viertelstündlich   * `day` - Täglich   * `week` - Wöchentlich   * `month` - Monatlich   * `year` - Jährlich  (default to "hour")
timestamp = 1 # int | 

    try:
        # Zeitreihendaten
        api_response = api_instance.filter_region_filter_copy_region_copy_resolution_timestamp_json_get(filter, filter_copy, region, region_copy, resolution, timestamp)
        pprint(api_response)
    except smard.ApiException as e:
        print("Exception when calling DefaultApi->filter_region_filter_copy_region_copy_resolution_timestamp_json_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://www.smard.de/app/chart_data

Class Method HTTP request Description
DefaultApi filter_region_filter_copy_region_copy_resolution_timestamp_json_get GET /{filter}/{region}/{filterCopy}{regionCopy}{resolution}_{timestamp}.json Zeitreihendaten
DefaultApi filter_region_index_resolution_json_get GET /{filter}/{region}/index_{resolution}.json Indizes

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in smard.apis and smard.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from deutschland.smard.api.default_api import DefaultApi
  • from deutschland.smard.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
from deutschland import smard
from deutschland.smard.apis import *
from deutschland.smard.models import *