Author: Marco Gutierrez
The idea of this project was to showcase a practical example of Object-Oriented programming applied to a common activity at work. This script creates a spreadsheet with time spent per project using Google mail and calendar data following the IADB format.
- Python 3.x. Download link here
- Check
requirements.txt
for Python package requirements
- Download the latest one by clicking on Assets > Source code (zip)
- Unpack the files on the folder of your preference
- Install the requirements
- Install Python
- Install required packages
- Open a console
- On Windows, click on the Windows Icon, search for
cmd
and open it - On Mac/Ubuntu, search for
terminal
and open it
- On Windows, click on the Windows Icon, search for
- Copy the path where you downloaded the script (e.g.
D:\Archivos de programa\folder_with_script
) - Use this command on the console with the path where you downloaded the Script:
cd "D:\Archivos de programa\folder_with_script"
- Run
pip install -r requirements.txt
- Open a console
To use Google Workspace APIs, you need a Google Cloud Platform project. This project forms the basis for creating, enabling, and using all GCP services, including managing APIs, enabling billing, adding and removing collaborators, and managing permissions.
- Open the Google Cloud Console.
- Next to "Google Cloud Platform," click the Down arrow arrow_drop_down . A dialog listing current projects appears.
- Click New Project. The New Project screen appears.
- In the Project Name field, enter a descriptive name for your project.
- Click Organization and select your organization.
- In the Location field, click Browse to display potential locations for your project.
- Click a location and click Select.
- Click Create. The console navigates to the Dashboard page and your project is created within a few minutes.
- Open the Google Cloud Console.
- Next to "Google Cloud Platform," click the Down arrow arrow_drop_down and select a project.
- In the top-left corner, click Menu menu > APIs & Services.
- Click Enable APIs and Services. The Welcome to API Library page appears.
- In the search field, enter the name of the API you want to enable. In this case, "Calendar API" to find the Google Calendar API.
- Click the API to enable. The API page appears.
- Click Enable. The Overview page appears.
- Open the Google Cloud Console.
- Next to "Google Cloud Platform," click the Down arrow arrow_drop_down and select a project.
- In the top-left corner, click Menu menu > APIs & Services > Credentials.
- Click on "+ Create credentials" on the top menu and select
OAuth client ID
- On Application type, select Web Application
- Choose a name of your preference and click on Create
- The credentials page will appear again. Search for your newly created credentials in the OAuth 2.0 Client IDs
- Click on the Download icon at the right of your credentials name
- Change it's name to
credentials
and store it on the same folder where you downloaded this script
- Install the prerequisites
- Open a console
- On Windows, click on the Windows Icon, search for
cmd
and open it - On Mac/Ubuntu, search for
terminal
and open it
- On Windows, click on the Windows Icon, search for
- Copy the path where you downloaded the script (e.g.
D:\Archivos de programa\folder_with_script
) - Use this command on the console with the path where you downloaded the Script:
cd "D:\Archivos de programa\folder_with_script"
- Run
python time_planner.py
- Follow the instructions given by the script