poets.timedate package

Submodules

poets.timedate.dateindex module

poets.timedate.dateindex.check_period(interval, date)[source]

Checks the containing interval of a date and returns the date of the interval.

interval : str
Interval to check, one of (dekad, week, month).
date : datetime
Date to check.
date : datetime
Date of the interval.
poets.timedate.dateindex.check_period_boundaries(interval, date)[source]

Checks and returns the start and end date of the containing interval of a date.

interval : str
Interval to check, one of (dekad, week, month).
date : datetime
Date to check.
begin : datetime
Start of the interval.
end :datetime
End of the interval.
poets.timedate.dateindex.get_dtindex(interval, begin, end=None)[source]

Creates a pandas datetime index for a given interval.

interval : str or int
Interval of the datetime index. Integer values will be treated as days.
begin : datetime
Datetime index start date.
end : datetime, optional
Datetime index end date, defaults to current date.
dtindex : pandas.tseries.index.DatetimeIndex
Datetime index.

poets.timedate.dekad module

This module provides functions for date manipulation on a dekadal basis.

poets.timedate.dekad.check_dekad(date)[source]

Checks the dekad of a date and returns the dekad date.

date : datetime
Date to check.
new_date : datetime
Date of the dekad.
poets.timedate.dekad.day2dekad(day)[source]

Returns the dekad of a day.

day : int
Day of the date.
dekad : int
Number of the dekad in a month.
poets.timedate.dekad.dekad2day(year, month, dekad)[source]

Gets the day of a dekad.

year : int
Year of the date.
month : int
Month of the date.
dekad : int
Dekad of the date.
day : int
Day value for the dekad.
poets.timedate.dekad.dekad_index(begin, end=None)[source]

Creates a pandas datetime index on a decadal basis.

begin : datetime
Datetime index start date.
end : datetime, optional
Datetime index end date, set to current date if None.
dtindex : pandas.DatetimeIndex
Dekadal datetime index.
poets.timedate.dekad.get_dekad_period(dates)[source]

Checks number of the dekad in the current year for dates given as list.

dates : list of datetime
Dates to check.
period : list of int
List of dekad periods.
poets.timedate.dekad.runningdekad2date(year, rdekad)[source]

Gets the date of the running dekad of a spacifc year.

year : int
Year of the date.
rdekad : int
Running dekad of the date.
datetime.datetime
Date value for the running dekad.

Module contents