A production-grade B2B web application for banking compliance officers. Upload a client spreadsheet, verify every LEI against GLEIF and lei-lookup.com, and download the enriched file, with Entity Status and Next Renewal Date written back into Excel automatically.
- π Excel / LibreOffice Calc support β upload
.xlsx,.ods, or.xlsclient files - π Auto-detection of the LEI column by header name or 20-character pattern
- β Dual-source lookup β GLEIF official API first, lei-lookup.com as fallback
- π¨ Colour-coded output β green (ACTIVE), red (INACTIVE/NOT FOUND) written back to Excel
- π‘ Real-time progress β Server-Sent Events stream with live per-LEI feed
- π‘οΈ Anti-blocking β token-bucket rate limiter + exponential back-off per host
- π Observability β Prometheus
/metricsendpoint + structured JSON logs - π³ Containerised β single
docker compose updeployment
π¦ You can visit our site: https://www.findlei.com
Note: The current API specification supports up to 200 LEI codes per uploaded file. Each document you upload is processed as a single batch run of up to 200 records.
Banks-L.E.I./
βββ main.py # FastAPI app β upload, process, SSE stream, download
βββ lei_checker.py # GLEIF API + lei-lookup.com fallback + batch processor
βββ excel_handler.py # openpyxl read/write with auto-column detection
βββ rate_limiter.py # Token-bucket rate limiter per host
βββ log_config.py # Structured JSON logging (prod) / human-readable (dev)
βββ metrics.py # Prometheus counters, histograms, gauges
βββ static/
β βββ index.html # Full frontend β single file, no build step
βββ tests/
β βββ conftest.py
β βββ test_api.py # FastAPI integration tests (9 tests)
β βββ test_excel_handler.py # Excel read/write tests (11 tests)
β βββ test_lei_checker.py # LEI engine unit tests (16 tests)
β βββ test_rate_limiter.py # Token bucket tests (6 tests)
βββ .github/
β βββ workflows/
β βββ ci.yml # Test β Security scan β Secret scan β Docker + SBOM
βββ Dockerfile
βββ docker-compose.yml
Note: Lei_checker.py Excel_hander.py Rate_limiter.py have deleted for safety reasons.
- Python 3.11+
- Docker + Docker Compose (for production deployment)
git clone https://github.com/ThanasisSoftwareDeveloper/Banks-L.E.I..git findlei
cd findlei# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run dev server
LOG_FORMAT=text uvicorn main:app --reload --port 8000App runs at: http://localhost:8000
API docs: http://localhost:8000/docs
Metrics: http://localhost:8000/metrics
Health: http://localhost:8000/health
LOG_FORMAT=text pytest -vOutput:
42 passed in 4.1s
docker compose up -d --buildclient_max_body_size 10m;LimitRequestBody 10485760
Nginx reverse proxy with SSL β see the full config in README under Nginx section. Key setting for SSE:
proxy_buffering off;
proxy_read_timeout 300s;- Open
http://localhost:8000 - Upload your client Excel file (
.xlsx,.ods, or.xls) - The app auto-detects the LEI column
- Click Check LEIs β watch the live feed
- Download the enriched file with Entity Status + Next Renewal Date written back
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/upload |
Upload Excel; returns job_id + preview |
| POST | /api/process/{job_id} |
Start async batch check |
| GET | /api/stream/{job_id} |
SSE real-time progress stream |
| GET | /api/status/{job_id} |
Poll-based status + results |
| GET | /api/download/{job_id} |
Download enriched Excel |
| GET | /health |
Health check |
| GET | /metrics |
Prometheus metrics |
| Check | Tool | Status |
|---|---|---|
| Unit + integration tests | pytest + anyio | β 42 tests |
| Dependency vulnerabilities (SCA) | pip-audit | β CI enforced |
| Static code analysis | bandit | β MEDIUM+ severity |
| Secret scanning | TruffleHog | β verified secrets only |
| SBOM generation | Syft | β CycloneDX + SPDX |
| Container build | Docker Buildx | β on every push to main |
| Layer | Technology |
|---|---|
| Backend | Python 3.12, FastAPI (async) |
| Frontend | Vanilla HTML/CSS/JS (no build step) |
| Excel I/O | openpyxl |
| HTTP client | httpx (async, connection pooling) |
| HTML parsing | BeautifulSoup4 + lxml |
| Rate limiting | Custom token-bucket (per host) |
| Progress streaming | Server-Sent Events |
| Observability | prometheus-client, structured JSON logs |
| Containerisation | Docker + Docker Compose |
| CI/CD | GitHub Actions |
Banks typically have hundreds of LEI codes. The app handles this with:
- Token bucket per host: GLEIF β 2 req/s, lei-lookup β 0.4 req/s
- Exponential back-off on HTTP 429 / 503
- Shared connection pool (single
httpx.AsyncClientfor the full batch) - Browser-like headers on scraping requests
GPL-3.0 β see LICENSE
Built by Thanasis Koufos Β· GitHub