File processor
Upload a CSV, spreadsheet, image, or document; validate or transform it; return a clean result.
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.
Clean a CSV file
Internal data utility
Upload CSV
sales-export.csv
238 KB · Upload complete
File cleaned
Removed 18 duplicate or empty rows.
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.
Upload a CSV, spreadsheet, image, or document; validate or transform it; return a clean result.
Put a reliable Python formula behind a few labeled inputs so anyone can use it correctly.
Search records, select rows, collect changes, and connect the result to your own database logic.
Related guides
Compare Mercury with script-first and callback-driven frameworks before publishing the internal tool.
Compare notebook execution with explicit session state, forms, fragments, and multipage apps.
Read nextCompare a linear notebook tool with a callback-driven Dash application.
Read nextSee styling, authentication, deployment, and the complete Mercury publishing workflow.
Read nextA complete example
This small tool accepts a CSV, removes duplicate and incomplete rows with pandas, and returns the cleaned data.
# Cell 1 — import packages
from io import BytesIO
import pandas as pd
import mercury as mr# Cell 2 — let the user upload a CSV
uploader = mr.UploadFile(
label="Upload CSV",
max_file_size="10MB",
accept=".csv",
)# 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.
Tool-building blocks
These widgets collect information or turn a Python result into something a teammate can use.
mr.UploadFile()Accept one or several uploaded files as bytes, with optional file-type and size limits.
View APImr.Download()Turn generated text, CSV, JSON, or binary content into a download button.
View APImr.Button()Trigger a calculation, submission, refresh, or another explicit action.
View APITextInput · NumberInput · CheckBoxCollect text, numbers, and yes-or-no choices for forms and calculators.
View APImr.Table()Show searchable, sortable data and optionally let users select rows.
View APIGo deeper
Use the current API documentation for new code, then explore tutorials for the type of tool you want to build.
Read the current UploadFile documentation, including file types, multiple uploads, and size limits.
Open documentationMLJAR articleRead the existing MLJAR article that introduced the notebook upload workflow.
The article uses an older Mercury API; use the current code on this page for new projects.
Read the articleCalculatorCombine number and text inputs with the calculation logic already written in Python.
Tutorial coming soonSpreadsheetWrap repeatable Excel processing in a browser interface for a non-technical teammate.
Tutorial coming soonA different tradeoff
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.
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
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.
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.
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.
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.
Yes. Mercury supports shared-password protection. User-based, multi-account authentication is available separately when individual access control is required. Read about authentication.
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