Welcome to datemagic’s documentation!

datemagic.split_interval(date_start, date_end=None, chunksize=30)[source]

Splits the date interval into chunks of chunksize size.

Splits the time interval between the start and end dates into chunks returning a list of datetime.date tuples.

Parameters:
  • date_start (datetime.date) – start date
  • date_end (datetime.date) – end date
  • chunksize (int) – size of a single time chunk in days. Default chunk size is 30 days.
Returns:

list of tuples

Return type:

list

datemagic.split_interval_int(startmonth, startday, startyear, endmonth=None, endday=None, endyear=None, chunksize=30)[source]

Splits the date interval into chunks

Dates are specified by 6 int values. This is convenience function — it is a wrapper around :py:func:interval_split.

Parameters:
  • startmonth (int) – start month
  • startday (int) – start day
  • startyear (int) – start year
  • endmonth (int) – end month
  • endday (int) – end day
  • endyear (int) – end year
  • chunksize (int) – size of a single time chunk in days. Default chunk size is 30 days.
Returns:

list of tuples

Return type:

list

Indices and tables