Skip to content

Instantly share code, notes, and snippets.

@Burekasim
Created October 12, 2022 07:27
Show Gist options
  • Save Burekasim/64cab1f526cd4102d703fc5ef2e84937 to your computer and use it in GitHub Desktop.
Save Burekasim/64cab1f526cd4102d703fc5ef2e84937 to your computer and use it in GitHub Desktop.
Export reinvent 2022 sessions to Google Calendar
from datetime import datetime
import json
import pytz
def return_day(timestamp: str, local_timezone: str):
return datetime.fromtimestamp(int(timestamp/1000)).astimezone(pytz.timezone(local_timezone)).strftime(
'%m/%d/%Y')
def return_time(timestamp: str, local_timezone: str):
return datetime.fromtimestamp(int(timestamp/1000)).astimezone(pytz.timezone(local_timezone)).strftime(
'%H:%M %p')
if __name__ == '__main__':
# MODIFY
event_json = json.loads('<REPLACE ME>')
my_timezone = 'Asia/Jerusalem'
# End of MODIFY
print('Subject,Start Date,Start Time,End Date,End Time,All Day Event,Description,Location')
for event in event_json['data']['event']['mySessions']['items']:
event_name = event['name'].replace('"', '""')
event_code = event['alias'].replace('"', '""')
event_room = event['room']
event_venue = event['venue']
event_status = event['myReservationStatus']
location = event_room['name'].replace('"', '""') + ', ' + event_venue['name'].replace('"', '""')
description = event['description']
start_day = return_day(event['startTime'], my_timezone)
start_time = return_time(event['startTime'], my_timezone)
end_day = return_day(event['endTime'], my_timezone)
end_time = return_time(event['endTime'], my_timezone)
print(f'"[{event_status}] {event_code} - {event_name}",{start_day},{start_time},{end_day},{end_time},False,"{description}","{location}"')
@umakanth-fmr
Copy link

How to export the events?

  1. Open DevTools in your browser.
  2. Go to the AWS Events website.
  3. Click My Reservations.
  4. In the DevTools window, go to the Network tab and look for the last graphql URL.
  5. Copy the Response output, and paste in the reinvent_export_2022.py on line 18 instead of .
  6. Change the Timezone in line 19 to 'America/Los_Angeles'
  7. Run the python script python3 reinvent_export_2022.py > events.csv
  8. Open Google Calendar.
  9. Click Settings.
  10. Click Import & Export in the menu on the left.

Upload the events.csv from step 7.

That's it - all the sessions are on your calendar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment