Skip to main content

Python calendar helper.

Project description

calendary Documentation Status Updates Python 3

Python calendar and datetime helpers.


Return a list of days for any year

cal = Calendary(2016)

weekdays = cal.weekday_calendar()
today =

for weekday, date in weekdays:
    if date < today:
        print("{0}-{1}-{2} was a {3}".format(date.month,, date.year, weekday))
    elif date == today:
        print("Today is {}".format(weekday))
        print("{0}-{1}-{2} will be a {3}".format(date.month,, date.year, weekday))

Return a list of only workdays (default: Monday-Friday)

cal = Calendary(2016)

workdays = cal.workday_calendar()

for weekday, date in workdays:
    print(weekday, date)

Change the workweek begin and end

cal = Calendary(2016)

# Work Tuesday - Saturday
workdays = cal.workday_calendar(workweek_start=1, workweek_end=5)

Get the calendar for a specific month

cal = Calendary(2016)

# July calendar

# July workweek calendar
cal.month(7, work=True, workweek_start=1, workweek_end=5)

Get a specific date relative to the calendar

cal = Calendary(2016)

# Get the third Thursday in July of 2016
cal.weekday('Thursday', month=7, ordinal=3)

# Get all Thursdays in July 2016
cal.weekday('Thursday', month=7)

# Get the third Thursday in 2016
cal.weekday('Thursday', ordinal=3)

# Get all Thursdays in 2016


This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.


0.1.0 (2016-07-20)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
calendary-0.2.1-py2.py3-none-any.whl (5.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3
calendary-0.2.1.tar.gz (14.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page