Skip to main content
# Gmail Backup

This is a small command-line tool that backs up your Gmail.
It downloads your email messages as [RFC822](http://www.w3.org/Protocols/rfc822/) format *.eml text files, which are compatible with most email clients.


## Installation

This requires Python 2.7.
You can install dependencies using this command:

pip install gmailbackup


## Command Line Usage

Download all email messages into the "email" directory:

./gmailbackup.py -u <username> -p <password>

Download all email messages labeled "foo" and "bar" into their own subdirectories under "mydir":

./gmailbackup.py -u <username> -p <password> -l foo,bar -o mydir

## Python Usage

To get started, use the `GmailClient` class in a `with` statement, authenticate it, then iterate any mailbox (label) you'd like.
The `GmailClient` is a simple wrapper around the IMAP4 client.

from gmailbackup import GmailClient

with GmailClient() as client:
client.authentiate('me@gmail.com', 'mypassword')
client.save_mailbox('Some Label', 'path/to/downloads')

Release files for gmailbackup 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gmailbackup 1.0.2
File Size Uploaded
gmailbackup-1.0.2.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gmailbackup 1.0.2
File Interpreter ABI Platform
gmailbackup-1.0.2-cp27-none-macosx_10_10_x86_64.whl CPython 2.7 none macOS 10.10+ x86-64 Details

Total release size: 5.7 kB

Release files / gmailbackup-1.0.2.tar.gz

Download URL gmailbackup-1.0.2.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
07c7cf99454112da6cf055c6d94e4141dfc388da8cb1adeeb3eebcd5dcf66312
BLAKE2b-256 checksum
How to use checksums
0a5e506c80ceacd2472f37a2a085053607cadc67de579a1cfceaad06d886d7cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / gmailbackup-1.0.2-cp27-none-macosx_10_10_x86_64.whl

Download URL gmailbackup-1.0.2-cp27-none-macosx_10_10_x86_64.whl
Size 3.3 kB
Tags CPython 2.7 macOS 10.10+ x86-64
SHA-256 checksum
How to use checksums
158ed86b358cd667b400db6cf0c7b6730ab93ae6b8068dd8277e89ada3706b64
BLAKE2b-256 checksum
How to use checksums
057b69c129dc53f97e1f599a9a45dae06af4b23a805f876401101d44f5fb47fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page