CoolFace
Apppublic

BNAmericas/ComparerTool

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
App README

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 main branch, 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)

  1. 1.Go to <https://huggingface.co/new-space>.
  2. 2.Owner: your personal HF account (or create an org for bnamericas — free).
  3. 3.Space name: bna-comparator.
  4. 4.SDK: Docker.
  5. 5.Visibility: Public if cost is paramount; Private if you have HF Pro ($9/mo).
  6. 6.Create the Space. HF gives you a git URL like https://huggingface.co/spaces/<owner>/bna-comparator.
  7. 7.From your laptop:
bash
   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
  1. 1.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

  1. 1.Open https://huggingface.co/spaces/<owner>/bna-comparator (or the iframe URL https://<owner>-bna-comparator.hf.space).
  2. 2.(Optional) Enter the team password if you set BNA_WEB_PASSWORD in the Space's Settings → Variables and secrets.
  3. 3.Drag a ZIP of AI Excels (or multiple .xlsx files) into the uploader.
  4. 4.Pick output language.
  5. 5.Enter BNA email and password (used per session, never stored).
  6. 6.Click ▶ Run batch.
  7. 7.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.py

The 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_PASSWORD in 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.