oauth2client.contrib.dictionary_storage module

Dictionary storage for OAuth2 Credentials.

class oauth2client.contrib.dictionary_storage.DictionaryStorage(dictionary, key, lock=None)[source]

Bases: oauth2client.client.Storage

Store and retrieve credentials to and from a dictionary-like object.

Parameters:
  • dictionary – A dictionary or dictionary-like object.
  • key – A string or other hashable. The credentials will be stored in dictionary[key].
  • lock – An optional threading.Lock-like object. The lock will be acquired before anything is written or read from the dictionary.
locked_delete()[source]

Remove the credentials from the dictionary, if they exist.

locked_get()[source]

Retrieve the credentials from the dictionary, if they exist.

Returns: A oauth2client.client.OAuth2Credentials instance.

locked_put(credentials)[source]

Save the credentials to the dictionary.

Parameters:credentials – A oauth2client.client.OAuth2Credentials instance.