2. API Reference

class python_calendar.Day(date)
Parameters:
  • week (int) – Number of the week

  • day (int) – Number of the day in the month

  • month (int) – Number of the month

  • year (int) – The year

__init__(date)

Create a Day based on datetime

Parameters:

date (datetime) – The date to analyze

class python_calendar.Week(day)
__init__(day)

Create a Week based on Day

Parameters:

day (Day) – The day to analyze

class python_calendar.Month(day)
__init__(day)

Create a Month based on Day

Parameters:

day (Day) – The day to analyze

class python_calendar.Year(day)
__init__(day)

Create a Year based on Day

Parameters:

day (Day) – The day to analyze

class python_calendar.Calendar
Parameters:
  • nodes (dict) – List of nodes

  • days (Day[]) – List of Day

  • weeks (Week[]) – List of Week

  • months (Month[]) – List of Month

  • years (Year[]) – List of Year

add(date)

Add a date to the Calendar

Parameters:

date (datetime) – additional date

static get(date_from, date_to, **kwargs)

Create a Calendar based on 2 datetime

Parameters:
  • date_from (datetime) – The first date to analyze

  • date_to (datetime) – The last date to analyze

  • incl_last_day (boolean) – Default: True. Set False if you want to skip the last day

Returns:

Calendar