Skip to main content

Synchronize events across calendars

Project description

PotatoTime

Synchronize events between Google, Outlook, and iCal.

pip install -e .

Quickstart

To get started, setup OAuth credentials for each service.

  • To obtain the Google client file, create an OAuth Desktop Application in the Google Cloud Console and download the JSON credentials. Save this as potatotime_client_google.json.

  • For Microsoft, register an app in the Azure Portal and note the Application (client) ID and secret. Set these values in the environment variables POTATOTIME_MSFT_CLIENT_ID and POTATOTIME_MSFT_CLIENT_SECRET before authorizing.

Then, run the following script.

from potatotime.services.gcal import GoogleService
from potatotime.services.outlook import MicrosoftService
from potatotime.synchronize import synchronize

google = GoogleService(); google.authorize("user")
microsoft = MicrosoftService(); microsoft.authorize("user")

synchronize([google.get_calendar(), microsoft.get_calendar()])

This will prompt you login to each service via the browser. The credentials will be stored in the current directory as potatotime_user_{SERVICE}.json by default.

Storage

The library stores credentials with a simple FileStorage by default. User tokens are written to potatotime_user_<USER_ID>.json and OAuth client details are read from potatotime_client_<SERVICE>.json in the current directory.

You can also read credentials from environment variables using EnvStorage:

from potatotime.storage import EnvStorage

google = GoogleService(); google.authorize("user", storage=EnvStorage())
microsoft = MicrosoftService(); microsoft.authorize("user", storage=EnvStorage())

By default, this expects user tokens to be stored in environment variables as POTATOTIME_USER_{USER_ID} and OAuth client details to be stored in environment variables as POTATOTIME_CLIENT_{SERVICE}.

Apple Calendar

Apple Calendar access requires a username and an app password:

export POTATOTIME_APPLE_USERNAME="your_apple_id@example.com"
export POTATOTIME_APPLE_PASSWORD="app-specific-password"

Generate the password from your Apple ID account page and supply your Apple ID email address for the username.

Development

Run all tests using the following.

pip install -e .[test]
py.test --cov -x

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

potatotime-0.0.5.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

potatotime-0.0.5-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file potatotime-0.0.5.tar.gz.

File metadata

  • Download URL: potatotime-0.0.5.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for potatotime-0.0.5.tar.gz
Algorithm Hash digest
SHA256 98372a6c7f86f353f54dbe2b94863dfeb781af8c293e5760bad9d7c9de87602f
MD5 b88772e661de1c0bae61f876417a51aa
BLAKE2b-256 20bb438e5014932101d394578d2469c8d809f9c40da10b618f1318c489a14323

See more details on using hashes here.

File details

Details for the file potatotime-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: potatotime-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for potatotime-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 abcac4aa7ff16043a76f583c32ca4bedfd9d75ca3574f589e79bd1315569c860
MD5 63448e6ea92c452c57eea94f63a51af3
BLAKE2b-256 da23095d1b70643aec74b67e45e39c2bedbff549541b927c3d773799cd7b6206

See more details on using hashes here.

Supported by

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