sheet-unmess
Forensic-style ingestion for messy Excel (.xlsx) and CSV files. It attempts to
identify headers, remove common non-data rows, normalize common number formats,
and produce a human-readable audit receipt.
Important: automatic header/row classification is heuristic. Always inspect the output and reconciliation receipt before using cleaned data for financial, regulatory, or other high-stakes decisions. A receipt is an audit report, not a cryptographic signature or proof that no data was lost.
Features
- Detects likely header rows and combines adjacent stacked headers.
- Propagates values from the top-left cell across merged Excel ranges.
- Classifies common title, blank, footnote, subtotal, and grand-total rows.
- Parses common US/EU number formats, accounting negatives, and percentages.
- Optionally returns a cleaning report with dropped-row details and total checks.
- Provides a CLI and a stdio MCP server for compatible AI clients.
Install from source
Python 3.10 or newer is required.
python -m venv .venv
# Windows PowerShell:
.venv\Scripts\Activate.ps1
# macOS/Linux:
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e .
Quick start
from sheet_unmess import read_messy
df = read_messy("quarterly_report.xlsx")
print(df.head())
report = read_messy("quarterly_report.xlsx", return_report=True)
print(report.data.head())
print(report.receipt.to_markdown())
For European day-first dates, pass date_dayfirst=True.
CLI
sheet-unmess clean input.xlsx --out cleaned.csv --receipt audit.md
sheet-unmess clean input.csv --out cleaned.csv --dayfirst
sheet-unmess clean input.xlsx --sheet Financials --out cleaned.csv
sheet-unmess init-ai
--out writes CSV by default; use a .parquet extension for Parquet output
(and install a suitable Parquet engine such as pyarrow).
Tests
python -m pip install -e ".[dev]"
python -m pytest
Or run the included test file directly:
python tests/test_sheet_unmess.py
MCP server
The package exposes sheet-unmess-mcp and sheet-unmess mcp. Example generic
stdio MCP configuration:
{
"mcpServers": {
"sheet-unmess": {
"command": "python",
"args": ["-m", "sheet_unmess.mcp_server"]
}
}
}
Ensure the python executable points to the environment where sheet-unmess
is installed. The sheet-unmess init-ai command writes project rules, a Cursor
MCP configuration, and attempts to update the Claude Desktop configuration.
Review generated configuration before using it.
Current limitations
.xlslegacy Excel files are not supported by the current openpyxl loader.- Header detection and row classification are heuristic and may need manual review.
- Reconciliation currently compares embedded totals against aggregated clean-row sums; nested subtotals and multiple independent sections can require more sophisticated grouping logic.
- Mixed ambiguous dates cannot be inferred reliably; use
date_dayfirstwhen appropriate. - The MCP server reads files by local path and therefore needs filesystem access to the file being processed.
License
MIT
Metadata
Release files for sheet-unmess 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sheet_unmess-1.0.0.tar.gz | 15.5 kB | Without provenance | Details for sheet_unmess-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sheet_unmess-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for sheet_unmess-1.0.0-py3-none-any.whl |
Total release size: 34.4 kB
Release files / sheet_unmess-1.0.0.tar.gz
| Download URL | sheet_unmess-1.0.0.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc4fb2a76d0e92fa3e6ff2377ac76e29f8e074c6a4bc5af62914c704102c74eb
|
|
BLAKE2b-256 checksum How to use checksums |
0cb0e43a5f2c65397bed310e6fa4769b385575121034a778fc7bc574874eb4d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / sheet_unmess-1.0.0-py3-none-any.whl
| Download URL | sheet_unmess-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e46fc54794eb3bfad59555237e8b4cdba314f296a848461367bac7556526ad7
|
|
BLAKE2b-256 checksum How to use checksums |
0ae8ddd3247129aa6ef8d82b4f6830beafe25bc77b2df68ca558fc52d00cb953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for sheet-unmess 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.