This python script can duplicate your work schedule from a CSV file to an Apple Calendar.
Disclaimer: I simply made this script for myself but I felt like I should share it. I did not create it to fit many different use cases, such as 24h time. Perhaps in the future I could add customizability to it.
- Run
htocal
from its directory. You must specify the CSV file as its command line argument-f
.
For example: htocal -f hours.csv
-
This command will generate an ICS file which will appear in the output directory within the htocal directory.
-
Open the ICS file to add it to Apple's Calendar app.
-f
, --file
: The CSV file which contains your hours.
-wl
, --worklocation
: The address of your workplace. This argument must only be specified once because it will persist to the config file.
Your CSV must have the following columns:
The format of the "Date" column must be Day, Mon, dd, yyyy
.
For example: Sat, Apr 2, 2022
This column is the time that your shift starts. It needs to be in 12h format.
This column is the time that your shift ends. It needs to be in 12h format.
I find that creating Excel files to track my hours and pay is more powerful, quick, and convenient over the user interface of Apple Calendar. I export the Excel file to a CSV after logging my hours and run htocal
. This allows me to mirror my spreadsheet with my calendar. Afterwards, I use iOS Shortcuts to automate my alarms to go off 2 hours before any shift.