Python script that fetches your public Google or iCloud calendar and creates an html display web page that can be displayed on screens, such as an iPad in your office window.
This is a project that has been showing my calendar, availability and whereabouts on my office door (on an old iPad) since 2018. The script queries my public iCloud calendar about my current activity and the next 6 upcoming activities. Based on keywords - e.g. 'lunch' in activity, 'outside the office' in location, 'meeting' in activity and more - the script sets my status as 'busy', 'available' and more. Lastly it creates an updated html file, which get uploaded to my server.
I'm not a coder! I just like to create stuff. :)
- Python 3.x
- Bootstrap
If you'd like to run it yourself, there are some things to modify. I'll try to make this short and sweet.
The script uploads your html files to your web server via SFTP.
You need a public iCloud or Google calendar. After that, copy the adress and paste in the config.yml (see below). If you use an iCloud calendar, replace webdav:// for https://
pytz, paramiko, pyyaml, datetime, icalevents, locale, signal, time
- Download all files
- Open config.yml
- Change the settings, such as localization, paths to directories, address to your calendar and more
- Open main.py
- check_time_to_run() | a function that sets when the script can actually run. Change the variables off_hours and off_days so that the script runs when you want it to
- calendar() | is the main function that queries your calendar. You set your keywords in the if-statements about line 140-190.
A tip is to comment out the file_upload() function in the Main() loop at the bottom and just check that everything works in the terminal or whatever you run your code in.
-
Open index.php in the folder upload_to_webserver directory
- Change headlines and static text
- Change the paths so that they point to your files on your server
- If you don't want the video background of me waving to y'all, you can change that too. :)
-
Upload the files in upload_to_webserver to your webserver
-
If you commented out the file_upload() function in the Main() loop, undo that and try the whole script.
1.0 Initial upload