poets.timedate package¶
Submodules¶
poets.timedate.dateindex module¶
- poets.timedate.dateindex.check_period(interval, date)[source]¶
Checks the contining 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.
- 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.