Skip to main content

Command-line utility which exports all of a user's Google Calendars to iCal/ICS format for backup (or portability)

Project description

Overview

Gcalvault is a command-line utility which exports all of a user's Google Calendars to iCal/ICS format for backup (or portability).

Features:

  • Automatically discovers all calendars visible the user
  • Downloads them in iCal/ICS format and saves them to disk for archival
  • Optionally manages version history for each calendar in an on-disk "vault" (a git repo under the covers)
  • Can be run via Docker image (multi-arch) or installed directly as a Python package with command-line interface

How it works

Usage

Some example commands...

Sync all calendars for foo.bar@gmail.com user:

gcalvault sync foo.bar@gmail.com

Sync one specific calendar:

gcalvault sync foo.bar@gmail.com family123@group.calendar.google.com

Sync only "writable" calendars:

gcalvault sync foo.bar@gmail.com --ignore-role reader

Simply export calendars, do not save version history:

gcalvault sync foo.bar@gmail.com --export-only

See the CLI help for full usage and other notes.

Installation

Via Docker

docker run -it --rm \
    -v ${HOME}/.gcalvault:/root/.gcalvault \
    -v ${PWD}:/root/gcalvault \
    rtomac/gcalvault sync foo.bar@gmail.com

Via PyPi

pip install gcalvault
gcalvault sync foo.bar@gmail.com

OAuth2 authentication

The CLI initiates an OAuth2 authentication the first time it is run (interactive), and then uses refresh tokens for subsequent runs (headless).

When you use Gcalvault in its default configuration, you are authenticating with Google using Gcalvault's client ID. There is nothing inherently insecure about this, since the application is running locally and therefore only you will have access to the data it reads from Google.

That said, it's strongly recommended to create your own client ID through the Google API Console, since the shared client ID will be used by others and subject to limits which may cause unpredictable failures.

rclone has a good write-up on making your own client ID.

You can provide your client ID and secret to gcalvault as follows:

gcalvault sync foo.bar@gmail.com --client-id my_client_id --client-secret my_client_secret

Development

Source repository:
http://github.com/rtomac/gcalvault

Install dependencies locally (for IDE)

make devenv
. ./.devenv/bin/activate

Build distribution and Docker image

make build

Build and test locally

make test

Build and run locally

make run user=foo.bar@gmail.com

Release to PyPi and Docker Hub

make release

See targets and variables in Makefile for more options.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcalvault-1.2.1.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file gcalvault-1.2.1.tar.gz.

File metadata

  • Download URL: gcalvault-1.2.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.6

File hashes

Hashes for gcalvault-1.2.1.tar.gz
Algorithm Hash digest
SHA256 3fdceb2b76f47fb5e13d0598c3cbd57341da30e892723e1fd640cb4ec9e6de54
MD5 30e0040c5ab085f686f9371c89df1a7f
BLAKE2b-256 23193535a2f915a081a3a4b5b943e135e841e5969477595a95734741cb87178a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page