poets.timedate package — poets 0.3.2 documentation

# poets.timedate package

## Submodules

## poets.timedate.dateindex module

`poets.timedate.dateindex.` `check_period`(interval, date)

  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)

  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)

  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)

  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)

  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)

  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)

  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)

  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