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.

  • 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.

Remove the credentials from the dictionary, if they exist.


Retrieve the credentials from the dictionary, if they exist.

Returns: A oauth2client.client.OAuth2Credentials instance.


Save the credentials to the dictionary.

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