PyDocs

Data Types

calendar

Calendar printing functions

Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday).
Symbols in calendar

a

APRIL
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.
AUGUST
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.

c

calendar
Returns a year's calendar as a multi-line string.
Calendar
Base calendar class.

d

Day
Enumeration defining days of the week as integer constants.
day_abbr
A sequence that represents the abbreviated days of the week in the current locale, where Mon is day number 0.
day_name
A sequence that represents the days of the week in the current locale, where Monday is day number 0.
DECEMBER
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.

f

FEBRUARY
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.
firstweekday
Returns the current setting for the weekday to start each week.
FRIDAY
Aliases for the days of the week, where MONDAY is 0 and SUNDAY is 6.

h

HTMLCalendar
This calendar returns complete HTML pages.

i

IllegalMonthError
A subclass of ValueError and IndexError, raised when the given month number is outside of the range 1-12 (inclusive).
IllegalWeekdayError
A subclass of ValueError, raised when the given weekday number is outside of the range 0-6 (inclusive).
isleap
Return True for leap years, False for non-leap years.

j

JANUARY
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.
JULY
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.
JUNE
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.

l

leapdays
Return number of leap years in range [y1, y2).
LocaleHTMLCalendar
This class can be passed a locale name in the constructor and will return month and weekday names in the specified locale.
LocaleTextCalendar
This class can be passed a locale name in the constructor and will return month and weekday names in the specified locale.

m

MARCH
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.
MAY
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.
MONDAY
Aliases for the days of the week, where MONDAY is 0 and SUNDAY is 6.
month
Return a month's calendar string (multi-line).
Month
Enumeration defining months of the year as integer constants.
month_abbr
A sequence that represents the abbreviated months of the year in the current locale.
month_name
A sequence that represents the months of the year in the current locale.
monthcalendar
Return a matrix representing a month's calendar.
monthrange
Return weekday of first day of month (0-6 ~ Mon-Sun) and number of days (28-31) for year, month.

n

NOVEMBER
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.

o

OCTOBER
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.

p

prcal
Print a year's calendar.
prmonth
Print a month's calendar.

s

SATURDAY
Aliases for the days of the week, where MONDAY is 0 and SUNDAY is 6.
SEPTEMBER
Aliases for the months of the year, where JANUARY is 1 and DECEMBER is 12.
setfirstweekday
Sets the weekday (0 is Monday, 6 is Sunday) to start each week.
standalone_month_abbr
A sequence that represents the abbreviated months of the year in the current locale in the standalone form if the locale provides one.
standalone_month_name
A sequence that represents the months of the year in the current locale in the standalone form if the locale provides one.
SUNDAY
Aliases for the days of the week, where MONDAY is 0 and SUNDAY is 6.

t

TextCalendar
Subclass of Calendar that outputs a calendar as a simple plain text similar to the UNIX program cal.
THURSDAY
Aliases for the days of the week, where MONDAY is 0 and SUNDAY is 6.
timegm
Unrelated but handy function to calculate Unix timestamp from GMT.
TUESDAY
Aliases for the days of the week, where MONDAY is 0 and SUNDAY is 6.

w

WEDNESDAY
Aliases for the days of the week, where MONDAY is 0 and SUNDAY is 6.
weekday
Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).
weekheader
Return a header for a week.