Automate filling in the PDF forms with hours from Clockify
Table of Contents
At Tilburg Science Hub, we track our working hours in Clockify. In the past, to be paid for the hours we worked, we had to manually complete the form each month, based on our Clockify records. Then, the form had to be signed by our supervisor. Finally, we had to send the signed form to HR services before the 5th of each month.
However, as our team grew, this process became messy with sending the forms back and forth. Not only was it time-consuming for us to manually enter the hours from Clockify and convert them to decimals, but it was also labour-intensive for our supervisors to receive and sign each form separately.
Therefore, we decided to create a script, which will retrieve our working hours via Clockify API and fill in the PDF forms for each of us. This way, one person can run the script on the 1st of each month and send all of the forms to a supervisor at once.
To get a local copy up and running follow the steps:
In order to be able to run the script, you need to install the pdfrw and holidays libraries.
pip install pdfrw
pip install holidays
- Generate your Clockify API key in Profile Settings.
Warning: in order to access Billable Hours, you need to have an Admin role in Clockify.
- Store your API key as an environment variable called Clockify_API_Key.
Learn how to Configure Environment Variables.
- Clone the repository.
git clone https://github.com/tilburgsciencehub/clockify-pdf-automation
The following workflow describes a new process of getting the forms signed:
- Everyone: By the end of each month, make sure you logged all your hours.
- One assigned person: Run the script on the 1st of each month.
- One assigned person: Share all the forms with a supervisor (typically Hannes or Tobias).
- One assigned person: Receive the forms back from a supervisor and share them with the rest of Research Assistants.
- Everyone: Send the form to HR services before the 5th of each month.