Skip to main content

LCPDelta Python Package

Project description

LCPDelta Python Package

This is the python wrapper to interact with all LCPDelta products through their API or DPS. To get started, install the latest version of the LCPDelta package.

To find out more about LCPDelta's data products, click here. To find out more about Enact, click here.

Enact API and DPS Instructions

Full instructions on how to utilise Enact's full API and DPS can be found here. Below are some examples to get you started.

Enact Series API Example Code

from lcp_delta import enact
from datetime import date

username = "insert_username_here"
public_api_key = "insert_public_api_key_here"

api_helper = enact.APIHelper(username, public_api_key)

# Example dates
from_date= date(2022,4,1)
to_date = date(2023,5,31)

# Example series
series_id = "LcpDemandvsGrid"

response = api_helper.get_series_data(
    series_id,
    from_date,
    to_date,
    country_id = "Gb",
    time_zone_id="UTC"
)

print(response)

Enact DPS Example Code

from lcp_delta import enact

def handle_new_information(x):
    # A callback function that will be invoked with the received series updates.
    # The function should accept one argument, which will be the data received from the series updates.
    print(x)

username = "insert_username_here"
public_api_key = "insert_public_api_key_here"

dps_helper = enact.DPSHelper(username, public_api_key)
# Input method to handle any update to the series, alongside the series ID, that can be found on Enact.
dps_helper.subscribe_to_series_updates(handle_new_information, "RealtimeDemand")

message = None
while message != "exit()":
    message = input(">> ")

#Terminate the connection at the end
dps_helper.terminate_hub_connection()

FLEXtrack API Example Code

import lcp_delta.flextrack as flextrack
from datetime import datetime as dt

user = "insert_username_here"
api_key = "insert_public_api_key_here"

api_helper = flextrack.APIHelper(user, api_key)

response = api_helper.get_exporter_data(
    date_from=dt(2022, 11, 1),
    date_to=dt(2023, 10, 31),
    countries=['Austria'],
    products=["RegelleistungFcrProcuredFourHourly","RegelleistungFcrProcuredDaily","RegelleistungAfrrProcured"],
    directions=["Symmetric", "Upward", "Downward"],
    market='Availability',
    metrics=['Volume', 'Price'],
    aggregation_types=['Average', 'Average'],
    granularity='Monthly'
)

response.head

Contributing

Check out our contribution guidelines and code of conduct.

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

lcpdelta-1.3.8.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

LCPDelta-1.3.8-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file lcpdelta-1.3.8.tar.gz.

File metadata

  • Download URL: lcpdelta-1.3.8.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for lcpdelta-1.3.8.tar.gz
Algorithm Hash digest
SHA256 2dc3f670cf2bf674093de88749e334dc4ddbfca495bce5a3332d9160c0d72e3b
MD5 9bde272ea4b62a6b6f7ec3e800ca4877
BLAKE2b-256 2cda680bf82e44f4393b013bd97c50c537116219276d23a9df27882160035c1d

See more details on using hashes here.

File details

Details for the file LCPDelta-1.3.8-py3-none-any.whl.

File metadata

  • Download URL: LCPDelta-1.3.8-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for LCPDelta-1.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6fd4e00528d2e9cce4f025d5f8902a4dfd6194aaa74f3667e47f782dc6714183
MD5 432731a53d59a1544233acdf11b1a786
BLAKE2b-256 e59f8159a0cb99c1aeed8c4b59bfa97c7c105ddaeb70abaf1d6b9d426a86fdd2

See more details on using hashes here.

Supported by

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