Skip to main content

bdew_datetimes

A collection of utils to work with datetimes and holidays in the German energy market and is based on the python-holiday package.

The implementation considers the publications of the BDEW (Bundesverband der Energie- und Wasserwirtschaft e. V.) and EDI@Energy, which provide boundaries and guidance for the data exchange on the german energy market.

Current highlights:

  • BDEW-holiday calendar
    • allows dict like evaluation of dates and datetimes and contains all holidays considered by the BDEW
  • Gas-Day / Market Day evaluation

Future Scope:

  • providing subdivision holiday calendars to allow granular load profiles

Quick Start

from datetime import date
from bdew_datetimes import create_bdew_calendar

bdew_holidays = create_bdew_calendar()  # this is a dict

assert date(2022, 12, 31) in bdew_holidays
assert not date(2022, 12, 2) in bdew_holidays

bdew_holidays.get('2022-01-01')  # "Neujahr"

Extending the holidays package, the bdew_holidays dict-like object will also recognize datetimes, date strings and Unix timestamps:

import bdew_holidays
from datetime import datetime

assert datetime(2022, 1, 1, 22, 16, 59) in bdew_holidays
assert "2022-01-01" in bdew_holidays
assert "1/1/2022" in bdew_holidays

ts = datetime(2022, 1, 1, 22, 16, 59).timestamp()  # POSIX timestamp: 1641071819.0

assert ts in bdew_holidays
assert int(ts) in bdew_holidays  

Notes

The BDEW considers all days as holidays, which are nationwide holidays and days, which are a holiday in at least one state. Furthermore, the 24. and the 31. December are holidays as well. Therefore, this package utilizes a composition of all available german holiday calendars amd adds the two additional days.

Shifting holidays to the next weekday if they fall on a weekend is currently not considered.

License

This library is licensed under the MIT license, see the LICENSE file.

Metadata

Release files for bdew_datetimes 0.2.0

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

Source distribution (sdist)

Source distribution for bdew_datetimes 0.2.0
File Size Uploaded Provenance
bdew_datetimes-0.2.0.tar.gz 13.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 21.9 kB

Release files / bdew_datetimes-0.2.0.tar.gz

Download URL bdew_datetimes-0.2.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ded044d4946a895de7172e3ef1a917802201e107dd9487f03f884a8e26a840d8
BLAKE2b-256 checksum
How to use checksums
bad5a07e0b3fd3706be8d97d3a9a6508a39c2218a74d7ca641ba2bd48ab0a3b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / bdew_datetimes-0.2.0-py3-none-any.whl

Download URL bdew_datetimes-0.2.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd549031a910ac6afca0011d06af31c1aed612c416deb5b8e8bd80e3549729d8
BLAKE2b-256 checksum
How to use checksums
b95ea1933129c7cde89302c7515134bedde6632ad30bc9adcdf74490ee5fcefa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Security for bdew_datetimes 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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