Back to articles
10 Python Automation Scripts That Save Me Hours Every Week
NewsTools

10 Python Automation Scripts That Save Me Hours Every Week

via Dev.to BeginnersAlex Spinov

I used to waste 3 hours a day on repetitive tasks Last year I was manually renaming files, checking APIs, parsing CSVs, and monitoring websites. Then I wrote 10 Python scripts that now run on autopilot. Here's the exact list — with working code you can copy right now. 1. Bulk File Renamer (15 lines) I had 2,000 photos from a client named IMG_3847.jpg . Needed them as project-001.jpg . import os from pathlib import Path folder = Path ( ' photos ' ) for i , f in enumerate ( sorted ( folder . glob ( ' *.jpg ' )), 1 ): f . rename ( folder / f ' project- { i : 03 d }{ f . suffix } ' ) print ( f ' Renamed: { f . name } -> project- { i : 03 d }{ f . suffix } ' ) Time saved: 45 minutes per batch. 2. API Health Checker I monitor 12 APIs for a side project. This script pings all of them and sends me a Slack alert if any goes down. import requests endpoints = [ ' https://api.github.com ' , ' https://jsonplaceholder.typicode.com/posts/1 ' , ' https://httpbin.org/get ' , ] for url in endpoints : tr

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
6 views

Related Articles