Python script generator that runs and tests the script for you
Renaming 400 files, merging monthly CSVs, pulling numbers out of PDFs: these are ten-minute scripts if you know Python and a lost afternoon if you don't. Describe the job, attach sample files, and your todo.is agent writes a clean script, runs it in its workspace on your samples, and gives you both the result and the code to reuse.
The prompt
- Write a Python script that [WHAT THE SCRIPT SHOULD DO]. Input: [INPUT FILES OR DATA] (samples attached). Output: [OUTPUT YOU WANT]. It will run on [WHERE IT WILL RUN]. Use only the standard library plus well-known packages if needed, and list them in a requirements.txt. Add comments, clear error messages and a --dry-run option if it changes files. Run it on my samples in your workspace, show me the output, and send me the .py file with a short README on how to run it.
What to change
- [WHAT THE SCRIPT SHOULD DO]: E.g. "merge all monthly sales CSVs into one file and add a 'month' column from the file name".
- [INPUT FILES OR DATA]: E.g. "12 CSV files named sales_2026_01.csv to sales_2026_12.csv". Attach 2-3 samples.
- [OUTPUT YOU WANT]: E.g. "one combined Excel file with a summary sheet" or "renamed files in the same folder".
- [WHERE IT WILL RUN]: E.g. "my Windows laptop with Python 3.12", "a Mac", "a Linux server". Or "just run it for me".
Example result
- merge_sales.py: what it does
- Reads every sales_YYYY_MM.csv in a folder, adds a month column from the file name, stacks them into one table and writes an Excel file with a Summary sheet.
- Run it
- • Install once: pip install -r requirements.txt (pandas, openpyxl)
- • Preview: python merge_sales.py ./sales --dry-run
- • Run: python merge_sales.py ./sales --out sales_2026_all.xlsx
- The core of the script
- for path in sorted(folder.glob("sales_*_*.csv")):
- m = re.match(r"sales_(\d{4})_(\d{2})\.csvquot;, path.name)
- if not m:
- print(f"Skipping {path.name}: name doesn't match sales_YYYY_MM.csv")
- continue
- df = pd.read_csv(path, encoding="utf-8-sig")
- df["month"] = f"{m[1]}-{m[2]}"
- frames.append(df)
- Test run on your 12 sample files
- • 18,402 rows merged, columns: date, sku, qty, price, month
- • sales_2026_04.csv used ; as the separator: the script detects it and reads it correctly
- • 6 rows had an empty price: kept, and listed in a Check these sheet
- • Summary sheet: total quantity and revenue per month, plus the top 10 SKUs
- Safety
- • The script never changes or deletes your original CSVs
- • It stops with a clear message if the output file is already open in Excel
- • --dry-run lists the files it would read and the row counts, without writing anything
- Files you get
- • merge_sales.py, requirements.txt, README.md
- • sales_2026_all.xlsx, the result from your samples
How to do it with todo.is
- Copy the prompt and describe the task, the input and the output you want.
- Attach two or three sample files in todo.is (or send them to your agent) and send the to-do.
- Your agent writes the script, runs it on your samples and shows you what came out.
- Download the .py file, requirements.txt and README, or just keep the processed result.
- Ask for changes ("also skip weekends") and it reruns everything; make it recurring for monthly jobs.
Tips for a better result
- Attach real samples with fake values if needed. Odd encodings, separators and headers are what break scripts.
- Say where it will run. File paths, line endings and installing packages differ on Windows, Mac and Linux.
- Ask for a --dry-run option for any script that renames, moves or deletes files.
- If you just need the result once, skip the setup: let your agent run the script and send you the output file.
- Your agent can turn a script you use monthly into a recurring to-do that emails you the output.
Python script generator: FAQ
- Can the agent actually run my Python script? Yes. It runs Python in its own workspace on the files you attach and shows you the output. It doesn't run anything on your computer or your servers.
- Do I need to install Python to use the script? Only if you want to run it yourself. Otherwise attach the files and your agent runs it and sends you the result.
- Can it automate websites or call APIs? It can write scripts that call public APIs or read public pages, following each site's terms. For logging in to sites, it's usually better to let your agent use its browser for you.
- What Python version does it target? Python 3.10 or later by default. Mention an older version or specific packages you're limited to, and it writes for those.
JavaScript is required to use the todo.is app.