howarddd / TrashTalk

Repo for artifacts of the Trash Talk app for organizing cleanups and graffiti abatement.
Other
2 stars 13 forks source link

google_sheets.py #8

Closed TangoYankee closed 7 years ago

TangoYankee commented 7 years ago

Sheets API Requires a Google Cloud services account.

Instructions are found in this link

http://gspread.readthedocs.io/en/latest/oauth2.html

import gspread import datetime from oauth2client.service_account import ServiceAccountCredentials

scope = ['https://spreadsheets.google.com/feeds'] #Sheet must be shared with Cloud account in order to find it validation ="" #Validation pulls from JSON account information file sheet_key = "" #Key from sheet URL top_row = 2 #First Row is header #Limited ability to find the end of the data. Easier just to put data at the top and find it later

credentials = ServiceAccountCredentials.from_json_keyfile_name(validation, scope) gc = gspread.authorize(credentials) wks = gc.open_by_key(sheet_key).sheet1

Function used in cleanups.py for send_to_pw_really.html

def send_to_sheet(data):

Rough draft of data

#TODO: Match data format of Public Works
timestamp = '{:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now())
data.insert(0,timestamp)
print(data)
wks.insert_row(data,index=top_row)
howarddd commented 7 years ago

Do I need to do something with our gce?

On Jul 9, 2017 4:34 PM, "TangoYankee" notifications@github.com wrote:

Closed #8 https://github.com/howarddd/TrashTalk/pull/8.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/howarddd/TrashTalk/pull/8#event-1155973561, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEiniVWISAL4-dQNDXKQZE_JXjpK_zXks5sMWN7gaJpZM4OSOXB .

TangoYankee commented 7 years ago

Nah, I was trying to make a pull request on my branch and it went to yours instead. One day, I'll figure out GitHub.

-Tim

On Sun, Jul 9, 2017 at 5:31 PM, Howard D notifications@github.com wrote:

Do I need to do something with our gce?

On Jul 9, 2017 4:34 PM, "TangoYankee" notifications@github.com wrote:

Closed #8 https://github.com/howarddd/TrashTalk/pull/8.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/howarddd/TrashTalk/pull/8#event-1155973561, or mute the thread https://github.com/notifications/unsubscribe- auth/AFEiniVWISAL4-dQNDXKQZE_JXjpK_zXks5sMWN7gaJpZM4OSOXB .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/howarddd/TrashTalk/pull/8#issuecomment-313975913, or mute the thread https://github.com/notifications/unsubscribe-auth/AKjintaioeLz_CHPvN5fuVfFhNF9WKHuks5sMXDNgaJpZM4OSOXB .

howarddd commented 7 years ago

Yeah... that's both of us.

On Sun, Jul 9, 2017 at 6:01 PM, TangoYankee notifications@github.com wrote:

Nah, I was trying to make a pull request on my branch and it went to yours instead. One day, I'll figure out GitHub.

-Tim

On Sun, Jul 9, 2017 at 5:31 PM, Howard D notifications@github.com wrote:

Do I need to do something with our gce?

On Jul 9, 2017 4:34 PM, "TangoYankee" notifications@github.com wrote:

Closed #8 https://github.com/howarddd/TrashTalk/pull/8.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/howarddd/TrashTalk/pull/8#event-1155973561, or mute the thread https://github.com/notifications/unsubscribe- auth/AFEiniVWISAL4-dQNDXKQZE_JXjpK_zXks5sMWN7gaJpZM4OSOXB .

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/howarddd/TrashTalk/pull/8#issuecomment-313975913, or mute the thread https://github.com/notifications/unsubscribe-auth/AKjintaioeLz_ CHPvN5fuVfFhNF9WKHuks5sMXDNgaJpZM4OSOXB .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/howarddd/TrashTalk/pull/8#issuecomment-313977874, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEinnkUmsRgUP8XmP4pZP9htAP6WjsQks5sMXf1gaJpZM4OSOXB .

TangoYankee commented 7 years ago

Lo won't make it to Open Oakland tomorrow night. However, I would like to go and Lo is willing to conference and screenshare. Will you be going? -Tim

Sent via the Samsung Galaxy S7 edge, an AT&T 4G LTE smartphone -------- Original message --------From: Howard D notifications@github.com Date: 7/10/17 00:01 (GMT-08:00) To: howarddd/TrashTalk TrashTalk@noreply.github.com Cc: TangoYankee miller.tim108@gmail.com, State change state_change@noreply.github.com Subject: Re: [howarddd/TrashTalk] google_sheets.py (#8) Yeah... that's both of us.

On Sun, Jul 9, 2017 at 6:01 PM, TangoYankee notifications@github.com

wrote:

Nah, I was trying to make a pull request on my branch and it went to yours

instead. One day, I'll figure out GitHub.

-Tim

On Sun, Jul 9, 2017 at 5:31 PM, Howard D notifications@github.com wrote:

Do I need to do something with our gce?

On Jul 9, 2017 4:34 PM, "TangoYankee" notifications@github.com wrote:

Closed #8 https://github.com/howarddd/TrashTalk/pull/8.

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

https://github.com/howarddd/TrashTalk/pull/8#event-1155973561, or

mute

the thread

<https://github.com/notifications/unsubscribe-

auth/AFEiniVWISAL4-dQNDXKQZE_JXjpK_zXks5sMWN7gaJpZM4OSOXB>

.

You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub

https://github.com/howarddd/TrashTalk/pull/8#issuecomment-313975913,

or mute

the thread

<https://github.com/notifications/unsubscribe-auth/AKjintaioeLz_

CHPvN5fuVfFhNF9WKHuks5sMXDNgaJpZM4OSOXB>

.

You are receiving this because you commented.

Reply to this email directly, view it on GitHub

https://github.com/howarddd/TrashTalk/pull/8#issuecomment-313977874, or mute

the thread

https://github.com/notifications/unsubscribe-auth/AFEinnkUmsRgUP8XmP4pZP9htAP6WjsQks5sMXf1gaJpZM4OSOXB

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/howarddd/TrashTalk","title":"howarddd/TrashTalk","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/howarddd/TrashTalk"}},"updates":{"snippets":[{"icon":"PERSON","message":"@howarddd in #8: Yeah... that's both of us.\n\n\nOn Sun, Jul 9, 2017 at 6:01 PM, TangoYankee \u003cnotifications@github.com\u003e\nwrote:\n\n\u003e Nah, I was trying to make a pull request on my branch and it went to yours\n\u003e instead. One day, I'll figure out GitHub.\n\u003e\n\u003e -Tim\n\u003e\n\u003e On Sun, Jul 9, 2017 at 5:31 PM, Howard D \u003cnotifications@github.com\u003e wrote:\n\u003e\n\u003e \u003e Do I need to do something with our gce?\n\u003e \u003e\n\u003e \u003e\n\u003e \u003e On Jul 9, 2017 4:34 PM, \"TangoYankee\" \u003cnotifications@github.com\u003e wrote:\n\u003e \u003e\n\u003e \u003e \u003e Closed #8 \u003chttps://github.com/howarddd/TrashTalk/pull/8\u003e.\n\u003e \u003e \u003e\n\u003e \u003e \u003e —\n\u003e \u003e \u003e You are receiving this because you are subscribed to this thread.\n\u003e \u003e \u003e Reply to this email directly, view it on GitHub\n\u003e \u003e \u003e \u003chttps://github.com/howarddd/TrashTalk/pull/8#event-1155973561\u003e, or\n\u003e mute\n\u003e \u003e \u003e the thread\n\u003e \u003e \u003e \u003chttps://github.com/notifications/unsubscribe-\n\u003e \u003e auth/AFEiniVWISAL4-dQNDXKQZE_JXjpKzXks5sMWN7gaJpZM4OSOXB\u003e\n\u003e \u003e \u003e .\n\u003e \u003e \u003e\n\u003e \u003e\n\u003e \u003e —\n\u003e \u003e You are receiving this because you modified the open/close state.\n\u003e \u003e Reply to this email directly, view it on GitHub\n\u003e \u003e \u003chttps://github.com/howarddd/TrashTalk/pull/8#issuecomment-313975913\u003e,\n\u003e or mute\n\u003e \u003e the thread\n\u003e \u003e \u003chttps://github.com/notifications/unsubscribe-auth/AKjintaioeLz\n\u003e CHPvN5fuVfFhNF9WKHuks5sMXDNgaJpZM4OSOXB\u003e\n\u003e \u003e .\n\u003e \u003e\n\u003e\n\u003e —\n\u003e You are receiving this because you commented.\n\u003e Reply to this email directly, view it on GitHub\n\u003e \u003chttps://github.com/howarddd/TrashTalk/pull/8#issuecomment-313977874\u003e, or mute\n\u003e the thread\n\u003e \u003chttps://github.com/notifications/unsubscribe-auth/AFEinnkUmsRgUP8XmP4pZP9htAP6WjsQks5sMXf1gaJpZM4OSOXB\u003e\n\u003e .\n\u003e\n"}],"action":{"name":"View Pull Request","url":"https://github.com/howarddd/TrashTalk/pull/8#issuecomment-314022209"}}}

howarddd commented 7 years ago

If you are coming then I will ... but I may be a little late. PLS announce the project if I don't arrive before 7 pm.

I have a job that requires some afternoon and evening work.

On Mon, Jul 10, 2017 at 7:21 PM, TangoYankee notifications@github.com wrote:

Lo won't make it to Open Oakland tomorrow night. However, I would like to go and Lo is willing to conference and screenshare. Will you be going? -Tim

Sent via the Samsung Galaxy S7 edge, an AT&T 4G LTE smartphone -------- Original message --------From: Howard D notifications@github.com Date: 7/10/17 00:01 (GMT-08:00) To: howarddd/TrashTalk < TrashTalk@noreply.github.com> Cc: TangoYankee miller.tim108@gmail.com, State change state_change@noreply.github.com Subject: Re: [howarddd/TrashTalk] google_sheets.py (#8) Yeah... that's both of us.

On Sun, Jul 9, 2017 at 6:01 PM, TangoYankee notifications@github.com

wrote:

Nah, I was trying to make a pull request on my branch and it went to yours

instead. One day, I'll figure out GitHub.

-Tim

On Sun, Jul 9, 2017 at 5:31 PM, Howard D notifications@github.com wrote:

Do I need to do something with our gce?

On Jul 9, 2017 4:34 PM, "TangoYankee" notifications@github.com wrote:

Closed #8 https://github.com/howarddd/TrashTalk/pull/8.

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

https://github.com/howarddd/TrashTalk/pull/8#event-1155973561, or

mute

the thread

<https://github.com/notifications/unsubscribe-

auth/AFEiniVWISAL4-dQNDXKQZE_JXjpK_zXks5sMWN7gaJpZM4OSOXB>

.

You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub

https://github.com/howarddd/TrashTalk/pull/8#issuecomment-313975913,

or mute

the thread

<https://github.com/notifications/unsubscribe-auth/AKjintaioeLz_

CHPvN5fuVfFhNF9WKHuks5sMXDNgaJpZM4OSOXB>

.

You are receiving this because you commented.

Reply to this email directly, view it on GitHub

https://github.com/howarddd/TrashTalk/pull/8#issuecomment-313977874, or mute

the thread

https://github.com/notifications/unsubscribe-auth/ AFEinnkUmsRgUP8XmP4pZP9htAP6WjsQks5sMXf1gaJpZM4OSOXB

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":" 05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity": {"external_key":"github/howarddd/TrashTalk","title":" howarddd/TrashTalk","subtitle":"GitHub repository","main_image_url":" https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88- 11e6-95fc-7290892c7bb5.png","avatar_image_url":"https:// cloud.githubusercontent.com/assets/143418/15842166/ 7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/howarddd/TrashTalk"}}," updates":{"snippets":[{"icon":"PERSON","message":"@howarddd in #8: Yeah... that's both of us.\n\n\nOn Sun, Jul 9, 2017 at 6:01 PM, TangoYankee \u003cnotifications@github.com\u003e\nwrote:\n\n\u003e Nah, I was trying to make a pull request on my branch and it went to yours\n\u003e instead. One day, I'll figure out GitHub.\n\u003e\n\u003e -Tim\n\u003e\n\u003e On Sun, Jul 9, 2017 at 5:31 PM, Howard D \u003cnotifications@github.com\u003e wrote:\n\u003e\n\u003e \u003e Do I need to do something with our gce?\n\u003e \u003e\n\u003e \u003e\n\u003e \u003e On Jul 9, 2017 4:34 PM, \"TangoYankee\" \u003cnotifications@github.com\u003e wrote:\n\u003e \u003e\n\u003e \u003e \u003e Closed #8 \u003chttps://github.com/ howarddd/TrashTalk/pull/8\u003e http://github.com/howarddd/TrashTalk/pull/8%5Cu003e.\n\u003e \u003e \u003e\n\u003e \u003e \u003e —\n\u003e \u003e \u003e You are receiving this because you are subscribed to this thread.\n\u003e \u003e \u003e Reply to this email directly, view it on GitHub\n\u003e \u003e \u003e \u003chttps:// github.com/howarddd/TrashTalk/pull/8#event-1155973561\u003e http://github.com/howarddd/TrashTalk/pull/8#event-1155973561%5Cu003e, or\n\u003e mute\n\u003e \u003e \u003e the thread\n\u003e \u003e \u003e \u003chttps://github.com/notifications/unsubscribe-\n\u003e http://github.com/notifications/unsubscribe-%5Cn%5Cu003e \u003e auth/AFEiniVWISAL4-dQNDXKQZE_JXjpKzXks5sMWN7gaJpZM4OSOXB\u003e\n\u003e \u003e \u003e .\n\u003e \u003e \u003e\n\u003e \u003e\n\u003e \u003e —\n\u003e \u003e You are receiving this because you modified the open/close state.\n\u003e \u003e Reply to this email directly, view it on GitHub\n\u003e \u003e \u003chttps://github.com/howarddd/TrashTalk/pull/8# issuecomment-313975913\u003e,\n\u003e http://github.com/howarddd/TrashTalk/pull/8#issuecomment-313975913%5Cu003e,%5Cn%5Cu003e or mute\n\u003e \u003e the thread\n\u003e \u003e \u003chttps://github.com/ notifications/unsubscribe-auth/AKjintaioeLz\n\u003e http://github.com/notifications/unsubscribe-auth/AKjintaioeLz_%5Cn%5Cu003e CHPvN5fuVfFhNF9WKHuks5sMXDNgaJpZM4OSOXB\u003e\n\u003e \u003e .\n\u003e \u003e\n\u003e\n\u003e —\n\u003e You are receiving this because you commented.\n\u003e Reply to this email directly, view it on GitHub\n\u003e \u003chttps://github.com/howarddd/TrashTalk/pull/8# issuecomment-313977874\u003e http://github.com/howarddd/TrashTalk/pull/8#issuecomment-313977874%5Cu003e, or mute\n\u003e the thread\n\u003e \u003chttps://github.com/ notifications/unsubscribe-auth/AFEinnkUmsRgUP8XmP4pZP9htAP6Wj sQks5sMXf1gaJpZM4OSOXB\u003e\n\u003e http://github.com/notifications/unsubscribe-auth/AFEinnkUmsRgUP8XmP4pZP9htAP6WjsQks5sMXf1gaJpZM4OSOXB%5Cu003e%5Cn%5Cu003e .\n\u003e\n"}],"action":{"name":"View Pull Request","url":"https:// github.com/howarddd/TrashTalk/pull/8#issuecomment-314022209"}}}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/howarddd/TrashTalk/pull/8#issuecomment-314304033, or mute the thread https://github.com/notifications/unsubscribe-auth/AFEinpM0tvjjigi1alNhF8tY3Wpxf-YUks5sMtwWgaJpZM4OSOXB .