OEP Client Tutorial 01 - Download data from the Open Energy Platform using the OEP Client in a python script¶
Learnings¶
This tutorials will enable you to:
Requirements¶
- Python packages:
oep-client>=0.18(installs also the command line tool)- jupyter notebook, e.g.
notebookorjupyterlab
- Skills:
- use python with jupyter notebooks
Feedback¶
You can provide feedback on this tutorial here: https://github.com/OpenEnergyPlatform/academy/issues/235
Setup¶
In [1]:
Copied!
# install required packages with: pip install "oep-client>=0.17"
# import required packages
import json
from oep_client import OepClient
cli = OepClient()
table = "tutorial_example_table"
# install required packages with: pip install "oep-client>=0.17"
# import required packages
import json
from oep_client import OepClient
cli = OepClient()
table = "tutorial_example_table"
In [2]:
Copied!
data = cli.select_from_table(table)
# show results in notebook
print(json.dumps(data, indent=4))
data = cli.select_from_table(table)
# show results in notebook
print(json.dumps(data, indent=4))
[
{
"id": 1,
"name": "unit1",
"is_active": true,
"capacity_mw": 1.2,
"installation_datetime_utc": "2010-02-03T00:00:00",
"location": "01010000008FC2F5285C8F4A40713D0AD7A3B02040"
},
{
"id": 2,
"name": "unit2",
"is_active": false,
"capacity_mw": 2.1,
"installation_datetime_utc": "2010-01-08T00:00:00",
"location": null
},
{
"id": 3,
"name": "unit3",
"is_active": true,
"capacity_mw": 100.0,
"installation_datetime_utc": "2010-01-02T10:30:00",
"location": "0101000000EC51B81E85AB4B405C8FC2F5285C1D40"
}
]
In [3]:
Copied!
data = cli.select_from_table(table, where=["is_active=true", "capacity_mw>10"])
# show results in notebook
print(json.dumps(data, indent=4))
data = cli.select_from_table(table, where=["is_active=true", "capacity_mw>10"])
# show results in notebook
print(json.dumps(data, indent=4))
[
{
"id": 3,
"name": "unit3",
"is_active": true,
"capacity_mw": 100.0,
"installation_datetime_utc": "2010-01-02T10:30:00",
"location": "0101000000EC51B81E85AB4B405C8FC2F5285C1D40"
}
]
In [4]:
Copied!
metadata = cli.get_metadata(table)
# show results in notebook
print(json.dumps(metadata, indent=4))
metadata = cli.get_metadata(table)
# show results in notebook
print(json.dumps(metadata, indent=4))
{
"@id": null,
"name": null,
"title": null,
"@context": "https://raw.githubusercontent.com/OpenEnergyPlatform/oemetadata/production/oemetadata/v2/v20/context.json",
"resources": [
{
"@id": null,
"name": "tutorial_example_table",
"path": "test_table",
"type": "Table",
"title": null,
"format": null,
"review": {
"path": null,
"badge": null
},
"schema": {
"fields": [
{
"name": "id",
"type": "bigint",
"unit": null,
"isAbout": [
{
"@id": null,
"name": null,
"openModalButton": null
}
],
"nullable": false,
"description": "numerical id of this data point",
"valueReference": [
{
"@id": null,
"name": null,
"value": null,
"openModalButton": null
}
]
},
{
"name": "name",
"type": "varchar(18)",
"unit": null,
"isAbout": [
{
"@id": null,
"name": null,
"openModalButton": null
}
],
"nullable": true,
"description": "name of installation",
"valueReference": [
{
"@id": null,
"name": null,
"value": null,
"openModalButton": null
}
]
},
{
"name": "is_active",
"type": "boolean",
"unit": null,
"isAbout": [
{
"@id": null,
"name": null,
"openModalButton": null
}
],
"nullable": true,
"description": "true/false if installation is active",
"valueReference": [
{
"@id": null,
"name": null,
"value": null,
"openModalButton": null
}
]
},
{
"name": "capacity_mw",
"type": "float",
"unit": null,
"isAbout": [
{
"@id": null,
"name": null,
"openModalButton": null
}
],
"nullable": true,
"description": "installed capacity in MW",
"valueReference": [
{
"@id": null,
"name": null,
"value": null,
"openModalButton": null
}
]
},
{
"name": "installation_datetime_utc",
"type": "timestamp",
"unit": null,
"isAbout": [
{
"@id": null,
"name": null,
"openModalButton": null
}
],
"nullable": true,
"description": "date (and time) when installation was build",
"valueReference": [
{
"@id": null,
"name": null,
"value": null,
"openModalButton": null
}
]
},
{
"name": "location",
"type": "geometry",
"unit": null,
"isAbout": [
{
"@id": null,
"name": null,
"openModalButton": null
}
],
"nullable": true,
"description": "point location of installation",
"valueReference": [
{
"@id": null,
"name": null,
"value": null,
"openModalButton": null
}
]
}
],
"primaryKey": [
null
],
"foreignKeys": [
{
"fields": [
null
],
"reference": {
"fields": [
null
],
"resource": null
}
}
]
},
"topics": [
null
],
"context": {
"title": null,
"contact": null,
"grantNo": null,
"homepage": null,
"publisher": null,
"sourceCode": null,
"documentation": null,
"fundingAgency": null,
"publisherLogo": null,
"fundingAgencyLogo": null
},
"dialect": {
"delimiter": null,
"decimalSeparator": null
},
"sources": [
{
"path": null,
"title": null,
"authors": [
null
],
"description": null,
"sourceLicenses": [
{
"name": null,
"path": null,
"title": null,
"attribution": null,
"instruction": null,
"copyrightStatement": null
}
],
"publicationYear": null
}
],
"spatial": {
"extent": {
"@id": null,
"crs": null,
"name": null,
"boundingBox": [
0,
0,
0,
0
],
"resolutionUnit": null,
"resolutionValue": null
},
"location": {
"@id": null,
"address": null,
"latitude": null,
"longitude": null
}
},
"subject": [
{
"@id": null,
"name": null,
"openModalButton": null
}
],
"encoding": null,
"keywords": [
"energy",
"installations",
"geo"
],
"licenses": [
{
"name": "CC-BY-4.0",
"path": "https://creativecommons.org/licenses/by/4.0/legalcode",
"title": "Creative Commons Attribution 4.0 International",
"attribution": null,
"instruction": "You are free to share and adapt, but you must attribute. See https://creativecommons.org/licenses/by/4.0/deed.en for further information.",
"copyrightStatement": null
}
],
"temporal": {
"timeseries": [
{
"end": null,
"start": null,
"alignment": null,
"resolutionUnit": null,
"aggregationType": null,
"resolutionValue": null
}
],
"referenceDate": null
},
"languages": [
null
],
"description": null,
"contributors": [
{
"date": null,
"path": null,
"roles": [
null
],
"title": null,
"object": null,
"comment": null,
"organization": null
}
],
"embargoPeriod": {
"end": null,
"start": null,
"isActive": false
},
"publicationDate": null
}
],
"description": null,
"metaMetadata": {
"metadataLicense": {
"name": "CC0-1.0",
"path": "https://creativecommons.org/publicdomain/zero/1.0/",
"title": "Creative Commons Zero v1.0 Universal"
},
"metadataVersion": "OEMetadata-2.0.4"
}
}
About this tutorial¶

- Author: Christian Winger
- Copyright: Öko-Institut (2024)
- License: CC BY 4.0
- Attribution: Öko-Institut (2024): OEP Client Tutorial 01 - Download data from the Open Energy Platform using the OEP Client in a python script
- Last update 2025-11-29