Hello! I created this repository to automate my bi-weekly log submissions using OpenAI. My script will run once every 2 weeks, once the summaries are completed, the original .txt
files will be removed, the summary will be saved in another folder.
- OpenAI API Key (You will be charged a bit of money for every query)
- App Password (if you are using Gmail), you can use any other email providers.
- Clone my repo (feel free to create your own)
git clone
- Create a virtual environment
python3.9 -m venv .env
- Activate the virtual environment
source .virtual/bin/activate
- I used cron to automate my task.
crontab -e
Enter the following in the terminal:
30 1 1,15 * * path/to/venv/.virtual/bin/python3 path/to/generate_summary.py >> ~/out.txt 2>&1
This would ensure that the script is ran once every 2 weeks, reference from: stackoverflow, the ~/out.txt 2>&1
is for debugging purposes, reference from: unix stackoverflow
Note: If you run crontab jobs locally on your machine, if your machine is on sleep mode or turned off, if the timing is missed, the job will be skipped. Make sure to have your computer on if you wish to run it locally. If not, there are other services such as AWS that you can explore (paid, though!).
- Get notified when your summaries are done!