BNAmericas/ComparerTool
0
BNA Comparator — Web Edition
URL-based replacement for the desktop batch app. Researchers visit the URL, upload AI Excels, sign into BNA, hit Run, download results. Same engine as the desktop app — no install required.
What you (the developer) own
- This folder is a Hugging Face Spaces repo.
- When you push code to the
mainbranch, Hugging Face rebuilds the Docker image and rolls out the new version automatically. Researchers see the change on their next page refresh. - The Space is free forever on HF's CPU tier. There is no monthly bill.
One-time deploy steps (10–15 minutes, no IT)
- Go to <https://huggingface.co/new-space>.
- Owner: your personal HF account (or create an org for
bnamericas— free). - Space name:
bna-comparator. - SDK: Docker.
- Visibility: Public if cost is paramount; Private if you have HF Pro ($9/mo).
- Create the Space. HF gives you a git URL like
https://huggingface.co/spaces/<owner>/bna-comparator. - From your laptop:
cd BNA_Comparator_Web
git init
git add .
git commit -m "Initial deploy"
git remote add space https://huggingface.co/spaces/<owner>/bna-comparator
git push space main- Hugging Face builds the Docker image (~5 minutes the first time, ~1 minute on subsequent pushes). When it finishes, the URL is live.
How researchers use it
- Open
https://huggingface.co/spaces/<owner>/bna-comparator(or the iframe URLhttps://<owner>-bna-comparator.hf.space). - (Optional) Enter the team password if you set
BNA_WEB_PASSWORDin the Space's Settings → Variables and secrets. - Drag a ZIP of AI Excels (or multiple
.xlsxfiles) into the uploader. - Pick output language.
- Enter BNA email and password (used per session, never stored).
- Click ▶ Run batch.
- Watch the live log; when done, click ⬇ Download results ZIP.
Auto-update mechanism
Every time you push to the Space's main branch:
- HF rebuilds the Docker image.
- The Space restarts in ~30 seconds.
- The next researcher visit serves the new version.
No SharePoint upload, no email blast. You ship a fix → it's live before lunch.
What's in this repo
BNA_Comparator_Web/
├── app.py Streamlit UI + run orchestration
├── Dockerfile Python 3.12 + Playwright Chromium
├── requirements.txt Streamlit, openpyxl, playwright, psutil
├── README.md This file (also the HF Space description)
├── resources/
│ └── TIE_Requirements.xlsx
└── engine/ Same code as the desktop app
├── batch_runner.py
├── rules.py
├── scraper.py
├── transformer.py
├── comparator.py
├── insights.py
├── tie_loader.py
├── currency.py
├── i18n.py
└── translator.pyThe engine/ modules are unmodified from the desktop app. The Streamlit wrapper calls batch_runner.run_batch() the same way the desktop GUI does.
Updating TIE rules
Edit resources/TIE_Requirements.xlsx in Excel. Commit. Push. The new rules are live on the URL in ~1 minute. Same workflow as the desktop app, except a single source of truth instead of one workbook per laptop.
Cost
- Hugging Face Spaces (CPU Basic): $0/month forever
- GitHub (for source backups): $0/month
- Your time after initial setup: ~0 hours/month
When you (or BNA) want it private
Two cheap options:
- HF Pro account ($9/mo) gives you private Spaces. URL is still public but auth is enforced by HF.
- Public Space + team password (no cost). Set
BNA_WEB_PASSWORDin HF Spaces secrets. The first page is a password prompt; researchers enter the shared password once per browser session.
Known limitations
- The HF free CPU tier has 16 GB RAM and 2 vCPUs — plenty for batches up to ~25 projects. Beyond that the run will still complete but take longer.
- The Space sleeps after ~48 hours of zero traffic. The first visit after a sleep takes ~90 seconds to wake. Daily-use teams never see this.
- Manual BNA login (visible interactive browser on the server) is on the roadmap. v1 supports email/password auto-login with the same stealth flags as the desktop app, which works for most BNAmericas accounts.
