- Home
- Skills
- Workflow Automation
- Python Automation: Safe Scripts for Boring Office Tasks
Works with the AI Agents you already use
Python Automation: Safe Scripts for Boring Office Tasks
Automate file management, document generation, and data processing with safe, dry-run enabled Python scripts.
Free
Python Automation: Safe Scripts for Boring Office Tasks
Example session with this skill installed
I have 200 CSV files in a folder. I need to merge them into one Excel file, add a column showing which file the data came from, and handle UTF-8 encoding. Give me a script for this.
- Read your context and instructions
- Compiled the python automation
- Generated the data export
I have created a Python script to merge your CSV files into a single Excel workbook. The script includes a dry-run mode, encoding handling for UTF-8, and automatically adds a source_file column to track the origin of each row.
CSV Merger Script
import pandas as pd
import argparse
from pathlib import Path
import logging
def merge_csvs(input_dir, output_file, dry_run=True):
path = Path(input_dir)
files = list(path.glob("*.csv"))
print(f"Found {len(files)} CSV files.")
if dry_run:
print("[DRY RUN] Would merge the following files:")
for f in files:
print(f" - {f.name}")
return
all_df = []
for f in files:
try:
df = pd.read_csv(f, encoding='utf-8-sig')
df['source_file'] = f.name
all_df.append(df)
logging.info(f"Processed {f.name}")
except Exception as e:
logging.error(f"Failed to read {f.name}: {e}")
if all_df:
merged = pd.concat(all_df, ignore_index=True)
merged.to_excel(output_file, index=False, engine='openpyxl')
print(f"Successfully merged {len(all_df)} files into {output_file}")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--input", default="./data", help="Directory containing CSVs")
parser.add_argument("--output", default="merged_output.xlsx", help="Output Excel file path")
parser.add_argument("--apply", action="store_true", help="Execute the merge")
args = parser.parse_args()
merge_csvs(args.input, args.output, dry_run=not args.apply)
Next steps
- Install dependencies using
pip install pandas openpyxl. - Run
python automate_merge.py --input ./your_folderto preview the file list. - Execute
python automate_merge.py --input ./your_folder --applyto generate the Excel file.
python-automation-safe-scripts-for-borin.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual data entry and repetitive file management waste hours of engineering and operations time. This skill generates hardened Python scripts to handle the office tasks that don't justify a full SaaS subscription but are too complex for simple shell scripts. It focuses on safety by enforcing dry-runs, logging, and undo capabilities for every automation.
What it does
- File Organization batches renames, moves, and sorting based on metadata or content patterns.
- Data Wrangling merges or splits massive Excel and CSV files while preserving column alignment and source tracking.
- Document Generation executes mail-merges from spreadsheet data into Word or PDF templates.
- Media Processing handles batch image resizing, format conversion, and watermarking using Pillow.
- PDF Extraction pulls structured data and tables from PDFs into clean CSV files.
How it works
- Scope definition identifies the source files, required output format, and target operating system.
- Script generation produces a standalone Python file using
argparsefor safe command-line execution. - Safety verification runs the script in
--dry-runmode to preview changes without modifying data. - Deployment creates a
requirements.txtand a scheduler config (cron or Task Scheduler) for recurring tasks.
Frameworks & tools
Built with Python 3.9+ using standard libraries like pathlib and argparse. Specialized tasks use pandas, openpyxl, python-docx, pypdf, and Pillow.
Why this beats prompting it yourself
Generic prompts often ignore edge cases like encoding errors, date formatting, and name collisions. This skill explicitly builds in safety features like undo logs and dry-run modes, ensuring you don't accidentally delete production data or lose original files.
Use cases
- Renaming thousands of invoices based on date and vendor name.
- Consolidating 50 regional sales spreadsheets into one master report.
- Generating personalized PDF contracts for a list of 200 employees.
- Batch converting a folder of high-res images for web use.
Known limitations
Does not support GUI automation or heavy browser-based scraping. Requires a local Python environment to execute the generated scripts.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Workflow Automation.
Requires local Python 3.9+ installation. Does not support GUI-based automation (RPA) or complex web scraping beyond simple requests.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 1 day ago
- Free with an Agensi account