Code Monkey home page Code Monkey logo

sync-exchange-to-gcal's Introduction

SyncExToGCal

Description

SyncExToGCal is a Python script designed to synchronize events from a Microsoft Exchange Calendar with a Google Calendar. The process includes setting up necessary configurations and establishing connections with both Exchange and Google Calendar servers.

In the synchronization phase, the script fetches events within a specified time range from the Exchange Calendar, and either creates these events on the Google Calendar or updates them if they already exist. If an event already exists on the Google Calendar, the script checks for any changes on the Exchange Calendar side and updates the Google Calendar event accordingly.

Importantly, the script also handles event deletions, but only for the events it has created. This means if an event, originally created by this script, is removed from the Exchange Calendar, it is also deleted from the Google Calendar.

Furthermore, events can be selectively ignored during synchronization based on their titles, offering an added layer of control. All operations, whether creation, updating, or deletion, are conducted while preserving the time zone of the original event from the Exchange Calendar.

In essence, SyncExToGCal provides a robust, selective synchronization solution, ensuring your Google Calendar stays up-to-date with your Exchange Calendar in a controlled manner.

Setup

  1. Clone the repository.
git clone https://github.com/wrnu/sync-exchange-to-gcal.git
cd sync-exchange-to-gcal
  1. Set up a virtual environment (optional, but recommended).
python3 -m venv venv
source venv/bin/activate  # On Windows use `.\venv\Scripts\activate`
  1. Install the requirements.
pip install -r requirements.txt
  1. Set up your environment variables.

Create a .env file in the root directory and populate it with the necessary environment variables. Refer to the Environment Variables section for more details.

Usage

To run the script, use the following command:

python main.py

The script will then synchronize events from your Exchange Calendar to your Google Calendar according to the configuration parameters you've set.

Environment Variables

The script requires the following environment variables:

  • EX2GCAL_NUM_DAYS_TO_SYNC - The number of days to synchronize (default is "1").
  • EX2GCAL_EVENT_TITLE_PREFIX - A prefix to add to event titles (default is "").
  • EX2GCAL_EVENT_TITLES_TO_SKIP - Event titles to skip during synchronization. Should be comma-separated string (default is "").
  • EWS_EMAIL_ADDRESS - Your Exchange email address.
  • EWS_PASSWORD - Your Exchange password.
  • EWS_SERVER - Your Exchange server.

You also need to set up Google API credentials and save them as credentials.json in the project's root directory. Visit this page to set up the credentials.

Note

Please note that this script is designed to work with basic Exchange Calendar to Google Calendar synchronization. If you have complex calendar events or specific requirements, you may need to modify the script accordingly. The code includes detailed comments to assist you with this process.

sync-exchange-to-gcal's People

Contributors

wrnu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.