DEV Community

David García
David García

Posted on

Python + AI: 6 automations any freelancer can ship this week

```html

Let’s be honest. As a freelancer – whether you’re a developer, consultant, or just a really good problem solver – your time is gold. Spending hours on repetitive tasks is a surefire way to drain your productivity and your profits. AI isn't some distant future concept; it's a powerful tool to reclaim that time, and Python makes it ridiculously easy to wield. This article focuses on six automations you can actually build this week, specifically tailored for the kind of work we freelancers do.

The Problem: Time Suckers Galore

We all have them. Those nagging tasks that pull us away from the actual work we’re paid to do. Maybe it’s manually renaming hundreds of files in a project folder. Perhaps it’s scraping data from a website and formatting it into a spreadsheet. Or maybe it's constantly checking for updates on a particular project or tool. These seemingly small things add up fast, eating into your billable hours and leaving you stressed.

Automation 1: Batch File Renaming

Let's tackle a classic: batch renaming files. Imagine a directory filled with images named “image_1.jpg”, “image_2.jpg”, etc. You need to rename them to “photo_001.jpg”, “photo_002.jpg”, and so on. Manually doing this is a nightmare.


import os

def batch_rename(directory, prefix):

for filename in os.listdir(directory):

if filename.endswith(".jpg"):

new_name = f"{prefix}{filename.split('.')[0]:03d}.jpg"

os.rename(os.path.join(directory, filename), os.path.join(directory, new_name))

Example usage:

batch_rename("/path/to/your/images", "photo")

Explanation: This Python script iterates through all `.jpg` files in a specified directory. It prefixes each filename with "photo" and pads the number with leading zeros to ensure a consistent format (e.g., "photo_001.jpg"). The `os.rename()` function then renames the file. Remember to replace `/path/to/your/images` with the actual path.

Practical Results:

Renaming 100 images in 5 minutes instead of 45. Seriously.

Other Automations (Briefly):

We could cover website scraping, automated email checking, spreadsheet updates, and even basic project status reporting. The key is identifying those repetitive tasks that consume your time.

Conclusion: Level Up Your Freelance Game

Python and AI automation aren’t about replacing your skills; they're about amplifying them. By automating the mundane, you free up your brainpower to focus on the strategic, creative, and revenue-generating aspects of your work. Want to take your automation game to the next level and ensure your systems are secure and efficient? Schedule a free consultation today – let's discuss how we can optimize your workflow and boost your bottom line.

```


Itelnet Consulting

Top comments (0)