INNER CODE UNIT · Python
__init__
Squarespace/datasheets · datasheets/client.py:17
def __init__(self, service=False, storage=True, user_agent='Python datasheets library'):
"""Create an authenticated client for interacting with Google Drive and Google Sheets
Args:
service (bool): Whether to authenticate as a user or as a service account. If
service=False, you will be prompted to authorize this instance to access the
Google Drive attached to one of your Gmail accounts.
Service-based authorization proceeds using the JSON file located at
``$DATASHEETS_SERVICE_PATH`` (default: ``~/.datasheets/service_key.json``).
User-based authorization proceeds using the client secrets stored at
``$DATASHEETS_SECRETS_PATH`` (default: ``~/.datasheets/client_secrets.json``).
Successful authentication by this method creates a set of credentials. By
default these credentials are stored at ``$DATASHEETS_CREDENTIALS_PATH``
(default: ``~/.datasheets/client_credentials.json``), though storage of these
credentials can be disabled with storage=False.