Skip to content

Instantly share code, notes, and snippets.

View jnalley's full-sized avatar

Jon Nalley jnalley

View GitHub Profile
import gspread
from gspread_dataframe import get_as_dataframe
from oauth2client.service_account import ServiceAccountCredentials
class GoogleSheets:
def __init__(self, credentials):
scope = ["https://www.googleapis.com/auth/drive"]
self.gc = gspread.authorize(
@jnalley
jnalley / singleton.py
Created February 1, 2020 01:10
A singleton "like" Python snippet using lru_cache
#!/usr/bin/env python3
from functools import lru_cache
class Singleton:
@lru_cache
def __new__(cls, *args, **kwargs):
return super().__new__(cls)