ComparerTool / README.md
GopiBNA's picture
Update README.md
95148c6 verified
|
Raw History Blame Contribute Delete
4.49 kB
metadata
title: BNA Comparator
emoji: 🧭
colorFrom: indigo
colorTo: purple
sdk: docker
pinned: false
short_description: Compare Agentic-AI Excels against BNAmericas projects.

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. Go to https://huggingface.co/new-space.
  2. Owner: your personal HF account (or create an org for bnamericas β€” free).
  3. Space name: bna-comparator.
  4. SDK: Docker.
  5. Visibility: Public if cost is paramount; Private if you have HF Pro ($9/mo).
  6. Create the Space. HF gives you a git URL like https://huggingface.co/spaces/<owner>/bna-comparator.
  7. 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
    
  8. 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. Open https://huggingface.co/spaces/<owner>/bna-comparator (or the iframe URL https://<owner>-bna-comparator.hf.space).
  2. (Optional) Enter the team password if you set BNA_WEB_PASSWORD in the Space's Settings β†’ Variables and secrets.
  3. Drag a ZIP of AI Excels (or multiple .xlsx files) into the uploader.
  4. Pick output language.
  5. Enter BNA email and password (used per session, never stored).
  6. Click β–Ά Run batch.
  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.