Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
JOHNWICK
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Automating My Workflow With Python
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
How I built tools that quietly handle the boring stuff so I can focus on real problems [[file:Automating_My_Workflow_With_Python.jpg|500px]] I’ve tried a bunch of VPNs, but this one really stands out. It lets me: ✔ Stream Netflix, YouTube & live sports from anywhere ✔ Stay 100% private — no tracking, no spying ✔ Protect all your devices at once + 1TB cloud storage ✔ Ultra-fast servers for lag-free streaming & browsing ✔ Secure banking & online payments anywhere ✔ Bypass restrictions & access content your country blocks ✔ Unlock a hidden 70%+ discount — massive savings you won’t get elsewhere Honestly, it’s the best VPN I’ve used so far. ⚡ 14M+ users are already using it worldwide. 👉 Get NordVPN with 70%+ OFF + 3 Free Month When I first started coding, I wasted hours on repetitive tasks: renaming files, cleaning data, writing boilerplate reports. Over time, I discovered that Python could do most of this for me. The more I automated, the more I realized — automation isn’t just about efficiency. It’s about freeing up brainpower for harder problems. In this article, I’ll walk through the automation systems I’ve built with Python. Each section will show code, tools, and the deeper principles behind making Python do the heavy lifting. 1. Automating File Renaming With os and pathlib Every company I’ve worked with had some form of “file naming mess.” Python fixes that in minutes. <pre> import os from pathlib import Path directory = Path("C:/reports/") for i, file in enumerate(directory.iterdir(), start=1): if file.is_file(): new_name = directory / f"report_{i}{file.suffix}" file.rename(new_name) print(f"Renamed {file} -> {new_name}") </pre> Instead of wasting time renaming 200 files manually, you let Python do it in seconds. 2. Cleaning CSVs With pandas Messy CSVs are a fact of life. Luckily, pandas makes data cleaning almost effortless. <pre> import pandas as pd df = pd.read_csv("sales.csv") # clean column names df.columns = [col.strip().lower().replace(" ", "_") for col in df.columns] # fill missing values df["revenue"] = df["revenue"].fillna(0) # remove duplicates df = df.drop_duplicates() df.to_csv("clean_sales.csv", index=False) </pre> This script takes a nightmare spreadsheet and makes it analysis-ready. 3. Generating Automated Reports Instead of copy-pasting numbers into slides, I let Python generate reports with matplotlib and jinja2. <pre> import pandas as pd import matplotlib.pyplot as plt from jinja2 import Template df = pd.read_csv("clean_sales.csv") plt.plot(df["date"], df["revenue"]) plt.savefig("plot.png") template = Template(""" <h1>Sales Report</h1> <p>Total Revenue: {{ total }}</p> <img src="plot.png"> """) html_report = template.render(total=df["revenue"].sum()) with open("report.html", "w") as f: f.write(html_report) </pre> That’s a full data report with visualization — done automatically. 4. Automating Emails With smtplib Reports are useless unless they’re shared. Python can email them automatically. <pre> import smtplib from email.message import EmailMessage msg = EmailMessage() msg["Subject"] = "Weekly Sales Report" msg["From"] = "me@example.com" msg["To"] = "team@example.com" msg.set_content("See attached report.") msg.add_attachment(open("report.html", "rb").read(), maintype="text", subtype="html", filename="report.html") with smtplib.SMTP_SSL("smtp.gmail.com", 465) as smtp: smtp.login("me@example.com", "password") smtp.send_message(msg) </pre> Now the whole team gets updates without me lifting a finger. 5. Automating Browser Tasks With selenium Some tasks can’t be done via APIs, but Python can drive the browser. <pre> from selenium import webdriver from selenium.webdriver.common.by import By driver = webdriver.Chrome() driver.get("https://example.com/login") driver.find_element(By.ID, "username").send_keys("my_username") driver.find_element(By.ID, "password").send_keys("my_password") driver.find_element(By.ID, "login-btn").click() </pre> Whether it’s scraping data or automating form submissions, selenium is the Swiss army knife for browser automation. 6. Scheduling Everything With schedule Automation is only useful if it runs without you. <pre> import schedule import time def job(): print("Running weekly automation...") schedule.every().monday.at("09:00").do(job) while True: schedule.run_pending() time.sleep(1) </pre> Now scripts execute themselves at the right time — no manual triggers needed. 7. Organizing PDFs With PyPDF2 Messy PDFs? Python can merge, split, and reorganize them. <pre> from PyPDF2 import PdfMerger merger = PdfMerger() merger.append("report1.pdf") merger.append("report2.pdf") merger.write("merged_report.pdf") merger.close() </pre> Instead of clicking through Adobe menus, this runs in one command. 8. Scaling Automations With fastapi When coworkers kept asking me for the same scripts, I turned them into APIs. <pre> from fastapi import FastAPI app = FastAPI() @app.get("/clean-data") def clean_data(): return {"status": "success", "message": "Data cleaned!"} </pre> Now anyone in the company can trigger my automation with a simple API call. Wrapping Up Python is the closest thing I’ve found to a workplace superpower. The libraries I’ve shown — os, pandas, matplotlib, jinja2, smtplib, selenium, schedule, PyPDF2, and fastapi—are all simple, but together they turn manual drudgery into automated workflows. Automation doesn’t just save time. It creates space for deeper, creative work. And once you taste that freedom, you never want to go back. Read the full article here: https://medium.com/codetodeploy/automating-my-workflow-with-python-f81ae46ae14b
Summary:
Please note that all contributions to JOHNWICK may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JOHNWICK:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Automating My Workflow With Python
Add topic