{"id":13408579,"url":"https://github.com/smartondev/gwbackupy","last_synced_at":"2026-03-02T20:03:25.364Z","repository":{"id":64975181,"uuid":"580231077","full_name":"smartondev/gwbackupy","owner":"smartondev","description":"Open source Google Workspace™ backup solution written in python. (gmvault alternative)","archived":false,"fork":false,"pushed_at":"2025-04-21T11:33:31.000Z","size":638,"stargazers_count":45,"open_issues_count":13,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-25T11:14:43.666Z","etag":null,"topics":["backup","cli","g-suite","gcp","gmail","gmvault","google-api","google-cloud-platform","google-workspace","oauth2","package","pip","python","restore","service-account","tool","versioned-backups"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartondev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["kamarton","smartondev"]}},"created_at":"2022-12-20T03:20:56.000Z","updated_at":"2025-09-08T13:57:29.000Z","dependencies_parsed_at":"2024-01-07T21:02:21.078Z","dependency_job_id":"3309c5ff-bc32-4a3d-9d7d-fda2e3168c05","html_url":"https://github.com/smartondev/gwbackupy","commit_stats":{"total_commits":219,"total_committers":1,"mean_commits":219.0,"dds":0.0,"last_synced_commit":"710ef117d655643124d6fd16213780285b8e6cac"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/smartondev/gwbackupy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartondev%2Fgwbackupy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartondev%2Fgwbackupy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartondev%2Fgwbackupy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartondev%2Fgwbackupy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartondev","download_url":"https://codeload.github.com/smartondev/gwbackupy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartondev%2Fgwbackupy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28561902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T03:31:16.861Z","status":"ssl_error","status_checked_at":"2026-01-19T03:31:15.069Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["backup","cli","g-suite","gcp","gmail","gmvault","google-api","google-cloud-platform","google-workspace","oauth2","package","pip","python","restore","service-account","tool","versioned-backups"],"created_at":"2024-07-30T20:00:53.800Z","updated_at":"2026-03-02T20:03:25.358Z","avatar_url":"https://github.com/smartondev.png","language":"Python","funding_links":["https://github.com/sponsors/kamarton","https://github.com/sponsors/smartondev"],"categories":["\u003ca name=\"backup\"\u003e\u003c/a\u003eBackup","Python"],"sub_categories":[],"readme":"# gwbackupy: Google Workspace™ backup and restore solution.\n\n[![0.2.0](https://img.shields.io/github/v/release/smartondev/gwbackupy)](https://github.com/smartondev/gwbackupy/releases)\n[![0.2.0](https://img.shields.io/pypi/v/gwbackupy)](https://pypi.org/project/gwbackupy/)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/gwbackupy)\n[![BSD-3-Clause](https://img.shields.io/github/license/smartondev/gwbackupy)](LICENSE)\n![black - GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/smartondev/gwbackupy/black.yml?label=black)\n[![Coverage Status](https://img.shields.io/coverallsCoverage/github/smartondev/gwbackupy)](https://coveralls.io/github/smartondev/gwbackupy?branch=main)\n![pytest - GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/smartondev/gwbackupy/pytest.yml?label=pytest)\n[![](https://img.shields.io/github/actions/workflow/status/smartondev/gwbackupy/publish-pypi.yml?label=publish-pypi)](https://github.com/smartondev/gwbackupy/actions/workflows/publish-pypi.yml)\n\n## What is it?\n\nGwbackupy is an open source [Google Workspace™](https://workspace.google.com/) backup and restore solution, written in\npython.\n\n*Currently supported Gmail messages and labels only.*\n\n## Why?\n\nDue to [gmvault](https://github.com/gaubert/gmvault) limitations:\n\n- is still abandoned (??)\n- authentication method is not usable in Google Workspace wide\n- designed only for gmail messages\n- only supports IMAP protocol (slow and less security)\n\n## Details\n\n- Run from CLI or run directly from python code\n- Authentication\n    - OAUTH for free or paid plans (not recommended for paid plans)\n    - Service account file (JSON) for paid plans (can be configured to access all accounts in workspace.)\n- Version controlled storage interface\n\n  Allows to restore specific moments without using an external snapshot system (eg. zips, file system with snapshot).\n  Not limited to file storage and is not limited to the use of a database server.\n  *Currently, file system based storage is only available.*\n- Dry mode (not write to local storage and not modify on server)\n- API communication (no need for special IMAP and other settings): secure and fast\n- Gmail backup\n    - full backup (download all messages, labels)\n    - full backup continuously (periodically rerunning)\n\n      Scanning the full mailbox, but download only the new messages and mark the deleted messages.\n    - Quick backup (sync the last N days)\n- Gmail restore\n    - restore deleted message in specified interval\n    - full restore messages and labels to an empty mailbox (e.g. to other gmail account)\n\n*Paid plans are the following: [here](https://workspace.google.com/intl/en/pricing.html). Google One or additional\nstorages are not considered as paid plans*\n\n## Requirements\n\n- `python3` and `pip`\n- [Google Cloud](https://cloud.google.com/) account and own created access files.\n  **This software does not contain access files, this is for security reasons.**\n\n  A credit card is required during registration, but the use of Workspace APIs is free.\n\n## Install\n\nThe easiest way for installing:\n\n```bash\npip install gwbackupy\n# and run...\ngwbackupy ...\n```\n\nor\n\n```bash\n# clone this repository\n# install requirements\npip install -r requirements.txt\n# and run...\npython3 -m gwbackupy ...\n```\n\nThe project also has an official [Docker](https://www.docker.com/) image: \n[gwbackupy-docker](https://github.com/smartondev/gwbackupy-docker) - **under development**.\nThe docker image has scheduled backup runs and also supports managing multiple email accounts.\n\n## Instructions\n\n- [GCP OAUTH access setup](docs/oauth-setup.md)\n\n  *For free Gmail plan or paid Google Workspace™ plans*\n- [GCP Service Account Setup](docs/service-account-setup.md)\n\n  *Only for paid Google Workspace™ plans*\n\n## Usage\n\n- [Parameters](docs/cli-parameters.md)\n\n### Example usage Gmail\n\nBackup run in CLI:\n\n```bash\ngwbackupy \\\n  --service-account-key-filepath \u003cservice-acount-json-key-file\u003e \\\n#  --credentials-filepath \u003cclient-secret-json\u003e \\    # or with OAUTH\n  --batch-size 5 \\\n  gmail backup \\\n  --email \u003cmailbox email address\u003e\n```\n\nRestore run in CLI:\n\n```bash\ngwbackupy \\\n  --service-account-key-filepath \u003cservice-acount-json-key-file\u003e \\\n#  --credentials-filepath \u003cclient-secret-json\u003e \\    # or with OAUTH\n  --batch-size 5 \\\n  gmail restore \\\n  --add-label \"backup-restore-1231\" \\\n  --add-label \"more-restore-label\" \\\n  --filter-date-from \u003cdate or datetime eg. \"2023-01-01\"\u003e \\\n  --filter-date-to \u003cdate or datetime eg. \"2023-02-02 03:00:00\"\u003e \\\n  --restore-deleted \\\n  --email \u003csource backup mailbox email address\u003e \\\n  --to-email \u003cdestination mailbox email address\u003e # If you want to a different destination account\n```\n\nBackup run from python code:\n\n```python\n# WARNING: Calling directly from python code actively change in the current state of development.\n\nfrom gwbackupy.gmail import Gmail\nfrom gwbackupy.storage.file_storage import FileStorage\nfrom gwbackupy.providers.gmail_service_provider import GmailServiceProvider\nfrom gwbackupy.providers.gapi_gmail_service_wrapper import GapiGmailServiceWrapper\n\nstorage = FileStorage('./data/email@example.co')\nservice_provider = GmailServiceProvider(\n    service_account_file_path='serviceacc.json',\n    storage=storage,\n)\nservice_wrapper = GapiGmailServiceWrapper()\ngmail = Gmail(email='email@example.com',\n              service_provider=service_provider,\n              service_wrapper=service_wrapper,\n              batch_size=3,\n              storage=storage)\nif gmail.backup():\n    print('Yeah!')\nelse:\n    print(':(')\n```\n\n## Security\n\nSee [SECURITY.md](SECURITY.md)\n\n## Contributing\n\nWelcome! I am happy that you want to make the project better.\n\nCurrently, there is no developed documentation for the process, in the meantime, please use issues and pull requests.\n\n## Changelog\n\nThe changes are contained in [CHANGELOG.md](CHANGELOG.md).\n\n## About\n\n[Márton Somogyi](https://github.com/Kamarton)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartondev%2Fgwbackupy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartondev%2Fgwbackupy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartondev%2Fgwbackupy/lists"}