import gspread
from oauth2client.service_account import ServiceAccountCredentials
from datetime import date

def upload_stat_data_to_google_sheets(email, posts_in_queue, followers):
	scope = ["", '',
		"", ""]

	creds = ServiceAccountCredentials.from_json_keyfile_name(
		os.path.join(os.getcwd(), 'stat_scraper',"google_cloud_credentials.json"), scope)

	client = gspread.authorize(creds)

	sheet ="automation_stats").sheet1
	analytics ="automation_stats").worksheet("analytics")
	data = sheet.get_all_records()
	current_date ='%d.%m.%y')
	row_to_insert = [[current_date, email, posts_in_queue, followers]]	
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter