{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","trusted":true},"cell_type":"code","source":"#  Kaggle Other PA Funded Credit elizabethpark 43693411\n\n#import os\n#os.environ['GOOGLE_APPLICATION_CREDENTIALS']='/kaggle/input/automl/authorise/kaggle-bengaliai-4228c6b24a8c.json'\n\ndef set_credential_from_json_string():\n    import json\n    # !pip install google-cloud-pubsub\n    from google.cloud import pubsub \n    \n    text = {\n      \"type\": \"service_account\",\n      \"project_id\": \"kaggle-bengaliai\",\n      \"private_key_id\": \"<HIDDEN XXXXXXX>\",\n      \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n <HIDDEN XXXXXXX>\", \n        \"client_email\": \"local-dev@kaggle-bengaliai.iam.gserviceaccount.com\",\n      \"client_id\": \"117266300789064494401\",\n      \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n      \"token_uri\": \"https://oauth2.googleapis.com/token\",\n      \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n      \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/local-dev%40kaggle-bengaliai.iam.gserviceaccount.com\"\n    }\n    credential = json.dumps(text)\n    return credential\n\n\nfrom google.cloud import automl\n#from google.cloud import automl_v1beta1 as automl\n\nPROJECT_ID    = 'kaggle-bengaliai' \n\n#this is ok\n#automl_client = automl.AutoMlClient(credentials=set_credential_from_json_string())\n\n#this fails\nautoml_client = automl.AutoMlClient()\n\nprint('sucess')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":1}