title: pygsheets - Load credentials from dict instead of file
body: <p>Is it possible to load credentials from dict instead of file? This would make it easier to use short scripts in cloud functions, because then there is no need for uploading files. Normally authorization goes like this:</p>
  
  <pre><code>import pygsheets
  gc = pygsheets.authorize(service_file='client_secret.json')
  </code></pre>
  
  <p>If credentials are stored in the a variable like this:</p>
  
  <pre><code>secret = {
    "type": "service_account",
    "project_id": "XXXXXXXXXX",
    "private_key_id": "XXXXXXXXXX",
    "private_key": "XXXXXXXXXX"
    "client_email": "XXXXXXXXXX",
    "client_id": "XXXXXXXXXX",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "XXXXXXXXXX"
  }
  </code></pre>
  
  <p>Would it be possible to load them with <code>custom_credentials</code> instead of <code>service_file</code>? The <a href="https://pygsheets.readthedocs.io/en/stable/authorization.html#custom-credentials-objects" rel="nofollow noreferrer">docs</a> don't give any instructions on how to use it, except "this option will ignore any other parameters". The following code:</p>
  
  <pre><code>import pygsheets
  gc = pygsheets.authorize(custom_credentials=secret)
  </code></pre>
  
  <p>Throws the following error:</p>
  
  <pre><code>AttributeError: 'dict' object has no attribute 'before_request'
  </code></pre>
  
  <p>Is there another way to do this? In <code>gspread</code>, for example, there is the following option: </p>
  
  <pre><code>ServiceAccountCredentials.from_json_keyfile_dict(keyfile_dict, scope)
  </code></pre>
  
  <p>Any suggestions? Thanks!!!</p>