Skip to main content

Synchronize events between Google, Outlook, and iCal.

Project description

PotatoTime

Synchronize events between Google, Outlook, and iCal.

pip install potatotime

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.6.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.6-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: potatotime-0.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 249376e22efa2ccd15cb1baa694775daf711f8f9401f0126f2b91b01550c6a8d
MD5 40a2a07f3ef0359e4ad0de115fac3531
BLAKE2b-256 334773316224c788a768f6af47c492fd06b3ae516aa95437c1b4df4609ed84ce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: potatotime-0.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 000299c2bc5a91a053edb53edf84c99c3d73c761878e4fc3272e95cd71d38838
MD5 1596cf4183102822804218023dec37fb
BLAKE2b-256 6024615e73586464eb2af3dfbe91bc91b1287f7811efee8caccd04561f9f8361

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