Quick start =========== 1. Follow these_ instructions, to allow access to the Google Calendar API. (Make sure to keep track of the client_secret.json file) .. _these: https://developers.google.com/google-apps/calendar/quickstart/python#step_1_turn_on_the_api_name 2. Fork this repository 3. Clone your fork to your development machine 4. Navigate to the repository folder in your terminal 5. Install dependencies (preferably in a virtual environment_) `pip install -r requirements.txt` .. _environment: http://docs.python-guide.org/en/latest/dev/virtualenvs/ 6. Link the CLIENT_SECRET (**get_events.py** module) object to the **client_secret.json** file you dowloaded. 7. Generate credentials by running *_get_credentials()* function in **get_events.py** module. This can be accomplished by calling the module directly by running `python get_events` from the command line. Be sure `~/.credentials` does not exist when running the function and that CLIENT_SECRET is properly referenced. Code Sample ----------- .. code-block:: python :linenos: import get_events as ge import dfsort as dfs SCOPES = 'https://www.googleapis.com/auth/calendar.readonly' CLIENT_SECRET_FILE = 'client_secret.json' credentials = ge.get_credentials() service = ge.create_svs_obj(credentials) evStart_evEnd = ge.event_range('week') evStartEvEnd_eventsDct = ge.get_events(service, evStart_evEnd, ["calendar_name_1", "calendar_name_2", "etc."]) evStartEvEnd_calEvDfsDct = dfs.add_durations(evStartEvEnd_eventsDct) (evStart_evEnd, calEvDfsDct) = evStartEvEnd_calEvDfsDct calendar = 'Production' workTypesDct = dfs.get_unique_events(evStartEvEnd_calEvDfsDct, calendar) workType = 'Contract Work' projectNm = 'Project Name' workTypesDf = workTypesDct[workType] projectDf = dfs.get_projects(workTypesDf, projectNm) projectDf.to_csv(projectNm+'.csv')