Skip to content

zejian99/script-automator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script Automator using OpenAI API

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.

What you need:

  • 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.

How to start:

  1. Clone my repo (feel free to create your own)
git clone
  1. Create a virtual environment
python3.9 -m venv .env
  1. Activate the virtual environment
source .virtual/bin/activate
  1. 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!).

  1. Get notified when your summaries are done!

Screenshot 2023-07-11 at 22 05 07

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages