10 Python Automation Projects for Beginners (With Code)

Python Automation Projects for Beginners: 10 Practical Projects With Code


Python automation projects for beginners with practical examples

Python is one of the most popular programming languages for automation. It helps you complete repetitive tasks automatically instead of doing everything manually.

For example, imagine you receive hundreds of files every day. You need to organize them into different folders, rename them, and prepare a report. Doing this manually can take a lot of time.

With Python automation, you can write a small script that performs these tasks automatically.

The best way to learn Python automation is not just by reading theory. You should build practical projects and understand how Python works in real situations.

In this guide, you will learn 10 beginner-friendly Python automation projects with practical code examples. These projects will help you understand file handling, folder management, Excel automation, web data collection, and more.

You do not need advanced Python knowledge to get started.

What Is Python Automation?

Python automation means using Python programs to perform repetitive tasks automatically.

Instead of completing the same task manually every day, you write a Python script once and run it whenever required.

For example:

  • Automatically rename multiple files.
  • Organize files into different folders.
  • Read and update Excel reports.
  • Collect information from websites.
  • Create automatic backup copies.
  • Generate reports from CSV files.
  • Send emails automatically.

Python provides several built-in modules and external libraries that make automation easier.

What Do You Need Before Starting?

Before building these projects, you should understand a few basic Python concepts.

Basic Python knowledge

You should know:

  • Variables and data types
  • If-else conditions
  • For and while loops
  • Functions
  • Lists and dictionaries
  • Basic file handling
  • Importing Python modules

You do not need to be an expert. Basic knowledge is enough to start.

Install Python

Download Python from the official website:

https://www.python.org/downloads/

After installation, open your terminal or command prompt and check the Python version:

python --version

Install useful Python libraries

Some projects use external libraries. You can install them using pip:

pip install pandas openpyxl requests beautifulsoup4

You do not need to install every library for every project. Each project explains which library is required.

1. Automatic File Organizer Using Python

Difficulty: Beginner

Python file organizer automation project

This is one of the easiest and most useful Python automation projects.

Imagine your Downloads folder contains hundreds of files, including images, PDFs, Excel files, and documents.

Finding a particular file becomes difficult.

You can use Python to automatically organize files based on their extensions.

How does it work?

The script checks every file in a folder and moves it into a category folder.

For example:

  • JPG and PNG files go into Images.
  • PDF files go into PDFs.
  • Excel files go into Excel.
  • DOCX files go into Documents.

Python code

import os
import shutil

folder_path = "Downloads"

file_categories = {
    "Images": [".jpg", ".jpeg", ".png"],
    "PDFs": [".pdf"],
    "Excel": [".xlsx", ".xls", ".csv"],
    "Documents": [".docx", ".txt", ".doc"]
}

for filename in os.listdir(folder_path):

    file_path = os.path.join(folder_path, filename)

    if os.path.isfile(file_path):

        extension = os.path.splitext(filename)[1].lower()

        for folder, extensions in file_categories.items():

            if extension in extensions:

                destination = os.path.join(folder_path, folder)

                os.makedirs(destination, exist_ok=True)

                shutil.move(file_path, os.path.join(destination, filename))

                print(filename, "moved to", folder)

Explanation

  • os.listdir() reads the files inside a folder.
  • os.path.isfile() checks whether an item is a file.
  • os.path.splitext() extracts the file extension.
  • os.makedirs() creates a folder if it does not exist.
  • shutil.move() moves the file into the destination folder.

Important: Test this script with sample files first. If a file with the same name already exists in the destination folder, the script may overwrite it. Add collision checks before using it on important files.

Real-world use

This project is useful for:

  • Organizing downloaded files.
  • Managing office documents.
  • Sorting invoices and bills.
  • Maintaining business records.

2. Automatic File Renaming Using Python

Difficulty: Beginner

Suppose you have 100 images with different names. You want to rename them using a common format.

Renaming every file manually takes time.

Python can rename multiple files in a few seconds.

Python code

import os

folder_path = "Images"

files = os.listdir(folder_path)

count = 1

for filename in files:

    old_path = os.path.join(folder_path, filename)

    if os.path.isfile(old_path):

        extension = os.path.splitext(filename)[1]

        new_name = f"Image_{count}{extension}"

        new_path = os.path.join(folder_path, new_name)

        if not os.path.exists(new_path):

            os.rename(old_path, new_path)

            print(filename, "renamed to", new_name)

            count += 1

Explanation

The script reads all files from the Images folder and renames them using a numbered format.

For example:

photo.jpg       → Image_1.jpg
holiday.png     → Image_2.png
product.jpeg    → Image_3.jpeg

The os.rename() function changes the name of a file.

Important: Run this on a test folder first. The script skips a destination name if it already exists. For production use, also check that generated names do not collide with other files in the folder.

Real-world use

  • Renaming product images.
  • Managing employee documents.
  • Organizing downloaded reports.
  • Preparing images for ecommerce catalogues.

3. Excel Report Automation Using Python

Difficulty: Beginner to Intermediate

Automating Excel reports using Python

Excel is widely used in offices for sales reports, attendance records, inventory management, and daily operations.

Imagine you receive a CSV sales report every day. You need to calculate total sales and prepare a summary.

Instead of doing it manually, you can use Python with Pandas.

Install Pandas

pip install pandas openpyxl

Sample CSV data

Suppose your file is named sales.csv and contains:

Product,Quantity,Price
Laptop,2,45000
Mouse,5,500
Keyboard,3,1200
Monitor,2,12000

Python code

import pandas as pd

df = pd.read_csv("sales.csv")

df["Total"] = df["Quantity"] * df["Price"]

total_sales = df["Total"].sum()

print(df)

print("Total Sales:", total_sales)

df.to_excel("sales_report.xlsx", index=False)

Expected output

   Product  Quantity  Price  Total
0   Laptop         2  45000  90000
1    Mouse         5    500   2500
2 Keyboard         3   1200   3600
3  Monitor         2  12000  24000

Total Sales: 120100

The script reads the CSV file, calculates the total amount for each product, adds a new column, and exports the result to Excel.

Real-world use

This project is useful for:

  • Daily sales reports.
  • MIS reporting.
  • Inventory analysis.
  • Attendance reports.
  • Business performance tracking.

If you work in operations or data analysis, Excel automation is especially useful because many daily reports involve repetitive calculations.

4. Automatic Folder Backup Using Python

Difficulty: Beginner

Python automatic folder backup project

Taking backups is important because important files can be deleted or damaged accidentally.

You can create a Python script that copies files from one folder to another.

For example, you can back up your Documents folder into a Backup folder.

Python code

import os
import shutil

source_folder = "Documents"

backup_folder = "Backup"

os.makedirs(backup_folder, exist_ok=True)

for filename in os.listdir(source_folder):

    source_path = os.path.join(source_folder, filename)

    destination_path = os.path.join(backup_folder, filename)

    if os.path.isfile(source_path):

        shutil.copy2(source_path, destination_path)

        print(filename, "backup completed")

print("Backup process completed")

Explanation

  • os.listdir() reads files from the source folder.
  • os.makedirs() creates the backup folder.
  • shutil.copy2() copies a file and preserves its basic metadata.

Important: This simple example is suitable for learning. If a destination file already exists, it may be replaced. A production backup system should use unique backup names, compare file changes, or maintain dated backup folders.

Real-world use

  • Backing up office reports.
  • Saving important Excel files.
  • Creating project backups.
  • Maintaining business documents.

5. Web Data Collection Using Python

Difficulty: Intermediate

Python web data collection beginner project

Sometimes you need to collect information from websites.

For example, you may want to collect product names, article titles, or publicly available information from a webpage.

Python provides libraries such as Requests and Beautiful Soup for this purpose.

Install required libraries

pip install requests beautifulsoup4

Python code

import requests
from bs4 import BeautifulSoup

url = "https://example.com"

response = requests.get(
    url,
    timeout=10,
    headers={"User-Agent": "Mozilla/5.0"}
)

response.raise_for_status()

soup = BeautifulSoup(response.text, "html.parser")

headings = soup.find_all("h2")

for heading in headings:

    print(heading.get_text(strip=True))

Explanation

  • requests.get() sends a request to the webpage.
  • response.raise_for_status() reports HTTP errors.
  • BeautifulSoup() parses the HTML content.
  • find_all("h2") finds all H2 heading elements.
  • get_text() extracts readable text.

The example website may not contain H2 headings, so the script may return no results.

Important: Only collect data when you have permission. Follow the website's terms, robots.txt guidance, rate limits, and applicable privacy and copyright rules. Some websites block automated requests.

Real-world use

  • Collecting public article headings.
  • Researching publicly available information.
  • Monitoring permitted website content.
  • Learning how HTML data is structured.

6. Automatic Email Sending Using Python

Difficulty: Intermediate

Automatic email sending with Python

Sending the same type of email repeatedly can take time.

For example, you may need to send a daily report to a manager or share an update with a team.

Python can send emails through an SMTP server.

Python code

import smtplib
from email.message import EmailMessage

sender_email = "your_email@example.com"

receiver_email = "receiver@example.com"

app_password = "YOUR_APP_PASSWORD"

message = EmailMessage()

message["Subject"] = "Daily Report"

message["From"] = sender_email

message["To"] = receiver_email

message.set_content(
    "Hello,\n\nPlease find the daily report update.\n\nRegards"
)

with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:

    server.login(sender_email, app_password)

    server.send_message(message)

print("Email sent successfully")

Explanation

  • smtplib connects to an SMTP email server.
  • EmailMessage creates the email content.
  • SMTP_SSL() creates a secure connection.
  • login() authenticates the email account.
  • send_message() sends the email.

For Gmail, use an eligible Google App Password rather than your normal account password. App Passwords require the relevant Google account security setup. Never share or hardcode real credentials in a script that you publish or distribute.

Real-world use

  • Sending daily reports.
  • Sending business updates.
  • Sharing automated notifications.
  • Sending scheduled reminders.

7. Automatic CSV Report Generator

Difficulty: Beginner

CSV files are commonly used to store business and operational data.

Imagine you receive daily order information in a CSV file. You want to calculate total orders and create a simple summary report.

Python can perform this task automatically.

Sample CSV data

Order_ID,Status,Amount
101,Delivered,500
102,Returned,300
103,Delivered,700
104,Pending,400
105,Delivered,600

Python code

import pandas as pd

df = pd.read_csv("orders.csv")

total_orders = len(df)

delivered_orders = len(
    df[df["Status"] == "Delivered"]
)

returned_orders = len(
    df[df["Status"] == "Returned"]
)

total_amount = df["Amount"].sum()

print("Total Orders:", total_orders)

print("Delivered Orders:", delivered_orders)

print("Returned Orders:", returned_orders)

print("Total Amount:", total_amount)

summary = pd.DataFrame({
    "Metric": [
        "Total Orders",
        "Delivered Orders",
        "Returned Orders",
        "Total Amount"
    ],
    "Value": [
        total_orders,
        delivered_orders,
        returned_orders,
        total_amount
    ]
})

summary.to_csv("summary_report.csv", index=False)

Expected output

Total Orders: 5
Delivered Orders: 3
Returned Orders: 1
Total Amount: 2500

The program calculates the number of orders, delivered orders, returned orders, and total order amount.

It then saves the results in a new CSV file.

Real-world use

  • Daily order reports.
  • Delivery performance reports.
  • Return analysis.
  • Sales summaries.
  • Operations reporting.

8. Automatic Desktop Notification Using Python

Difficulty: Beginner

Notifications can remind you about important tasks.

For example, you may want a notification when a report is ready or when a long-running process is complete.

You can use the plyer library to create desktop notifications.

Install the library

pip install plyer

Python code

from plyer import notification

notification.notify(
    title="Python Automation",
    message="Your daily report is ready!",
    timeout=10
)

print("Notification displayed")

Explanation

  • notification.notify() displays a desktop notification.
  • title defines the notification title.
  • message contains the notification text.
  • timeout controls how long the notification is requested to remain visible.

Notification support can depend on your operating system and desktop settings.

Real-world use

  • Report completion alerts.
  • Task reminders.
  • Application notifications.
  • Backup completion messages.

9. Automatic Text File Search Using Python

Difficulty: Beginner

Imagine you have many text files and need to find a particular word or sentence.

Opening every file manually takes time.

Python can search through multiple text files and identify which files contain the required keyword.

Python code

import os

folder_path = "Documents"

search_word = "Python"

for filename in os.listdir(folder_path):

    file_path = os.path.join(folder_path, filename)

    if os.path.isfile(file_path) and filename.endswith(".txt"):

        file = open(file_path, "r", encoding="utf-8")

        content = file.read()

        file.close()

        if search_word.lower() in content.lower():

            print("Word found in:", filename)

Explanation

  • os.listdir() reads the folder contents.
  • os.path.isfile() checks whether an item is a file.
  • endswith(".txt") filters text files.
  • open() reads the file.
  • lower() makes the search case-insensitive.

This example uses open() and close() explicitly. In larger applications, use a with open(...) statement so the file closes safely even if an error occurs.

Real-world use

  • Searching employee records.
  • Finding keywords in reports.
  • Searching log files.
  • Checking text documents.

10. Automatic Website Status Checker

Difficulty: Beginner to Intermediate

Sometimes a website may become unavailable. You can write a Python script to check whether a website responds successfully.

This is a simple introduction to website monitoring.

Python code

import requests

websites = [
    "https://www.python.org",
    "https://www.google.com",
    "https://example.com"
]

for website in websites:

    try:

        response = requests.get(
            website,
            timeout=10
        )

        if response.status_code == 200:

            print(website, "is responding")

        else:

            print(
                website,
                "returned status:",
                response.status_code
            )

    except requests.RequestException:

        print(website, "could not be reached")

Explanation

  • requests.get() sends an HTTP request.
  • timeout=10 prevents the request from waiting indefinitely.
  • status_code provides the HTTP response status.
  • try-except handles connection-related errors.

A successful HTTP response does not always mean that every part of a website is working correctly. This script checks basic HTTP availability, not full application health.

Real-world use

  • Checking business websites.
  • Monitoring internal tools.
  • Testing website availability.
  • Learning basic web monitoring.

Which Python Automation Project Should You Build First?

If you are a beginner, start with projects that use Python's built-in modules. After understanding those, move to external libraries.

ProjectDifficultyMain Python tool
File OrganizerBeginneros, shutil
File RenamingBeginneros
Excel AutomationBeginner–Intermediatepandas
Folder BackupBeginneros, shutil
Web Data CollectionIntermediaterequests, BeautifulSoup
Email AutomationIntermediatesmtplib
CSV Report GeneratorBeginnerpandas
Desktop NotificationBeginnerplyer
Text File SearchBeginneros
Website Status CheckerBeginner–Intermediaterequests

How to Learn Python Automation Step by Step

You do not need to build all 10 projects in one day. Follow a simple learning roadmap.

Step 1: Learn Python fundamentals

Start with variables, conditions, loops, functions, lists, dictionaries, and basic file handling.

Step 2: Learn built-in Python modules

Understand these modules:

  • os – Manage files, folders, and operating-system tasks.
  • shutil – Copy, move, and manage files.
  • pathlib – Work with file and folder paths.
  • csv – Read and write CSV files.
  • datetime – Work with dates and times.

Step 3: Learn useful external libraries

After learning the basics, explore:

  • Pandas for data analysis and Excel/CSV workflows.
  • OpenPyXL for editing Excel workbooks.
  • Requests for HTTP requests.
  • Beautiful Soup for parsing HTML.
  • Plyer for desktop notifications.

Step 4: Build small projects

Start with the file organizer, file renaming, and CSV report generator.

Do not just copy and paste the code. Change folder names, add new conditions, and try different sample data.

Step 5: Build a complete automation project

Combine multiple concepts into one project.

For example, create an automated daily operations report that:

  1. Reads an order CSV file.
  2. Calculates delivered and returned orders.
  3. Calculates total sales.
  4. Creates an Excel report.
  5. Saves the report in a dated folder.
  6. Sends an email notification.

This is a practical project that connects Python automation with real business reporting.

Common Mistakes Beginners Should Avoid

1. Copying code without understanding it

Try to understand what each function does before running the complete program.

2. Using incorrect file paths

A wrong folder path can cause a FileNotFoundError.

Use os.path.exists() or pathlib.Path.exists() to check whether a path exists.

3. Ignoring errors

Use try-except where an operation can fail, such as reading files or connecting to websites.

4. Testing on important files

Never test file-renaming, moving, or deletion scripts on important business data.

Create a separate test folder and use sample files first.

5. Storing passwords directly in code

Do not publish scripts containing real email passwords, API keys, or other credentials.

Use environment variables or a secure secrets manager.

6. Running automation without checking the output

Always verify the generated report, copied files, or email before relying on the automation.

10 Python Automation Practice Challenges

After completing the projects, try these challenges:

  1. Create a script that separates images by file extension.
  2. Rename all PDF files using today's date.
  3. Calculate total sales from an Excel workbook.
  4. Create a backup folder for every month.
  5. Search for a keyword in multiple text files.
  6. Generate a daily attendance summary.
  7. Create an automatic inventory report.
  8. Send a notification when a report is generated.
  9. Check the status of multiple permitted websites.
  10. Create a daily order report and save it as an Excel file.

These challenges will help you improve your problem-solving skills.

Frequently Asked Questions (FAQs)

1. Is Python good for automation?

Yes. Python is widely used for automation because it has simple syntax, useful built-in modules, and many external libraries.

2. Can beginners learn Python automation?

Yes. Beginners can start with simple projects such as file organization, file renaming, and CSV report generation.

3. Do I need advanced Python knowledge for automation?

No. Basic knowledge of variables, loops, conditions, functions, and file handling is enough to start many beginner projects.

4. Which Python library is best for automation?

There is no single best library. It depends on your task. Use os and shutil for file operations, Pandas for data reports, Requests for HTTP tasks, and OpenPyXL for Excel workbook editing.

5. Can Python automate Excel reports?

Yes. Python libraries such as Pandas and OpenPyXL can read, process, update, and create Excel reports.

6. Can Python automate daily office work?

Yes. Python can help automate repetitive office tasks such as file management, report preparation, data cleaning, and notifications.

7. How long does it take to learn Python automation?

It depends on your previous programming experience and practice time. You can start with simple automation scripts after learning basic Python concepts.

8. Is Python automation useful for data analysts?

Yes. Data analysts can use Python to clean datasets, process Excel and CSV files, generate reports, and automate repetitive data tasks.

9. Can Python run automation automatically every day?

Yes. You can schedule Python scripts using Windows Task Scheduler, cron on Linux, or other scheduling tools.

10. Can I build real-world projects with Python automation?

Yes. You can build file management systems, automated reporting tools, backup systems, email notifications, and data processing workflows.

Conclusion

Python automation is a useful skill for beginners, students, office professionals, and data analysts.

The best way to learn it is by building small projects and gradually increasing their complexity.

Start with a file organizer, then try Excel automation, CSV report generation, and email automation.

Once you understand these concepts, you can combine them to build complete business automation solutions.

Remember, learning Python is not only about writing code. It is about using code to solve real problems and save time.

Keep learning, keep building, and keep automating with ITTECHLanguage!

Post a Comment

Ask any query by comments

Previous Post Next Post