Skip to main content

The EnAppSys Python client provides a light-weight client that allows for simple access to EnAppSys' API services.

Project description

EnAppSys Python Client

The Python library for the EnAppSys platform provides a light-weight, typed Python client to interact with EnAppSys' API services. Additionally, there is an asynchronous client for non-blocking operations.

Project Status

This project is in active development (0.x release series). While the core API structure is expected to remain stable, minor breaking changes may occur between releases.

Installation

Supports Python 3.10+

pip install enappsys[pandas,async]

The extras are optional:

  • pandas required for converting API responses to DataFrames, e.g. via client_response.to_df()
  • async required for using the EnAppSysAsync asynchronous client.

If you only need the synchronous client and raw responses, install without extras:

pip install enappsys

Configuring credentials

Your EnAppSys username and secret are required to make API requests. You can obtain these as follows:

  1. Go to any download page on EnAppSys and click Copy API URL.

  2. In the copied URL:

    • The value after user= is your username.
    • The value after pass= is your secret (a long numeric string).

The client looks for credentials in the following order:

  1. Direct arguments when creating the client:

    from enappsys import EnAppSys
    
    client = EnAppSys(
        user="example_user",
        secret="123456789123456789123456789123456789"
    )
    
  2. Environment variables:

    export ENAPPSYS_USER=example_user
    export ENAPPSYS_SECRET=123456789123456789123456789123456789
    
  3. Credentials file at your home directory, the default location is: ~/.credentials/enappsys.json:

    {
        "user": "example_user",
        "secret": "123456789123456789123456789123456789"
    }
    

    You can also save and specify a custom path:

    client = EnAppSys(credentials_file="path/to/credentials.json")
    

Usage

The EnAppSys client provides several download interfaces, depending on your user permissions.

Bulk API

The Bulk API is a subscription service that allows you to retrieve time series data. A data type represents a group of related series, and each individual series within that group is referred to as an entity.

The web interface for browsing available data types and entities is available at: https://app.enappsys.com/#dataservicecsv

Retrieve the DA_PRICE and DA_VOLUME entities belonging to EPEX_HR_AUCTION_RESULTS_DE and convert them to a pandas DataFrame. When converting to a DataFrame, you can also rename the columns:

day_ahead = client.bulk.get(
    "csv",
    data_type="EPEX_HR_AUCTION_RESULTS_DE",
    entities=["DA_PRICE", "DA_VOLUME"],
    start_dt="2025-01-01T00:00",
    end_dt="2025-01-02T00:00",
    resolution="qh",
    time_zone="CET",
)

df = day_ahead.to_df(rename_columns=["price", "volume"])

To retrieve all entities for a given data_type, omit the entities argument or pass None:

day_ahead_all = client.bulk.get(
    "csv",
    data_type="EPEX_HR_AUCTION_RESULTS_DE",
    start_dt="2025-01-01T00:00",
    end_dt="2025-01-02T00:00",
    resolution="qh",
    time_zone="CET",
)

df_all = day_ahead_all.to_df()

The Bulk API supports multiple response formats:

  • "csv"
  • "json"
  • "json_map"
  • "xml"

The JSON-based formats optionally include metadata fields:

  • timestamp: Indicates when the data was first entered into the database or created as a forecast (UTC).
  • last_updated: Indicates the last time the data was updated in the database (UTC).

These fields can be included when converting the response to a DataFrame:

data = client.bulk.get(
    "json",
    data_type="EPEX_HR_AUCTION_RESULTS_DE",
    start_dt="2025-01-01T00:00",
    end_dt="2025-01-02T00:00",
    resolution="qh",
    time_zone="CET",
)

df = data.to_df(timestamp=True, last_updated=True)

Chart API

The Chart API extracts data directly from charts available on the EnAppSys platform.

Each chart is identified by a code, which can be found in the page URL. For example:

https://app.enappsys.com/#de/elec/pricing/daprices/chart

The chart code is the part between # and /chart, in this case:

de/elec/pricing/daprices

Example usage:

day_ahead_chart = client.chart.get(
    "csv",
    code="de/elec/pricing/daprices",
    start_dt="2025-01-01T00:00",
    end_dt="2025-01-02T00:00",
    resolution="qh",
    time_zone="CET",
)

df_day_ahead_chart = day_ahead_chart.to_df()

[!NOTE] Some charts contain non-timeseries data and may have a different structure. Below chart types are supported. If you encounter a chart that is not yet supported, please open an issue and include a link to the chart.

Price Volume Curves

The Price Volume Curve API retrieves auction price-volume curve data for a given timestamp.

hu_price_volume_curve = client.price_volume_curve.get(
    "csv",
    code="hu/elec/ancillary/capacity/afrr/daily/up",
    dt="2025-01-01T00:00",
    time_zone="CET",
    currency="EUR",
)

df_curve = hu_price_volume_curve.to_df()

The dt parameter represents the auction timestamp for which the curve should be retrieved.

EPEX Trade Evolution And Contracts

The EPEX service uses the apxdownload endpoint and is exposed as client.epex. It currently supports settlement trade evolution downloads and contract evolution downloads in "csv", "json", and "xml" formats.

Settlement trade evolution is available under client.epex.settlement. You can identify a quarter-hour either with settlement_date plus settlement_period, or with a single settlement_datetime:

trade_evo = client.epex.settlement.get(
    "csv",
    code="nl/elec/epex/tradeevo/download",
    settlement_datetime="2025-01-01T12:07",
    max_points=200,
    time_zone="CET",
)

trade_evo_df = trade_evo.to_df(
    rename_columns=["qh_price", "qh_vol", "hh_price", "hh_vol", "hr_price", "hr_vol"],
    unit_in_columns=True,
)

Contract evolution is available under client.epex.contract:

contract_evo = client.epex.contract.get(
    "csv",
    code="nl/elec/spectron/power/baseload/evolution/download",
    contract="DEC-25",
    max_points="all",
    time_zone="CET",
)

contract_evo_df = contract_evo.to_df(unit_in_columns=True)

Asynchronous

An asynchronous client (EnAppSysAsync) is available for non-blocking and concurrent request execution.

The asynchronous interface is currently under active development. Usage examples and extended documentation will be added in a future release.

License

This project is licensed under the terms of the MIT license.

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

enappsys-0.1.6.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

enappsys-0.1.6-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file enappsys-0.1.6.tar.gz.

File metadata

  • Download URL: enappsys-0.1.6.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for enappsys-0.1.6.tar.gz
Algorithm Hash digest
SHA256 75b330b938c4a381ab58cd4af1fb5e4dff7f6783cf8719be0ac8cfd98b3ca346
MD5 c49754542d4fbd2106b9817527b95f03
BLAKE2b-256 0c5ba42fb098d4e418db65ed15b9f805584cac8f16649738915a413330d5827f

See more details on using hashes here.

File details

Details for the file enappsys-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: enappsys-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for enappsys-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b07e5de6a312da849731ceda545b73abfcad695d3b9c86f6247061fc6140cdc5
MD5 3f9e5d8ae57e8bebe88e7c85f10dda19
BLAKE2b-256 29e791933e7b0dac211cd5a8f9248e60c78c4ffe1f5251ffb62e97c4bc826285

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