Skip to main content

A simple client to acess data from the German Netztransparenz portal

Project description

Netztransparenz Client

This is a small python client to access the data of the german Netztransparenz portal. It handles authentication, loads the CSV data and transforms it into a pandas dataframe with some optional format changes.

This is an unofficial client, the makers of this library are not affiliated with NETZTRANSPARENZ.DE.

Installation

Install from Pypi with 'pip install netztransparenz"

Example

To use the Netztransparenz API one has to create a free account, see https://api-portal.netztransparenz.de/. With the account you get the credentials that are needed in the next step.

Basic usage

>>> import netztransparenz as nt
>>> client = nt.NetztransparenzClient("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")

#optional: check API status 
>>> client.check_health()
'"OK"'

#load data
>>> df = client.hochrechnung_solar()
>>> df
             Datum    von Zeitzone von    bis Zeitzone bis  50Hertz (MW)  Amprion (MW)  TenneT TSO (MW)  TransnetBW (MW)
0       2011-03-31  22:00          UTC  22:15          UTC          0.00         0.000            0.000            0.000
1       2011-03-31  22:15          UTC  22:30          UTC          0.00         0.000            0.000            0.000
2       2011-03-31  22:30          UTC  22:45          UTC          0.00         0.000            0.000            0.000
...            ...    ...          ...    ...          ...           ...           ...              ...              ...
504046  2025-08-15  09:30          UTC  09:45          UTC       3520.94      7021.757        11195.645         3895.891
504047  2025-08-15  09:45          UTC  10:00          UTC       3597.52      7297.191              NaN         3968.924
504048  2025-08-15  10:00          UTC  10:15          UTC           NaN           NaN              NaN              NaN

Specify timeframe

You can specify the timeframe you want data for:

>>> import datetime
>>> start = datetime.datetime(2024, 1, 1, 0, 0)
>>> end = datetime.datetime(2025, 1, 1, 0, 0)
>>> client.hochrechnung_solar(start, end)
            Datum    von Zeitzone von    bis Zeitzone bis  50Hertz (MW)  Amprion (MW)  TenneT TSO (MW)  TransnetBW (MW)
0      2024-01-01  00:00          UTC  00:15          UTC           0.0           0.0              0.0              0.0
1      2024-01-01  00:15          UTC  00:30          UTC           0.0           0.0              0.0              0.0
2      2024-01-01  00:30          UTC  00:45          UTC           0.0           0.0              0.0              0.0
...           ...    ...          ...    ...          ...           ...           ...              ...              ...
35133  2024-12-31  23:15          UTC  23:30          UTC           0.0           0.0              0.0              0.0
35134  2024-12-31  23:30          UTC  23:45          UTC           0.0           0.0              0.0              0.0
35135  2024-12-31  23:45          UTC  00:00          UTC           0.0           0.0              0.0              0.0

Transform dates

For some of the datasets, dates are split up into five columns which makes them hard to sort. If you set the transform_dates flag to true they are converted to two timestamps. Also, "von" is turned into the index.

>>> client.hochrechnung_solar(start, end, transform_dates=True)
                                                bis  50Hertz (MW)  Amprion (MW)  TenneT TSO (MW)  TransnetBW (MW)
von                                                                                                              
2024-01-01 00:00:00+00:00 2024-01-01 00:15:00+00:00           0.0           0.0              0.0              0.0
2024-01-01 00:15:00+00:00 2024-01-01 00:30:00+00:00           0.0           0.0              0.0              0.0
2024-01-01 00:30:00+00:00 2024-01-01 00:45:00+00:00           0.0           0.0              0.0              0.0
...                                             ...           ...           ...              ...              ...
2024-12-31 23:15:00+00:00 2024-12-31 23:30:00+00:00           0.0           0.0              0.0              0.0
2024-12-31 23:30:00+00:00 2024-12-31 23:45:00+00:00           0.0           0.0              0.0              0.0
2024-12-31 23:45:00+00:00 2025-01-01 00:00:00+00:00           0.0           0.0              0.0              0.0

Project details


Download files

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

Source Distribution

netztransparenz-0.2.0.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netztransparenz-0.2.0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file netztransparenz-0.2.0.tar.gz.

File metadata

  • Download URL: netztransparenz-0.2.0.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.4

File hashes

Hashes for netztransparenz-0.2.0.tar.gz
Algorithm Hash digest
SHA256 863dd5a017d9bc29fa86483ee4c41d257a023450a316ee531ed7938c3b51e6ba
MD5 6624019576dd5159f7bbaf86764b93b2
BLAKE2b-256 5ada09d7d0864c58074cd98873a1560416b51bfe7d62042e0625dc69f6db1789

See more details on using hashes here.

File details

Details for the file netztransparenz-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for netztransparenz-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d415a9c16571cfbe7dd40c3284f14a7e5acab37dcf4d64fd376e51eb7612b8e
MD5 a4a9637f0b945bc05f8b841780271eca
BLAKE2b-256 0ea51a13a7dca8f6e3c4f953df2a8f99f2cd6fc78bd08f72d72ce6d2b49fa6d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page