Skip to content

Commit

Permalink
Recieving user input from cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi98khandelwal committed Mar 24, 2017
1 parent 85d0d3b commit 1b0a397
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions HintApp/predictor/Abhishek-9c1b3fd4771a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "abhishek-149711",
"private_key_id": "9c1b3fd4771abb0031db75c35feaf2092dac5bd4",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC74deh9uKo1lh9\nZc7+eYV1YCR3BXM0pD2e7U5OlOh348JsT91akseyhc4Nm2aIEL82y/zBb9rM1x9+\nIacKfnCQ8guw4Bsm7+nfrcqPJ7nz6YlFz0uLrfIn6v5z566wzYue99Iyx1M0+QFq\n5i0Zaxlbajrnuyoq+H3Z9Ss+ZOepMeRog28ucBm9STOyDleDHI9HD0QKd9x9PvCS\nMt/pgdpF81kz2Ftehiz57fay5xtOQwdhy1eeVtyf5l3wY6Zzobily5No654mRrNv\nr0/gpaKLOtIUxxnSXBk0EO62VnRZJtzS95oo6EojffyRixJOGhEmaUD4GjNHrs2b\nT9tkRxtlAgMBAAECggEAPtcq6GFLLm2C625B7Zt3p+qgR67q+ZB1i9KTfnUPzAnB\n3bhYsRKm+G8InER95sSzMADKaWigJiNNxUI8PKZNwC00+9P5QOy9rLLULU18RLi3\n0UGkYvOrKu7ObLXxF/Gn4WPCSnmguvcOIlMagoXv1UOSsC9Jy1WRwnTeIeBeG5ig\nydDauWo++5S/wsp57RVss8Edyuiw5+a4SJEP32pwp4YF8/QZtcqsSN6P8YtNSEih\nnp1y1BuukOD6Dbh3hlJzA7iiKgM1yj/jsLe0Dj9D+b+bboRARlkioNV+S0DaAD+T\n7W/f2yr+AwsWW8k62SdEBxs7i420KIEKugn2p218AQKBgQD1a1ZYvz1+o4Q0zCNg\ntI1WdH/CZuAP/0HpC8qjV1FgST6EGRwolhmo9Rqhle47KoQnW9wNS4ISpr6HEbTO\n1gKUAkLv50LfNlKtzEuDtTUW974EKZRNOh//wrzuQV73crnrJ7yi4uIjMGJC7BWI\nrCIqEQq6CTw7llV2eqHcHRY5nQKBgQDD+3ml0uxvTpuRH1n/gEWr0mYxJfJJ3oGy\n4puGYC1MjpEr4OCp4oiFSRcPaaQN4PeQtZhiCWl/1FlqsT8JtWxlCK0x3SiPsOok\ndpjPdrS5QHqwOs4YVimuoOIGzSzebcnD7DazIIZrLU2B4aIeuF32PP4TX5+PKjAB\nmkWImttCaQKBgGjXcuq0v/OCrS7U6mQcnaiKWi3VPvD2jdSd2fJPkg79GzzZcUMR\nZGLeWoMfBse10QDzaB0x3Z5UJ16SPNiDalSKZsgP1mx+y3E9riDU35oxObaTgKxB\nIXxkV8u8l3JES5JexmIbZJm9yKxoKIbbajjoUNnKqjWWcmoL12ut7VmtAoGAUpeR\nPZv1PjdPgkpHIFELi4zAume2gwD9gcjUKD4x+PiAH5DGvXGVfS4/RKSNmbe8PUT6\nch5rUo7IHBmUamAFzVJpwwDkDiJNmo5MeeoZ4ZRV4Bz4K/Nr34c3mgwvo5F7HVFY\nAAdt/o76Agl3zCCAoLw1iy6aTLhHwPUl5pr0WjkCgYEAqfI3RXRiF1aEBMvrpPRz\nNxZpGWFA+p8dHnZMGQlm7XxJ2JB1+cqjXPBZEdjkhTIipdE2fvtNHVIqVCHUaeV/\n4GdKsSwvdKOK2VxK8tuqIYr5/sp8ILH87ExQeiVHnDBdgP5PI7bdULg+BRAqMwKv\njlHpuBlahkGxr0d+gyxc/l4=\n-----END PRIVATE KEY-----\n",
"client_email": "abhishek-149711@appspot.gserviceaccount.com",
"client_id": "117425826020568054684",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/abhishek-149711%40appspot.gserviceaccount.com"
}
10 changes: 10 additions & 0 deletions HintApp/predictor/NEO.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import LabelEncoder
import Neon.get_online_data as get_online_data
from oauth2client.service_account import ServiceAccountCredentials
import gspread

class Neon_Engine:

Expand Down Expand Up @@ -63,4 +65,12 @@ def preprocess_and_add_data():
new_df = new_df.apply((LabelEncoder().fit_transform))
return new_df

def Get_UserData():
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('Abhishek-9c1b3fd4771a.json', scope)
client = gspread.authorize(creds)
sheet = client.open("train-data").sheet1
ind = (len(sheet.get_all_values()))
return ((sheet.row_values(ind))[:2])

print Get_UserData()
Binary file added Neon/__init__.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion Neon/get_online_data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import urllib.request
import urllib
from bs4 import BeautifulSoup
import datetime
def StartTime_DateTime_Conveter(string):
Expand Down
Binary file added Neon/get_online_data.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions client_secret.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"web":{"client_id":"1060728379449-j7b42fmi6s40hj612f8r91tbrnknq9mj.apps.googleusercontent.com","project_id":"abhishek-149711","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"KlGcR5HaOP_Eu83n54h4zaPx"}}
1 change: 1 addition & 0 deletions gspread
Submodule gspread added at 217b43

0 comments on commit 1b0a397

Please sign in to comment.