Published in


5 Killer Automation Scripts in Python

Here are some awesome automation scripts that you can use in your Python projects.

While making projects, we need some ready-made codes that can help us to solve our daily life problems. This article has 5 Automation Scripts for your Python Projects that will solve your problems.

Part 2 of this article —

So bookmark it and let’s get started.

1.) Convert Images to PDF

If you had a lot of images and looking for converting them into a single Pdf then this automation script will be handy for you.

Method 1-

import os
import img2pdf
with open("out.pdf", "wb") as file:
file.write(img2pdf.convert([i for i in os.listdir('Path of image_Directory') if i.endswith(".jpg")]))

Method 2 -

from fpdf import FPDF
Pdf = FPDF()
list_of_images = ["one.jpg", "second.jpg","third.jpg"]for i in list_of_images:
Pdf.output("out.pdf", "F")

2.) Convert PDF to CSV

Sometimes we need to convert our PDF data into CSV format, So for that kind of work, this Python script will be handy for you.

import tabulafilename = input("Enter File Path: ")df = tabula.read_pdf(filename, encoding='utf-8', spreadsheet=True, pages='1')

3.) YT Video Downloader

A simple automation script to download Youtube videos. No need of any websites or apps, just use the below code to download any video.

import pytubelink = input('Enter The Youtube Video URL')
dn = pytube.Youtube(link)
print('Your Video Has Been Downloaded', link)

4.) InstaDpViewer

This script will download the DP of any Instagram User. It uses module instaloader which takes username as input and downloads the DP as an output.

import instaloaderil = instaloader.Instaloader()
username = input("Enter Insta username ")
il.download_profile(username , profile_pic_only=True)
print("Your DP is Downloaded")

5.) Text to Speech

It uses google Text to Speech API to convert your written Text to AI bot voice.

from pygame import mixer
from gtts import gTTS
def main():
tts = gTTS('Like This Article')'output.mp3')
if __name__ == "__main__":

Final Thoughts

Well, here are some Awesome Automation Python Scripts that can be helpful for you to build your projects. I hope you find this article helpful and have had learn some new things. Share this article with your Pythoneer Friends.

Happy Coding!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store