Python Automation with ChatGPT

TechWorld with Nana March 7, 2023
Video Thumbnail
TechWorld with Nana Logo

TechWorld with Nana

@techworldwithnana

About

Helping millions of engineers to advance their careers with DevOps & Cloud education 💙 I create new videos every month, topics include mainly DevOps and Cloud tutorials. Subscribe and activate bell notification so you don't miss new videos :) I'm a Docker Captain, AWS Container Hero 🤓 💪 ► https://www.techworld-with-nana.com/ Some topics covered: - Docker - Kubernetes - CI/CD - GitLab CI, GitHub Actions, Jenkins - Python - Ansible - Prometheus Monitoring - Terraform - YAML - & more! Have fun watching my videos! 🙂

Video Description

Python Automation with ChatGPT | Write Python code to connect to OpenAI API and generate automation scripts in seconds! #python #chatgpt #techworldwithnana ▬▬▬▬▬▬ PRE-REQUISITES ⏰ ▬▬▬▬▬▬ ► Python Programming Tutorial: https://youtu.be/t8pPdKYpowI ► ChatGPT Tutorial: https://youtu.be/l-kE11fhfaQ In this video we are going to learn how to use Python to automate things for us so we don't have to do them manually. We're going to automate 2 use cases: First we will write a Python program that takes any blog article or any web page and it extracts all the headers from that page or article and then it translates all those headers to Spanish and saves it into its own HTML file so you can open it in the browser and basically see all the headers of that specific blog article translated in Spanish. In the second use will be that we're going to write a Python program that goes through all the files in our downloads folder it then checks if we have any files that are older than 30 days or were last used more than 30 days ago and it takes all these files and puts that into a new folder called "to_delete" which we can then review and basically delete if needed. So basically it helps us clean up our messy downloads folder with a bunch of old downloaded files in there. But here's even more interesting thing we will do we will use an artificial intelligence tool that you probably have already heard of a million times called ChatGPT and we will tell Python to use ChatGPT's API or the underlying API that ChatGPT is also using to generate the Python scripts for those two use cases that I mentioned. ▬▬▬▬▬▬ L I N K S 🔗 ▬▬▬▬▬▬ ► Git Repo for this tutorial: https://gitlab.com/nanuchi/python-automation-chatgpt ► OpenAI API: https://platform.openai.com/docs/introduction/overview ► Requests Python library: https://requests.readthedocs.io/en/latest/api/ ► BeautifulSoup library: https://www.crummy.com/software/BeautifulSoup/bs4/doc/ ▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬ 0:00 - Intro - What we are automating? 02:37 - Why Python for Automation? 04:39 - Connect to OpenAI API 06:45 - Create account and API key 08:07 - Pre-Requisites for demo 09:15 - Write Python script to connect to OpenAI 33:29 - Install Library 35:17 - Execute Python Script 40:15 - Accept Prompt Input to send to OpenAI 53:11 - UC 1: Python Automation Script for Blog Post Translation 1:08:01 - UC 2: Python Automation Script for Cleaning Downloads Folder ▬▬▬▬▬▬ Want to learn more? 🚀 ▬▬▬▬▬▬ Full Python course ► https://youtu.be/t8pPdKYpowI Full Docker course ► https://youtu.be/3c-iBn73dDE Full K8s course ► https://youtu.be/X48VuDVv0do DevOps Tools explained ► https://bit.ly/2W9UEq6 ▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬ Join private FB group ► https://bit.ly/32UVSZP INSTAGRAM ► https://bit.ly/2F3LXYJ TWITTER ► https://bit.ly/3i54PUB LINKEDIN ► https://bit.ly/3hWOLVT ▬▬▬▬▬▬ Courses & Ebooks & Bootcamp 🚀 ▬▬▬▬▬▬ ► Become a DevOps Engineer - full educational program 👉🏼 https://bit.ly/45mXaer ► High-Quality and Hands-On Courses 👉🏼 https://bit.ly/3BNS8Kv ► Kubernetes 101 - compact and easy-to-read ebook bundle 👉🏼 https://bit.ly/3Ozl28x

You May Also Like