Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save elderamevans/3911cc0e858729b9ad94 to your computer and use it in GitHub Desktop.
Save elderamevans/3911cc0e858729b9ad94 to your computer and use it in GitHub Desktop.
Familysearch-Python SDK desktop login diagnoser
try:
from urllib.error import HTTPError
raw_input = input
except ImportError:
from urllib2 import HTTPError
from getpass import getpass
import json
from familysearch import FamilySearch
base = raw_input("Base: ")
key = raw_input("Key: ")
username = raw_input("Username: ")
password = getpass()
fs = FamilySearch("FSPySDK/1.0", key, base=base)
try:
fs.login(username, password)
except HTTPError as e:
response = e.read()
response = response.decode("UTF-8")
response = json.loads(response)
print("Error:",response["error_description"])
else:
print("All is well; signed in successfully.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment