{"id":13593103,"url":"https://github.com/abhishekkr/gmail-helper","last_synced_at":"2025-04-06T07:12:46.554Z","repository":{"id":137959388,"uuid":"251222212","full_name":"abhishekkr/gmail-helper","owner":"abhishekkr","description":"it will contain different utilities for GMail API over OAuth2","archived":false,"fork":false,"pushed_at":"2023-05-09T16:16:45.000Z","size":62,"stargazers_count":414,"open_issues_count":1,"forks_count":12,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T05:09:47.024Z","etag":null,"topics":["client","gmail","gmail-api","gmail-client","gmail-login","google-api-client-library","python","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhishekkr.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-03-30T06:36:55.000Z","updated_at":"2024-12-09T11:04:27.000Z","dependencies_parsed_at":"2023-07-16T13:45:10.631Z","dependency_job_id":null,"html_url":"https://github.com/abhishekkr/gmail-helper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekkr%2Fgmail-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekkr%2Fgmail-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekkr%2Fgmail-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishekkr%2Fgmail-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhishekkr","download_url":"https://codeload.github.com/abhishekkr/gmail-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445671,"owners_count":20939958,"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":["client","gmail","gmail-api","gmail-client","gmail-login","google-api-client-library","python","python3"],"created_at":"2024-08-01T16:01:16.614Z","updated_at":"2025-04-06T07:12:46.515Z","avatar_url":"https://github.com/abhishekkr.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\n## gmail-helper\n\n\u003e to allow helpful GMail tasks over OAuth2 API using Google's API Client\n\n* generate and store `credentials.json` by creating an **OAuth client ID** credentials for your Google account by browsing [https://console.developers.google.com/apis/dashboard](https://console.developers.google.com/apis/dashboard) and clicking on `+ Create Credentials` button\n\n\u003e details on how to get credentials json are [here](wiki/gmail-credentials.md)\n\n* for creating mail filter queries [Google Support Reference](https://support.google.com/mail/answer/7190?ctx=gmail\u0026hl=en\u0026authuser=0) can be used\n\n* if for some reason different scope need to be used in configuration, [Gmail Scope Reference](https://developers.google.com/gmail/api/auth/scopes#gmail_scopes) can be used\n\n\n### Capabilities\n\n* Permanently delete mails based on search criteria allowed by GMail such as partial match of `subject`, `to` or `from` e-mail address fields (also allowing just domain match). Ran for a range of years provided by config as `since_year` and `before_year`.\n\n\u003e by default it reads mails first and stores it locally (except attachments) in a sqlite DB separated by year of mail, then deletes\n\u003e\n\u003e How to use: `python3 delete-mails.py ./config-yamls/delete-mails-config.yaml`\n\u003e\n\u003e GMail API doc: [developers.google.com/gmail/api/v1/reference/users/messages/delete](https://developers.google.com/gmail/api/v1/reference/users/messages/delete)\n\n\u003e result after a recent run\n\n![Google storage freed by 9%](gmail-helper-results.png)\n\n* Fetch created GMail Labels and persist to a local DB\n\n\u003e How to use: `python3 get-labels.py ./config-yamls/get-labels-config.yaml`\n\n\n* Get all GMail filters\n\n\u003e * persisted in db: `python3 get-labels.py ./config-yamls/get-filters-config.yaml`\n\u003e\n\u003e * exported to json in configured dir `filters_json_basepath` with adding switch `--to-json` to above command\n\n\n* Create a new/overwrite GMail filter\n\n\u003e * read [command help](wiki/filter-create.md) for usage help\n\u003e\n\u003e * details can be found at [developers.google.com](https://developers.google.com/gmail/api/v1/reference/users/settings/filters)\n\n---\n\n#### ToDo\n\n* offline backup of mails (all/filtered) into local SQLite3 db file; not of attachments\n\n* send mails from a custom template to a list of receivers\n\n* check recent mails for a specific mail, act as desired if received\n\n---\n\n### For Contributors\n\n* Decent list and definitions for possible exposures for Google-API-Python-Client [http://googleapis.github.io/google-api-python-client/docs/dyn/gmail_v1.html](http://googleapis.github.io/google-api-python-client/docs/dyn/gmail_v1.html)\n\n* [Hacker News discussion](https://news.ycombinator.com/item?id=22989904)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekkr%2Fgmail-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhishekkr%2Fgmail-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishekkr%2Fgmail-helper/lists"}