Python can automate the small, recurring jobs that involve sorting files, preparing reports, or cleaning routine exports. These seven examples use Python’s standard library, so straightforward tasks do not need extra packages. For scripts that change files, preview the proposed changes first and keep the originals until you have checked the result.
1. Preview and batch-rename files
Use this when a folder contains files that need a consistent naming pattern, such as adding a date or sequence number. Set the source folder explicitly and define one predictable rule. Python’s pathlib provides path objects, while shutil documents high-level file operations.
- Read the files in the chosen folder and calculate each proposed new name.
- Print a preview of every old-name/new-name pair. Check that no proposed destination name already exists and that two files will not receive the same name.
- Only after reviewing the preview, apply the renames. Keep the rule and folder configurable rather than hard-coding a personal path.
Expected input: files in one specified folder. Expected result: the same files with updated names. A preview helps catch an incorrect pattern before it changes the folder.
2. Sort a downloads or project folder
A sorter can move files into a small set of destination folders based on extension or another clear rule—for example, documents into one folder and images into another. The documented shutil.move operation can move files.
Recommended Free Tools
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Choose the source folder and the destination categories.
- For each file, determine its category and print the proposed source-to-destination move.
- Check the preview for uncategorized files, missing destination folders, and name collisions before running the moves.
Expected input: files from a known folder. Expected result: those files arranged in category folders. Keep the categories narrow and understandable; broad or ambiguous rules can send a file somewhere unexpected.
3. Make a dated backup copy
Before a risky edit or routine cleanup, a script can copy selected files to a separate destination, such as a dated backup folder. Python’s shutil documentation describes copy operations, but a copy should not be treated as a perfect system-level clone: metadata preservation can vary by operation, platform, and file type.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
- Specify the source files or folder and a destination separate from the originals.
- Print the files that will be copied and the destination paths; check that the destination is not an unintended overwrite.
- Copy the files, then inspect the destination before making the risky change to the source.
Expected input: selected files or a folder. Expected result: a separate copy of their contents. If preserving permissions, timestamps, or other metadata is essential, verify the behavior required for your operating system and file types rather than assuming an ordinary copy preserves everything.
4. Archive a completed project folder
For a project that is closed or a dated batch that no longer needs active editing, create a ZIP archive using Python’s standard-library zipfile module.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
- Choose the project folder and a distinct archive path.
- List or otherwise preview the files that will be included, then create the ZIP.
- Inspect the archive’s contents and confirm the files you need are present before removing or relocating any source files.
Expected input: a completed folder or batch of files. Expected result: a ZIP file containing the selected items. Archiving is not a reason to delete the source immediately; verify the archive first.
5. Clean or combine CSV exports
Use the standard-library csv module for straightforward row-level cleanup or combining exports. It can read and write CSV data without adding a dependency such as pandas when the task is limited to simple row handling.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
- Read the input files as CSV rows and identify the few fields that need normalization, such as trimming whitespace in a selected column.
- Apply an explicit duplicate rule. For example, treat rows as duplicates only when a named identifier field matches; do not silently assume that identical-looking rows should always be discarded.
- Write the cleaned or combined rows to a new output file, not over the source exports.
Expected input: one or more CSV exports with a known structure. Expected result: a fresh CSV with the specified normalization and filtering applied. Inspect the output, especially if columns or date formats differ between exports.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.6. Generate a repeatable command-line report
A report script becomes easier to reuse when it accepts input filenames and options rather than requiring edits to the code for each run. Python’s argparse module supports named command-line options and help; the Python tutorial also demonstrates command-line utility scripts.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsBest Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
- Define the inputs the report needs, such as one or more filenames, plus options such as a date range or output path.
- Use
argparseto provide those arguments and a useful help message. - Generate the report into the chosen output path while leaving the input files unchanged; check the output before relying on it.
Expected input: the files and options supplied when the script is run. Expected result: a report at the requested path. Clear argument names and help text make a script useful beyond the person who first wrote it.
7. Run a trusted external program and capture its result
If an installed program already performs a needed step, Python can run it and collect the result with subprocess.run. This is useful for connecting a small automation to an existing tool, not a reason to invoke an unfamiliar program.
- Identify the trusted executable and the exact arguments it needs.
- Pass the command as an argument sequence, and set suitable error handling and a timeout when appropriate.
- Review the program’s result or error before allowing later steps to change or delete files.
Python’s subprocess documentation recommends argument sequences as the default approach. Avoid shell=True unless there is a concrete need, and review the documented security considerations before using it.
Choose a first script that is safe to verify
Start with a task whose inputs and desired output are easy to recognize. For any operation that moves, renames, or copies files, keep the source and destination explicit, print the planned actions, handle missing paths and name collisions, and inspect the result before removing originals. A report or CSV cleanup that writes a new file is often easier to review than a script that overwrites or reorganizes the only copy.
| Task | Standard-library starting point | What to verify |
|---|---|---|
| Rename, sort, or back up files | pathlib and shutil |
Preview names or moves, check collisions, and inspect copies; copying contents does not guarantee preservation of all metadata. |
| Archive a folder | zipfile |
Confirm the archive contains the needed files before removing the source. |
| Clean CSV rows | csv |
State the normalization and duplicate rules; write a separate output file. |
| Make a reusable report command | argparse |
Check arguments, help text, and output path while preserving inputs. |
| Invoke an installed tool | subprocess |
Use an argument sequence and appropriate timeout and error handling; treat shell use with care. |
These examples are based on Python 3.14.8 documentation. The standard-library documentation establishes available tools, not a measured time saving: the reviewed sources do not quantify how much time these tasks save.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

