Skip to main content

EnydayPy Python Client

EnydayPy is a Python client library for interacting with the Enyday API. This library provides access to user authentication, user details, authorization data, address information, and power consumption data.

Installation

To install the EnydayPy library, use pip:

pip install EnydayPy

Usage

The following is an example of how to use the EnydayPy client to interact with the Enyday API:

  1. Import the necessary libraries
from EnydayPy import EnydayClient
from getpass import getpass
from datetime import datetime, timedelta
import pytz
  1. Create an instance of the API class You will need to provide your Enyday email and password to authenticate.
username = input("Enter your Enyday email: ")
password = getpass("Enter your Enyday password: ")

client = EnydayClient()
client.connect(username, password)
  1. Get the user details Once authenticated, you can fetch the user details.
User = client.get_user_details()
print(User.id)
  1. Get the user's addresses You can retrieve the addresses associated with your user ID.
Addresses = client.get_address_by_user_id(User.id).addresses
print(Addresses)
  1. Get the Eloverblik authorizations This allows you to fetch the Eloverblik authorization data for the user.
Eloverblik = client.get_eloverblik_authorization(User.id)
print(Eloverblik)
  1. Get the power consumption You can fetch the power consumption data by specifying a date range. The following example shows how to get power consumption between two dates (using the Europe/Copenhagen timezone):
begin = datetime(2024, 11, 8, 0, 0, 0)
end = datetime(2024, 11, 8, 0, 0, 0)

# Set the timezone to Europe/Copenhagen
begin = pytz.timezone("Europe/Copenhagen").localize(begin)
end = pytz.timezone("Europe/Copenhagen").localize(end)

# Convert datetime from Europe/Copenhagen to UTC
begin = begin.astimezone(pytz.utc)
end = end.astimezone(pytz.utc)

print(f"Begin: {begin}")
print(f"End: {end}")

Power = client.get_power_consumption_by_user_and_address_ids(
    User.id, 
    Addresses[0].id, 
    begin, 
    end, 
    as_dataframe=True
)

# Print the sum of the power consumption
print(f"Power from PV: {Power['power_internal'].sum()}")
print(f"Power from grid: {Power['power_external'].sum()}")
  1. Notes The EnydayPy client requires a valid Enyday user account for authentication. All time-related data is converted to UTC for consistency. The library supports retrieval of power consumption, addresses, and Eloverblik authorizations.

License

This project is licensed under the MIT License.

MIT License

Copyright (c) [2024] [Bruno Adam]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for EnydayPy 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for EnydayPy 1.0.3
File Size Uploaded Provenance
enydaypy-1.0.3.tar.gz 26.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for EnydayPy 1.0.3
File Interpreter ABI Platform
enydaypy-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 69.9 kB

Release files / enydaypy-1.0.3.tar.gz

Download URL enydaypy-1.0.3.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5fa32098f6fd02b06e83985aa8090278e973a0c81b8f3466e2a8ebeb7404f399
BLAKE2b-256 checksum
How to use checksums
5ba8278ed42d8e00bb26d8a1d98ddaf5df5e94876be9f3ec976b6f8a7c7843ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

Release files / enydaypy-1.0.3-py3-none-any.whl

Download URL enydaypy-1.0.3-py3-none-any.whl
Size 43.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9186556d54c968d522a9ebb23edb5763062eed1e30acf0be5624bdd51263cdc
BLAKE2b-256 checksum
How to use checksums
01830458d7ab12b96a1442190c3c3ac83c52a7365ca4b065e68ebd57cf46d0b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

Security for EnydayPy 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for enydaypy-1.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page