March 26, 2023
Generated using OpenAI DALL.E2
With the advant of Generative Pre-trained Transformer (GPT) and Large Langauge Model (LLM), we have a powerful tool at our disposal as Software Engineers. In this article, I will try and demonstrate how we can improve our workflows to increase our productivity by using GPT.
I would like to download invoices for my broadband connection from Gmail for the Financial Year (March 2022 - March 2023) and store it in a folder for my records. The invoices are password protected, hence I would like to remove passwords from those invoices before storing it in the destination folder.
Lets take a moment to think about how you would approach this use case. I believe I had below approaches as options
At some point while doing this, my pride as a software engineer would start hurting 😀. So, lets look at Approach 2
However, if approach 2 fails, you will have to fall back to Approach 3 [ I am not considering funny ideas like outsourcing this to some junior developer in your team or a freelancer 😉 ]
... So on and So forth. You get the idea.
Lets look at how we will be approaching such use cases in future
I have some emails in my gmail inbox which I can query by using the filter "from:firstname.lastname@example.org after:03-01-2022 has:attachment". I would like to download attachments from those emails in a destination folder and remove password from the pdf attachments.
The experience is something that I have captured in the below video. You can find the generated code here in the gist file.
I followed the instructions and generated
credentials.json from Google Developer portal. I also removed
pyocr from generated code since it was not used anywhere. (If you prompt this fact to GPT-4, it apologises and removes it from the dependencies and codebase. A pretty sweet AI.)
After bit of tweaking around, and asking GPT-4 for help, I was able to get this running smoothly and was able to download all the decrypted attachments in a directory.
Here is the gist of final code. This is pretty much generated by GPT-4 with minimum tweaks done by me.
So there you go. GPT as a tool can be a proficient Co-Pilot in wide areas of Software Engineering. Hope you have fun with it.
_ _ _ _
Thank you so much for taking time to go through this.❤️ If you feel there is some typo in this article, or some of the content can be improved, please feel free to Edit this Post. Or you can go back to continue reading other articles. 😀