@@ -53,7 +53,7 @@ The function `is_bdew_working_day` considers both national **and** state wide ho
5353``` python
5454from datetime import date
5555
56- from bdew_datetimes.periods import is_bdew_working_day
56+ from bdew_datetimes import is_bdew_working_day
5757
5858assert is_bdew_working_day(date(2023 , 1 , 1 )) is False # Neujahr (national holiday)
5959assert is_bdew_working_day(date(2023 , 1 , 2 )) is True # regular weekday
@@ -66,7 +66,7 @@ You can also get the next or previous working day for any date:
6666``` python
6767from datetime import date
6868
69- from bdew_datetimes.periods import get_next_working_day, get_previous_working_day
69+ from bdew_datetimes import get_next_working_day, get_previous_working_day
7070
7171assert get_next_working_day(date(2023 , 1 , 1 )) == date(2023 , 1 , 2 ) # the next working day after Neujahr
7272assert get_previous_working_day(date(2023 , 1 , 1 )) == date(2022 , 12 , 30 ) # the last working day of 2022
@@ -75,31 +75,36 @@ assert get_next_working_day(date(2023, 1, 20)) == date(2023, 1, 23) # the next
7575
7676### Calculate Statutory Periods
7777Statutory periods define the maximum time between e.g. the EDIFACT message for the "Anmeldung" and the actual start of supply ("Lieferbeginn").
78+
7879``` python
7980from datetime import date
8081
81- from bdew_datetimes.periods import DayType, EndDateType, Period, add_frist
82+ from bdew_datetimes import add_frist
83+ from bdew_datetimes import Period
84+ from bdew_datetimes.enums import DayType, EndDateType
8285
8386# Eingang der Anmeldung des LFN erfolgt am 04.07.2016. Der Mindestzeitraum von zehn WT
8487# beginnt am 05.07.2016 und endet am 18.07.2016. Frühestes zulässiges Anmeldedatum
8588# ist damit der 19.07.2016, sodass die Marktlokation dem LFN frühestens zum Beginn
8689# des vorgenannten Tages zugeordnet wird.
8790eingang_der_anmeldung = date(2016 , 7 , 4 )
8891gesetzliche_frist = Period(
89- 10 ,
90- DayType.WORKING_DAY ,
91- end_date_type = EndDateType.EXCLUSIVE
92- # lieferbeginn is the exclusive end of the previous supply contract
92+ 10 ,
93+ DayType.WORKING_DAY ,
94+ end_date_type = EndDateType.EXCLUSIVE
95+ # lieferbeginn is the exclusive end of the previous supply contract
9396)
9497fruehest_moeglicher_lieferbeginn = add_frist(eingang_der_anmeldung, gesetzliche_frist)
9598assert fruehest_moeglicher_lieferbeginn == date(2016 , 7 , 19 )
9699```
97100### Calculate "Liefer- and Fristenmonate"
98101Liefer- and Fristenmonat are concepts used in MaBiS and GPKE:
102+
99103``` python
100104from datetime import date
101105
102- from bdew_datetimes.periods import get_nth_working_day_of_month, MonthType
106+ from bdew_datetimes import get_nth_working_day_of_month
107+ from bdew_datetimes.enums import MonthType
103108
104109# returns the 18th working day of the current month in Germany
105110get_nth_working_day_of_month(18 )
0 commit comments