SUMMARY: | Use VBA to extract my Free/Busy calendar from MS Outlook, and use Python & jinja2 to post it at https://DavidTutor.Neocities.org. |
---|---|
REPOSITORY: | https://github.com/DavidJLambert/Online_Calendar/ |
Author: | David J. Lambert |
Version: | 0.5.0 |
Date: | August 4, 2024 |
I keep my calendar in the desktop version of Microsoft Outlook (the Classic Version, not the New Version). As a professional tutor who works online, I want to be able to post my Free/Busy schedule online, in my own format, so that my clients can see my schedule and request a time slot without my having to manually send my calendar to each person, and without having to manually re-send my calendar to each client every time the schedule changes.
Furthermore, I want to post my schedule converted into each major time zone on this planet (I've tutored students in Europe, the Far East, Australia, and the Middle East), so they can conveniently see my Free/Busy schedule in their own time zone.
This GitHub repository shows the code I have written to do this. You can see the resulting calendar at https://davidtutor.neocities.org.
Note that my online schedule is read-only. There exist websites that allow people to book appointments online, such as Calendly, but they rarely synchronize with desktop Outlook, and I have never seen one that allows clients to self-select when their appointment starts and ends. In principle, I could do this, but I have decided it is not worth the effort.
In Microsoft Outlook, execute the VBA subroutine WriteSchedule (included in this project's WriteSchedule.bas).
This VBA goes through the next 10 days of my Outlook Calendar.
Finds all calendar items with BusyStatus="Busy".
Saves the start and end times of all busy time slots to templates/schedule.tsv.
Note: the VBA assumes there are never overlapping "Busy" calendar items.
Execute generate_online_calendar.py, which
Reads a list of the planet's timezones from function get_timezones (in timezones.py).
Writes the list of time zones to web/index.html using jinja2 and templates/index_template.html.
Reads my schedule from templates/schedule.tsv.
Consolidates all adjacent busy time slots.
Finds all free time slots.
Translates all free time slots into each timezone obtained in Step 2b.
Writes each time zone's translated schedule to web/UTC<NNN>.html using jinja2 and templates/tz_template.html, where <NNN> is the UTC offset for that time zone.
Also included in the web directory is styles.css.
Uses the neocitizen API to upload all the files in the web folder to https://davidtutor.neocities.org.