Skip to content
activeBackendStarted: Sep 15, 2026

BD Biz Normalizer — Phone, Geo District & SME Data Sanitizer

Ultra-fast Bangladeshi Phone Number, Geo District, and SME Customer Normalizer with E.164 standardization and Bengali numeral support.

Technology Stack

PythonFastAPIRegexE.164PydanticTypeScript

My Role

Lead Backend Architect

System Architecture
  1. 1Raw Input Ingestion Layer
  2. 2Bengali Numeral Normalizer
  3. 3E.164 Telco Operator Classifier
  4. 4Geo District & Thana Resolver
  5. 5Clean JSON & CSV Exporter
  • 1Raw Input Ingestion Layer──▶2Bengali Numeral Normalizer
  • 2Bengali Numeral Normalizer──▶3E.164 Telco Operator Classifier
  • 3E.164 Telco Operator Classifier──▶4Geo District & Thana Resolver
  • 4Geo District & Thana Resolver──▶5Clean JSON & CSV Exporter

Overview

Bangladeshi retail and e-commerce platforms routinely ingest customer contact data filled with inconsistent notations: mixed Bengali numerals (০১৭১...), varied prefixes (+880, 880, 0, or omitted), and regional district colloquialisms (ctg, dhk, cumilla).

BD Biz Normalizer provides deterministic, high-throughput parsing and sanitation of customer phone numbers, administrative districts, and currency formats with zero cloud dependencies.

Key Capabilities

  • Strict E.164 Telecom Formatting: Converts any valid Bangladeshi mobile string into standard +8801XXXXXXXXX while detecting the underlying carrier (Grameenphone, Banglalink, Robi, Airtel, Teletalk).
  • Bengali Numeral Transliteration: Automatically converts Bengali digits (০-৯) to standard ASCII numerals before running regex validation.
  • Administrative District Harmonization: Standardizes informal abbreviations and legacy British spellings into modern Bangladesh Bureau of Statistics (BBS) recognized districts and divisions.
  • Microsecond In-Memory Execution: Written with zero heavy machine learning overhead, capable of sanitizing 50,000 customer rows per second on single-core CPU instances.

Interactive Source Explorer & Live CLI Sandbox

Browse source implementation and execute in-browser sandbox simulation.

GitHub Repo
$bd-normalize batch input_customers.csv --out clean_customers.csv
Source Tree (1 Files)
phone.pypython
import re

OPERATOR_PREFIXES = {
    "17": "Grameenphone", "13": "Grameenphone",
    "19": "Banglalink",   "14": "Banglalink",
    "18": "Robi",         "16": "Airtel",
    "15": "Teletalk",
}

def normalize_bd_phone(raw: str) -> dict:
    digits = re.sub(r'\D', '', raw)
    if digits.startswith("880"):
        digits = digits[3:]
    elif digits.startswith("0"):
        digits = digits[1:]
    prefix = digits[:2]
    return {
        "e164": f"+880{digits}",
        "operator": OPERATOR_PREFIXES.get(prefix, "Unknown"),
        "valid": len(digits) == 10 and prefix in OPERATOR_PREFIXES
    }

Project Changelog

Initial Normalization Engine

Engineered deterministic phone and numeral transformer supporting all Bangladeshi telcos.

District & Thana Fuzzy Matching

Added 64-district and 495-upazila spelling variance normalization.