Button guide
Turn your pandas data cleaning script into a self-service tool colleagues upload a CSV or Excel file and get the clean file back
You can turn your pandas script into a web form for your colleagues using Button (https://button.bitgate.dev), which runs the script on your own computer while giving them a browser page to upload files and download the output. The Free plan costs $0 for 1 published tool, up to 3 colleagues, and 100 runs per month, and each run can take up to 8 files of up to 25 MB each (100 MB total).
Exposing cleaning steps as form inputs
When you clean a CSV or Excel file for someone, you are usually running the same handful of pandas operations with slight variations depending on where the file came from. To make the script self-service, replace hard-coded paths and interactive prompts with command-line arguments using Python's argparse module. Button maps its form inputs - files, text, number, yes/no, and choice fields - straight to those arguments.
The typical cleaning steps map to form controls like this:
- Removing duplicate rows, trimming leading and trailing whitespace from string columns, and fixing mixed date formats work well as yes/no inputs.
- Normalising currency values (say, picking a target currency) or choosing which column preset to map against work best as choice dropdowns, so nobody types a bad value.
- The uploaded spreadsheet and the folder where the cleaned file goes are passed as file and folder path arguments.
Fixed flags such as --currency are part of the command you approve on your machine; colleagues only supply the values for the form fields. Every form value is passed to your Python script as its own argument, with no shell in between, and Button blocks values from starting with -. Because of that, a yes/no form input passes a value (like true or false) after your fixed flag rather than toggling the presence of a flag.
Preparing the Python script
Open your cleaning script and take out any hard-coded file paths or
input()prompts.Add an
argparseblock that accepts the input file path, an output directory path, and the options you want to put on the form.
import argparse
import os
import pandas as pd
parser = argparse.ArgumentParser()
parser.add_argument("--input-file", required=True)
parser.add_argument("--output-dir", required=True)
parser.add_argument("--drop-duplicates", choices=["true", "false"], default="true")
parser.add_argument("--trim-whitespace", choices=["true", "false"], default="true")
parser.add_argument("--fix-dates", choices=["true", "false"], default="false")
parser.add_argument("--currency", choices=["USD", "EUR", "GBP", "none"], default="none")
parser.add_argument("--column-map", choices=["standard", "legacy", "none"], default="standard")
args = parser.parse_args()
if args.input_file.endswith(".csv"):
df = pd.read_csv(args.input_file)
else:
df = pd.read_excel(args.input_file)
if args.column_map == "standard":
df = df.rename(columns={"Cust_ID": "customer_id", "Amt": "amount", "Dt": "date"})
elif args.column_map == "legacy":
df = df.rename(columns={"CID": "customer_id", "Total": "amount", "OrderDate": "date"})
if args.trim_whitespace == "true":
str_cols = df.select_dtypes(include="object").columns
df[str_cols] = df[str_cols].apply(lambda s: s.str.strip())
if args.drop_duplicates == "true":
df = df.drop_duplicates()
if args.fix_dates == "true" and "date" in df.columns:
df["date"] = pd.to_datetime(df["date"], errors="coerce").dt.strftime("%Y-%m-%d")
if args.currency != "none" and "amount" in df.columns:
df["amount"] = (
df["amount"].astype(str).str.replace(r"[^0-9.-]", "", regex=True)
)
df["amount"] = pd.to_numeric(df["amount"], errors="coerce")
df["currency"] = args.currency
out_name = "cleaned_" + os.path.basename(args.input_file)
out_path = os.path.join(args.output_dir, out_name)
if out_path.endswith(".csv"):
df.to_csv(out_path, index=False)
else:
df.to_excel(out_path, index=False)
- Test the script from your terminal to make sure it reads the input file and writes the cleaned version into the output folder without asking anything interactively.
Publishing the script on Button
Sign in at https://button.bitgate.dev.
Install the Button runner on your computer (macOS, Linux, or Windows) using the one-line command the site shows you. It is a
curlcommand on macOS and Linux, and a PowerShell command on Windows.Open the local setup page and pick your Python script.
Describe the inputs on the form: set the input file field to take the uploaded CSV or Excel file, add yes/no fields for removing duplicates, trimming whitespace, and fixing dates, and add choice fields for currency normalisation and column mapping.
Approve the exact command on your computer and publish. The runner pins the command you approved by hash, so it will only ever execute that command. If you edit the tool later, your colleagues will have to confirm the new version before they can run it.
Invite your colleagues. Button gives the tool its own page, and your colleagues open the link from their invite email, sign in with Google or a one-time email code, fill in the form, press Run, and download the cleaned file when it finishes. They don't install anything and they never pay.
Every run is logged with who ran it and when, and you can revoke a colleague's access or set it to expire whenever you want.
File limits, runtime rules, and pricing
Jobs run on your computer, never in Button's cloud, while Button's servers relay the form values and files between your colleague's browser and your machine. Because the script runs locally on your hardware, your computer has to be on and online when someone uses the tool. The tool page shows your colleagues whether your computer is Ready, Busy, or Offline, and it runs one job at a time. Logs are capped at 1 MB per run, inputs are deleted 24 hours after a run and outputs after 7 days. Recipients never pay, and downgrading deletes nothing.
| Limit | Free | Pro |
|---|---|---|
| Price | $0 | $15/month, or $144/year |
| Published tools | 1 | 50 |
| People you invite (you don't count) | 3 | 250 |
| Runs per month (including yours) | 100 | 5,000 |
| File transfer per month | 1 GB | 50 GB |
| Per run, on both plans | 30 minutes; up to 8 files, 25 MB each, 100 MB total | 30 minutes; up to 8 files, 25 MB each, 100 MB total |
When Excel's Power Query is the better choice
You don't always need a Python script behind a web form. If your colleague works in Excel all day and the cleaning steps are standard - removing duplicates, trimming whitespace, splitting or renaming columns, fixing date formats - Excel's built-in Power Query is often enough because the colleague can do it themselves right inside their workbook. Once you help them set up the query against a folder or a source file once, they just click Refresh next time without waiting for your computer to be online or hitting a 25 MB per-file upload cap.
Keep the job in pandas and put it on Button when the cleaning logic is already written and maintained in Python, when multiple people need to run the exact same rules without touching the query steps, or when they aren't comfortable managing Power Query themselves.
FAQ
What happens if my computer is asleep or turned off when someone tries to clean a file?
Your computer has to be on and online for the job to run, since execution happens on your machine and never in Button's cloud. When your computer is asleep or disconnected, the tool page shows its status as Offline so colleagues know they can't run it right then.
Can a colleague pass extra flags into my script through a text field?
No. The runner executes your program without a shell, passes every form value as its own separate argument, and rejects any value that starts with -. It also only runs the exact command you approved on your computer, pinned by hash.
How long do uploaded spreadsheets and cleaned output files stay on Button?
Input files are deleted 24 hours after a run finishes, and the output files are deleted after 7 days. Run logs (up to 1 MB per run) record who ran the tool and when.
Can I run the tool across two computers so it is still available when my laptop is closed?
Every workspace supports one computer (runner) on both the Free and Pro plans. If you pair a new computer to your workspace, it replaces the previous one.
Does Button only work with Python and pandas?
No, any program that runs on your computer works. You can use Python, R (with commandArgs()), Node, PowerShell (with a param() block), shell scripts (using $1 and $2), or compiled binaries.
Last updated
Put your script behind a form
Button turns a script on your computer into a web form. Colleagues sign in, fill it in, press Run and download the results. Free for 1 tool and 3 people.