phone-number-formatter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Phone Number Formatter

电话号码格式化工具

Standardize and format phone numbers with validation.
对电话号码进行标准化与格式化,并提供验证功能。

Features

功能

  • Format Standardization: Convert to E.164, national, international
  • Validation: Check valid phone numbers
  • Country Detection: Auto-detect country codes
  • Batch Processing: Format multiple numbers
  • Carrier Info: Extract carrier/type information
  • CSV Support: Process phone columns
  • 格式标准化:转换为E.164、国内格式、国际格式
  • 验证功能:检查电话号码的有效性
  • 国家代码自动检测:自动识别国家代码
  • 批量处理:格式化多个电话号码
  • 运营商信息提取:提取运营商/号码类型信息
  • CSV支持:处理CSV文件中的电话号码列

CLI Usage

命令行使用

bash
python phone_number_formatter.py --input phones.csv --column phone --format international --output formatted.csv
bash
python phone_number_formatter.py --input phones.csv --column phone --format international --output formatted.csv

Dependencies

依赖项

  • phonenumbers>=8.13.0
  • pandas>=2.0.0
  • phonenumbers>=8.13.0
  • pandas>=2.0.0