How to use the gspread.client.Client function in gspread

To help you get started, we’ve selected a few gspread examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robin900 / gspread-dataframe / tests / View on Github external
def setUp(self):
        if self.__class__.gc is None:
        self.assertTrue(isinstance(self.gc, gspread.client.Client))
github burnash / gspread / tests / View on Github external
def setUpClass(cls):
            cls.config = ConfigParser.RawConfigParser()
            cls.gc = gspread.client.Client(auth={})
        except IOError as e:
            msg = "Can't find %s for reading test configuration. "
            raise Exception(msg % e.filename)
github aiguofer / gspread-pandas / gspread_pandas / View on Github external
from gspread.models import Spreadsheet
from gspread.utils import finditem
from past.builtins import basestring

from gspread_pandas.conf import default_scope, get_creds
from gspread_pandas.util import (

__all__ = ["Client"]

class Client(ClientV4):
    The gspread_pandas :class:`Client` extends :class:`Client `
    and authenticates using credentials stored in ``gspread_pandas`` config.

    This class also adds a few convenience methods to explore the user's google drive
    for spreadsheets.

    user : str
        optional, string indicating the key to a users credentials,
        which will be stored in a file (by default they will be stored in
        ``~/.config/gspread_pandas/creds/`` but can be modified with
        ``creds_dir`` property in config). If using a Service Account, this
        will be ignored. (default "default")
    config : dict
github aiguofer / gspread-pandas / gspread_pandas / View on Github external
def request(*args, **kwargs):
            return ClientV4.request(client, *args, **kwargs)
        except APIError as e:
            error = str(e)
            # Only retry on 100s quota breaches
            if "RESOURCE_EXHAUSTED" in error and "100s" in error:
                return request(*args, **kwargs)
                error = e

        if "error" in locals():
            raise error
github burnash / gspread / gspread / View on Github external
def authorize(credentials, client_class=Client):
    """Login to Google API using OAuth2 credentials.
    This is a shortcut function which
    instantiates :class:`gspread.client.Client`
    and performs login right away.

    :returns: :class:`gspread.Client` instance.
    client = client_class(auth=credentials)
    return client