Build Internal Tools in Python

Not every tool needs a chart or a chatbot. Build forms, file processors, calculators, and practical utilities your team can open in a browser—without hiring a frontend developer.

4.3k GitHub starsOpen sourceApache-2.0

Clean a CSV file

Internal data utility

Ready

Upload CSV

sales-export.csv

238 KB · Upload complete

File cleaned

Removed 18 duplicate or empty rows.

What are internal tools in Python?

Internal tools are the practical software every team eventually needs: a form for structured input, a reliable calculator, or a one-click way to clean a messy file. They do not always need charts, and they do not need a language model. They need clear inputs, trusted Python logic, and a useful result.

Mercury keeps those pieces in the notebook you are already writing. Uploads, form controls, tables, and downloads sit beside the pandas, database, or business logic they control. Your teammate sees a simple browser interface while you keep working with ordinary Python.

File processor

Upload a CSV, spreadsheet, image, or document; validate or transform it; return a clean result.

Team calculator

Put a reliable Python formula behind a few labeled inputs so anyone can use it correctly.

Admin utility

Search records, select rows, collect changes, and connect the result to your own database logic.

A complete example

Upload, process, and download

This small tool accepts a CSV, removes duplicate and incomplete rows with pandas, and returns the cleaned data.

clean-csv.ipynb
[1]
# Cell 1 — import packages from io import BytesIO import pandas as pd import mercury as mr
[2]
# Cell 2 — let the user upload a CSV uploader = mr.UploadFile( label="Upload CSV", max_file_size="10MB", accept=".csv", )
[3]
# Cell 3 — clean the file and offer a download if uploader.value: df = pd.read_csv(BytesIO(uploader.value)) cleaned = df.drop_duplicates().dropna() removed = len(df) - len(cleaned) mr.Markdown( f"Removed **{removed}** duplicate or empty rows. " "Download the cleaned file below." ) mr.Download( data=cleaned.to_csv(index=False), filename="cleaned.csv", mime="text/csv", label="Download cleaned CSV", )

mr.Download() receives the generated CSV and displays a download button—no separate route or file-serving code is needed.

A different tradeoff

Why not use a low-code builder?

Tools such as Retool solve a similar problem with a visual builder and a large library of ready-made connectors. That is genuinely useful when a team needs many integrations quickly or prefers visual application design.

Mercury is not a feature-for-feature replacement. Its advantage is ownership and simplicity for Python teams: the tool remains a notebook you can version in git, run on your own infrastructure, and connect through ordinary Python libraries. There is no separate visual platform or per-user tool license required for the open-source, self-hosted route.

How Mercury works in depth

A changed widget updates the notebook cells below it—without callback wiring. For installation, live preview, styling, authentication, and deployment, see Turn a Jupyter Notebook into a Web App.

FAQ

Questions about internal tools in Python

Can users download a file my tool generates?+

Yes. Pass the generated string or bytes to mr.Download(), choose a filename and MIME type, and Mercury displays a download button. No separate download route is required.

Can I build an admin panel for editing records?+

Yes. Use TextInput, Select, CheckBox, Button, and other form widgets with your own database read-and-write logic. mr.Table() can display searchable data and optionally expose selected rows.

Is this a replacement for a low-code platform like Retool?+

It is not a feature-for-feature replacement. Low-code platforms provide large connector libraries and visual builders. Mercury is a better fit when you want the tool to remain ordinary Python in a notebook that you own and can self-host.

Can I limit the size of an uploaded file?+

Yes. max_file_size is a parameter on mr.UploadFile(). Values such as 500KB, 10MB, and 1GB are supported, and the limit applies to each file.

Can I password-protect an internal tool?+

Yes. Mercury supports shared-password protection. User-based, multi-account authentication is available separately when individual access control is required. Read about authentication.

Build a useful tool from your notebook

Start with one form, file workflow, or calculation your team repeats—and turn it into a browser tool they can use without Python.

pip install mercury