from tgtg import TgtgClient client = TgtgClient(email="tgtg@sinpapel.es") credentials = client.get_credentials() with open('.credentials.json', 'w') as f: print(credentials) json.dump(credentials, f)