Getting Started


Autohandshake’s central class is HandshakeSession, a context manager that represents a browsing session on the Handshake platform. Instantiating the class using a “with” statement and providing valid login credentials will log you into Handshake and plop you on the homepage. From there, you can use the various Pages to perform actions on different webpages within Handshake.

While you have the option to pass a password to HandshakeSession’s constructor, this is not recommended for security reasons. Autohandshake uses keyring to hook into your computer’s default password management system (e.g. Windows Credential Manager, macOS Keychain, etc.). To take advantage of this feature, you should set up your handshake password in your preferred password system using your school’s login url as the “system/service” and your Handshake email address as the “username.” For example, the code below assumes the existence of a password manager entry for the url “” and the username “”


school_url = ''
email = ''

with HandshakeSession(school_url, email) as browser:
    # do something


The main functionality of autohandshake comes from its Page classes. These are essentially collections of methods that are associated with specific pages in Handshake. For example, the InsightsPage class can do things like download an Insights report and change the dates in a date range filter.

Every Page-type class takes at least one constructor argument: a logged-in HandshakeBrowser. While each Page class specifies the possible actions that can be taken on their respective pages, the HandshakeBrowser actually performs those actions, such as clicking a button, waiting for a page to load, or entering text. The HandshakeSession context manager returns a logged-in HandshakeBrowser that can be injected into any Page class.

To load a page, simply instantiate the page’s class, passing in the session’s HandshakeBrowser as well as any other arguments required by the page’s constructor. You are now free to use any of the available methods on that page.


from autohandshake import HandshakeBrowser, InsightsPage
import datetime

appts_by_status_report = ''

with HandshakeBrowser(school_url, email) as browser:
    insights_page = InsightsPage(appts_by_status_report, browser)
    insights_page.set_date_range_filter('Appointments', 'Start Date Date',
                                        start_date = datetime.datetime(2018, 1, 1),
                                        end_date = datetime.datetime(2019, 1, 1))
    report_data = insights_page.get_data()

IMPORTANT: only the most recently loaded page’s methods are available for use at any given time. Attempting something like the following will throw an error, since the first page is no longer active in the browser when its method is called:

from autohandshake import HandshakeBrowser, MajorSettingsPage, AppointmentTypePage

with HandshakeBrowser(school_url, email) as browser:
    # load a page
    major_settings_page = MajorSettingsPage(browser)
    # load a second page
    appt_type_page = AppointmentTypePage(232523, browser)
    # call a method on the first page
    major_settings_page.get_major_mapping() # ERROR!