title: How to append data to google spreadsheet using Python
body: <p><strong>Problem :</strong> I have an incremental data which I need to append to my google spreadshseet at beginning of each month.
  Code that I tried : </p>
  
  <p><strong>Trial 1</strong></p>
  
  <pre><code>scope = ['https://spreadsheets.google.com/feeds',
           'https://www.googleapis.com/auth/drive']
  #creds.json is the credentials file
  credentials = ServiceAccountCredentials.from_json_keyfile_name('drd_creds.json', scope)
  gd = gc.authorize(credentials)
  
  wks = gd.open_by_key('1lONS0lTy-XXXXXXXXXXX').worksheet("worksheet_name")
  set_with_dataframe(worksheet,df_adsets)
  </code></pre>
  
  <p>The above code doesn't append but overwrites the spreadsheet.</p>
  
  <p><strong>Trial II</strong> : 
  As per the guidance given in <a href="https://stackoverflow.com/questions/45540827/appending-pandas-data-frame-to-google-spreadsheet">Appending pandas Data Frame to Google spreadsheet</a></p>
  
  <pre><code>wks = gd.open_by_key('1lONS0lTy-XXXXXXXXXXX').worksheet("worksheet_name")
  existing = get_as_dataframe(wks)
  updated = existing.append(df_adsets,sort=True)
  set_with_dataframe(wks,updated)
  
  </code></pre>
  
  <pre> Problem: The method gets all the rows and columns of the spreadsheet 
  (empty ones too as NAN) and when it appends the data there is a weird formatting done for e.g. 
  
  1. original value: 23843372759610279 changes to 2.38E+16
  2. Column orders are changed to alphabetic order 
  3. Also, it seems to be a very crude method of getting all the data then appending then writing back. </pre>
  
  <p>Is there any function from gspread or any other library to append values/data frame directly rather than overwriting ? (I don't want to write individual rows but just write the whole df from the next empty row). </p>