PyCalendars helps you to retrieve events from your Google and ICloud calendars, in python.
Using pip :
pip install pycalendars
Using conda :
conda install -c rmic pycalendars
The google calendar api requires that you create a project in google developer console (https://console.developers.google.com/) and retrieve credentials. Depending on what type of application you plan to develop and how you want to use the calendar, you may either want to get credentials for a web / desktop application or for a service account.
ICloud only requires your apple id username and password. However, depending on how your account is configured, you may need to use a 2FA verification code.