/sportuni-reservation

SportUni's reservation to Google Calendar event with invite via OCR of reservation page's screenshot

Primary LanguagePython

SPORTUNI_RESEVATION

From a screenshot of the reservation page of SportUni as image.jpg, like image.jpg, you can create calender invites in Google Calender.

Follow this article to create a Google Calender API key and OAuth 2.0 credentials which you need to save as credentials.json in the same directory as the script.

You also need a invited.json file with the following format:

{
    "email": "YOUR_INVITED_PERSONS_EMAIL",
}

Install the following dependencies with pip:

pip install pytesseract pillow google-api-python-client google-auth google-auth-oauthlib google-auth-httplib2

What these package do briefly:

  • pytesseract is the Python wrapper for Tesseract, an OCR tool. pillow is a Python imaging library. It's imported as PIL in your code.
  • google-api-python-client, google-auth, google-auth-oauthlib, and google-auth-httplib2 are libraries for using Google APIs.
  • re (for regular expressions), datetime, os.path, pickle, and json are Python standard libraries. Among them, pickle is used to store the user's credentials for the Google API. Once the user has logged in for the first time, their credentials are pickled and saved to a file. Then, in future runs of the program, the credentials can be unpickled from the file, allowing the user to skip the login step.

You also need to install Tesseract OCR on your system. You can download it from here and install it. Make sure to add the path to the Tesseract executable to your system's PATH variable.

YOUR FOLDER STRUCTURE SHOULD LOOK LIKE THIS

.
├── app.py
├── credentials.json
├── image.jpg
├── invited.json
└── README.md

TO RUN THE SCRIPT

python app.py

SAMPLE SCREENSHOT IMAGE

image.jpg