tennet-py


Nametennet-py JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/fboerman/tennet-py
SummaryA python API wrapper for TenneT System & transmission data
upload_time2024-12-11 16:02:27
maintainerNone
docs_urlNone
authorFrank Boerman
requires_pythonNone
licenseMIT
keywords tennet data api energy
VCS
bugtrack_url
requirements requests pandas lxml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TenneT-py

DEPRECATED: TenneT.org has been deprecated. Please move to [tennet.eu API](https://github.com/fboerman/TenneTeu-py) instead.

Python client for ingesting the TenneT System & transmission data API which can be found [here](https://www.tennet.org/english/operational_management/export_data_explanation.aspx).
It is a public API for which no API key is needed.

The library currently supports four data items:

* Measurement data
* Imbalance price
* Balance delta with prices
* Available capacity

Data can be retrieved as raw text or a Pandas DataFrame.

The client currently has two methods:
* ```base_request```: retrieves specified data in csv or xml text format
* ```query_df```: retrieves specified data and returnes a Pandas DataFrame

## Installation
```pip install tennet-py```

## Example Usages
```python
from tennet import TenneTClient, DataType, OutputType
import pandas as pd

start = pd.Timestamp("2021-01-01")
end = pd.Timestamp("2021-01-31")

# initiate the client, you can specify a default output to not always specify it per call
client = TenneTClient(default_output=OutputType.CSV)
# retrieve data as text in default output (in this case csv)
data = client.base_request(DataType.settlementprices, d_from=start, d_to=end)
# retrieve data as xml
data = client.base_request(DataType.settlementprices, d_from=start, d_to=end, output_type=OutputType.XML)

# retrieve same data as a dataframe
df = client.query_df(DataType.settlementprices, d_from=start, d_to=end)
```

## Netztransparenz
Also supported is a limited number of endpoints of the german TenneT from the Netztransparenz platform. First register and get oauth credentials as explained on the documentation page [here](https://www.netztransparenz.de/en/Web-API)
Then can be used as follows:
```python
from tennet import NetztransparenzClient
import pandas as pd

client = NetztransparenzClient(oauth_client_id, oauth_client_secret)
df = client.query_imbalance(start=pd.Timestamp('2023-12-22', tz='europe/amsterdam'), end=pd.Timestamp('2023-12-22 23:59', tz='europe/amsterdam'))
```

## Disclaimer
This is an unoffical package which is not supported or endorsed in any way by TenneT TSO.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fboerman/tennet-py",
    "name": "tennet-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "TenneT data api energy",
    "author": "Frank Boerman",
    "author_email": "frank@fboerman.nl",
    "download_url": "https://files.pythonhosted.org/packages/b3/7a/0181f3437fa6f0c65453974f99613416d313331239b177d06509256fc4cf/tennet_py-0.2.2.tar.gz",
    "platform": null,
    "description": "# TenneT-py\n\nDEPRECATED: TenneT.org has been deprecated. Please move to [tennet.eu API](https://github.com/fboerman/TenneTeu-py) instead.\n\nPython client for ingesting the TenneT System & transmission data API which can be found [here](https://www.tennet.org/english/operational_management/export_data_explanation.aspx).\nIt is a public API for which no API key is needed.\n\nThe library currently supports four data items:\n\n* Measurement data\n* Imbalance price\n* Balance delta with prices\n* Available capacity\n\nData can be retrieved as raw text or a Pandas DataFrame.\n\nThe client currently has two methods:\n* ```base_request```: retrieves specified data in csv or xml text format\n* ```query_df```: retrieves specified data and returnes a Pandas DataFrame\n\n## Installation\n```pip install tennet-py```\n\n## Example Usages\n```python\nfrom tennet import TenneTClient, DataType, OutputType\nimport pandas as pd\n\nstart = pd.Timestamp(\"2021-01-01\")\nend = pd.Timestamp(\"2021-01-31\")\n\n# initiate the client, you can specify a default output to not always specify it per call\nclient = TenneTClient(default_output=OutputType.CSV)\n# retrieve data as text in default output (in this case csv)\ndata = client.base_request(DataType.settlementprices, d_from=start, d_to=end)\n# retrieve data as xml\ndata = client.base_request(DataType.settlementprices, d_from=start, d_to=end, output_type=OutputType.XML)\n\n# retrieve same data as a dataframe\ndf = client.query_df(DataType.settlementprices, d_from=start, d_to=end)\n```\n\n## Netztransparenz\nAlso supported is a limited number of endpoints of the german TenneT from the Netztransparenz platform. First register and get oauth credentials as explained on the documentation page [here](https://www.netztransparenz.de/en/Web-API)\nThen can be used as follows:\n```python\nfrom tennet import NetztransparenzClient\nimport pandas as pd\n\nclient = NetztransparenzClient(oauth_client_id, oauth_client_secret)\ndf = client.query_imbalance(start=pd.Timestamp('2023-12-22', tz='europe/amsterdam'), end=pd.Timestamp('2023-12-22 23:59', tz='europe/amsterdam'))\n```\n\n## Disclaimer\nThis is an unoffical package which is not supported or endorsed in any way by TenneT TSO.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python API wrapper for TenneT System & transmission data",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://github.com/fboerman/tennet-py"
    },
    "split_keywords": [
        "tennet",
        "data",
        "api",
        "energy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "28bef8c876a6400b809c0b64a9bd5e7a4e5ba87142c09081db15ab08c8fbdfbc",
                "md5": "e07c76ad7757d6bb5ca6666c9f49a892",
                "sha256": "5a151f2efef8ae9872e4133de4d5138deea51197310834388638c263712d47ff"
            },
            "downloads": -1,
            "filename": "tennet_py-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e07c76ad7757d6bb5ca6666c9f49a892",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7372,
            "upload_time": "2024-12-11T16:02:26",
            "upload_time_iso_8601": "2024-12-11T16:02:26.959379Z",
            "url": "https://files.pythonhosted.org/packages/28/be/f8c876a6400b809c0b64a9bd5e7a4e5ba87142c09081db15ab08c8fbdfbc/tennet_py-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b37a0181f3437fa6f0c65453974f99613416d313331239b177d06509256fc4cf",
                "md5": "e9faa6a0ff06207ff0b1e5a43178db3b",
                "sha256": "0d2554976f049335cdec4ef31df33aa753198821f4d0d002ad91d37365ff6cc1"
            },
            "downloads": -1,
            "filename": "tennet_py-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e9faa6a0ff06207ff0b1e5a43178db3b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6571,
            "upload_time": "2024-12-11T16:02:27",
            "upload_time_iso_8601": "2024-12-11T16:02:27.844180Z",
            "url": "https://files.pythonhosted.org/packages/b3/7a/0181f3437fa6f0c65453974f99613416d313331239b177d06509256fc4cf/tennet_py-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-11 16:02:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fboerman",
    "github_project": "tennet-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "lxml",
            "specs": []
        }
    ],
    "lcname": "tennet-py"
}
        
Elapsed time: 0.36671s