A Python lib intended to handle operation on time periods (ie periods from one datetime.datetime
to another).
It includes simple set operation like intersection and union.
This lib mainly include two classe :
Describes an immutable period, having
begin
(datetime.datetime
) : the beginning of the period (included)end
(datetime.datetime
) : the end of the period|
(or+
) : operator returning the union of twoTimePeriod
&
: operation returning the intersection of twoTimePeriod
A set of TimePeriod
usable as an iterable, and indexable, with
periods
: the list of containedTimePeriod
|
(or+
) : operator returning the union of allTimePeriod
in twoTimePeriodSet
, or the union of aTimePeriodSet
and aTimePeriod
&
: operator returning all the intersections between theTimePeriod
of twoTimePeriodSet
, or aTimePeriodSet
and a singleTimePeriod
Raised only when trying to create an incoherent TimePeriod
, ie one in which the beginning is equal or later than the end.
Raised when an operation has been made between two TimePeriod
without any intersection.
None yet. If you think one feature is missing, fill free to open a ticket.