No description
- HTML 48.3%
- Python 47.7%
- Dockerfile 4%
| templates | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| app.py | ||
| compose.yml | ||
| Dockerfile | ||
| excel_search.py | ||
| README.md | ||
| requirements.txt | ||
Rowhunter
A tiny Flask app that fuzzy-searches every row of every Excel (.xlsx) or CSV file, with an admin page for uploading and deleting files.
Quick start
cp .env.example .env && sed -i "s/change-me/$(python3 -c 'import secrets; print(secrets.token_hex(32))')/" .env && docker compose up -d --build
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Run
python app.py
Then open:
- http://127.0.0.1:5000/ — search page
- http://127.0.0.1:5000/admin — upload / delete Excel or CSV files
Run with Docker
cp .env.example .env # then paste a generated secret into .env:
python3 -c "import secrets; print(secrets.token_hex(32))"
docker compose up -d --build
The app is then on http://localhost:8080/ (search) and
http://localhost:8080/admin (upload / delete). Files persist in the
uploads named volume; the container runs as a non-root user with a
read-only filesystem and all capabilities dropped.
Your pre-existing ./uploads files are not copied into the volume
automatically. To migrate them:
docker compose cp uploads/. web:/app/uploads/
docker compose restart web # the index is built at startup
How it works
- All
.xlsxand.csvfiles inuploads/are indexed in memory at startup and after every upload/delete — no database. - Every non-empty row of every sheet is indexed; the first non-empty row of
each sheet is used as the column header. Repeated header names get
#2,#3… suffixes so no cell value is lost. - A CSV file is indexed as a single sheet named after the file without its
extension (
data.csv→data). Delimiter is sniffed (,;tab|, defaulting to,). Encoding isutf-8-sigwithcp1252/latin-1fallbacks; UTF-16 exports (BOM) are detected, and files that decode to binary control characters — e.g. a renamed workbook — are rejected as unreadable. - Search is fuzzy (rapidfuzz): word order and partial matches both count. Tune the Min score slider to loosen or tighten matching (0–100).
Notes
.xlsxand.csvare supported (max 50 MB per file).- The whole index lives in memory — a 50 MB workbook can expand to far more RAM once parsed, so keep that in mind before raising the limit.
- Admin page is intentionally unprotected (POSTs carry a per-session CSRF token, but there is no login) — run locally, or put auth in front of it if you expose it.
- The Werkzeug debugger is off by default; start with
FLASK_DEBUG=1 python app.pyto enable it while developing. Never expose the debugger — it allows arbitrary code execution. - Tailwind is loaded via the Play CDN, so an internet connection is needed while browsing.