GithubHelp home page GithubHelp logo

outlookicalsync's Introduction

Log of time spends over a week using info from Outlook calendar through Google API or iCalendar API.

In this Git will be different script to make attempts to get events from Outlook Calendar (Exchange).
The idea is to track the time spent in each task over a week accordingly with defined categories where the time has bucket. E.g.

category_bucket = {'PSM': 'Project Specific Meetings',
                   'OM': 'Other Meetings',
                   'PW': 'Project Work',
                   'OW': 'Other Work',
                   'TR': 'Transformation',
                   'IN': 'Innovation',
                   'PD': 'Personal Development',
                   'MT': 'Mentoring',
                   'EH': 'Exempt Hours',
                   'AL': 'Annual Leave',
                   'UN': 'Unavailable',
                   'OT': 'Overtime',
                   'OTH': 'Other',
                   'OTHN': 'Other non mine'
                   }

At the end of the week, you can edit the starting text of each event with the corresponding category.
This script gets the information from Google Calendar or iCalendar (a .ics file is downloaded locally) from the last Monday to the following Monday. The categories map the events and get the hours spend in the week in each of them. It exports the results in a CSV, and each week it will append the new info for the following week. Since there is a problem with the sync between Outlook and Google, it will be used the syncal.py which uses the iCalendar method (downloads a cal.ics in your local path).

The are other two script that tries to use the exchange libraries, but credential authentication was not successful: CalendarExhange.py and CalendarExcahngelib.py.

syncal.py

By Getting the ics from Outlook calendar, we can get the events and duration of the events in the calendar accordingly with the defined categories.

  1. API Reference
  2. ICS.py ICalendar for Humans
  3. Events API

Requirements :

  1. ics
  2. urllib2
  3. shutil
  4. json
  5. datetime
  6. timezone
  7. pandas
  8. os
  9. Template

CalendarGoogleAPI

1 . Sync Office 365 calendar (Outlook) to Google calendar. Follow the instructions in this link.

2 . Turn on the Google Calendar API and install the Google Client Library. In this link there is a python sample code which we used to in our code.

3 . More information about the API options.

More information about the Class Calendar events API. You can play with the API using java script in the next link.

Requirements :

  1. Python 2.7.x.
  2. httplib2.
  3. discovery.
  4. oauth2client.
  5. timezone.
  6. Template.
  7. argparse.
  8. os.
  9. ics.

Credentials file

Construct a json file with the credentials from Outlook calendarid.json, they can be used for both, syncal.py and CalendarGoogleAPI.py:

{"calendarId": [
  {"id": "[email protected]",
  "URL": "https://outlook.office365.com/owa/calendar/[email protected]/sdfd8f89d90s0dsdfsdff0s88dfs/calendar.ics"
  }],
"exchange": [
    {"email": "[email protected]",
    "URL": "https://outlook.office365.com/EWS/Exchange.asmx"}
  ]}

outlookicalsync's People

Contributors

starignus avatar

Stargazers

 avatar

Watchers

 avatar  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.