Generate and work with holidays of the BDEW-Calendar for power and gas in Germany.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bdew_datetimes-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd549031a910ac6afca0011d06af31c1aed612c416deb5b8e8bd80e3549729d8 |
|
MD5 | 7085d0429af1b0f928926759722815b2 |
|
BLAKE2b-256 | b95ea1933129c7cde89302c7515134bedde6632ad30bc9adcdf74490ee5fcefa |