Harvard-University-iCommons/canvas_python_sdk — pull request #4 by bermudezjd (2014-06-18 16:09:08+00:00)
Title: Feature/get canvas session

Breaking out client into a module. First set of methods deal with session creation/management for connections to Canvas API. Included tests and doc strings for methods.

One thing to note is that the session expiration logic may change depending on how long Canvas allows sessions to live. The default in canvas_utils for expiring a session was 50 seconds, but I believe that may be too short. From the request library docs, a Session object seems to primarily keep track of cookies received from the endpoint, so having it persist for a longer period should be OK. It may even make sense to keep using the same session unless and until Canvas sends back an error saying that the session has expired (if they even check for that and send along a message to that effect).