{"id":20383309,"url":"https://github.com/robertdavidwest/google_api","last_synced_at":"2025-06-14T09:33:42.660Z","repository":{"id":57435302,"uuid":"156724886","full_name":"robertdavidwest/google_api","owner":"robertdavidwest","description":"Quickly and easily read emails from gmail programmatically","archived":false,"fork":false,"pushed_at":"2019-01-02T16:54:08.000Z","size":25,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T13:49:18.774Z","etag":null,"topics":["gmail","google-api-client","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdavidwest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-08T15:09:03.000Z","updated_at":"2023-07-13T17:08:00.000Z","dependencies_parsed_at":"2022-09-01T18:40:55.697Z","dependency_job_id":null,"html_url":"https://github.com/robertdavidwest/google_api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/robertdavidwest/google_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdavidwest%2Fgoogle_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdavidwest%2Fgoogle_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdavidwest%2Fgoogle_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdavidwest%2Fgoogle_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdavidwest","download_url":"https://codeload.github.com/robertdavidwest/google_api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdavidwest%2Fgoogle_api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259794552,"owners_count":22912382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gmail","google-api-client","python"],"created_at":"2024-11-15T02:21:58.020Z","updated_at":"2025-06-14T09:33:42.635Z","avatar_url":"https://github.com/robertdavidwest.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-read-gmail\n\n### Setup \n\n* Set up the conda envrionment \"google-api\":\n\n        $ conda env create -f environment.yml \n\n* Follow these instructions to allow python to access your gmail account (skip the past about installing python packages, thats already taken care of in the conda envionment\"):\n\n    https://developers.google.com/gmail/api/quickstart/python\n\n* After the set up you will download a file called `credentials.json`. Be sure to update the variable `GMAIL_CREDENTIALS_PATH` path to this file in `example.py`. Also update the `GMAIL_TOKEN_PATH` to be a file called `*-token.json` in the same directory\n\n    e.g:\n    ```\n    example.py \n\n    GMAIL_CREDENTIALS_PATH = \"credentials.json\"\n    GMAIL_TOKEN_PATH = \"token.json\"\n    ...\n    ```\n\n### Usage \n\nAPI Documentation is here: https://developers.google.com/resources/api-libraries/documentation/gmail/v1/python/latest/\n\n* Use this function to get the gmail service and access to all messages (taken from the `quickstart.py` code):\n\n```\nexample.py\n...\nfrom google_api import gmail\n\n# get all attachments from e-mails containing 'test'\nsearch_query = \"test\"\nservice = gmail.get_gmail_service(GMAIL_CREDENTIALS_PATH, GMAIL_TOKEN_PATH)\nresults = gmail.query_for_csv_or_xl_attachments(service, search_query)\n\n# 1st Attachment found:\nitem = results[0]\ndf = item['data']\nprint('email: ' + item['emailsubject'])\nprint('filename: ' + item['filename'])\nprint(\"data sample: \")\nprint(df.head())\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdavidwest%2Fgoogle_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdavidwest%2Fgoogle_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdavidwest%2Fgoogle_api/lists"}