calendar.TextCalendar.formatyear()

formatyear(theyear, w=2, l=1, c=6, m=3) Return a m-column calendar for an entire year as a multi-line string. Optional parameters w, l, and c are for date column width, lines per week, and number of spaces between month columns, respectively. Depends on the first weekday as specified in the constructor or set by the setfirstweekday() method. The earliest year for which a calendar can be generated is platform-dependent.

calendar.TextCalendar.formatmonth()

formatmonth(theyear, themonth, w=0, l=0) Return a month’s calendar in a multi-line string. If w is provided, it specifies the width of the date columns, which are centered. If l is given, it specifies the number of lines that each week will use. Depends on the first weekday as specified in the constructor or set by the setfirstweekday() method.

calendar.prcal()

calendar.prcal(year, w=0, l=0, c=6, m=3) Prints the calendar for an entire year as returned by calendar().

calendar.month_name

calendar.month_name An array that represents the months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and month_name[0] is the empty string.

calendar.prmonth()

calendar.prmonth(theyear, themonth, w=0, l=0) Prints a month’s calendar as returned by month().

calendar.monthrange()

calendar.monthrange(year, month) Returns weekday of first day of the month and number of days in month, for the specified year and month.

calendar.month()

calendar.month(theyear, themonth, w=0, l=0) Returns a month’s calendar in a multi-line string using the formatmonth() of the TextCalendar class.

calendar.monthcalendar()

calendar.monthcalendar(year, month) Returns a matrix representing a month’s calendar. Each row represents a week; days outside of the month a represented by zeros. Each week begins with Monday unless set by setfirstweekday().

calendar.month_abbr

calendar.month_abbr An array that represents the abbreviated months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and month_abbr[0] is the empty string.

calendar.leapdays()

calendar.leapdays(y1, y2) Returns the number of leap years in the range from y1 to y2 (exclusive), where y1 and y2 are years. This function works for ranges spanning a century change.