home / skills / dkyazzentwatwa / chatgpt-skills / phone-number-formatter

phone-number-formatter skill

/phone-number-formatter

This skill standardizes and formats international phone numbers, validates inputs, detects country codes, and outputs in multiple formats.

npx playbooks add skill dkyazzentwatwa/chatgpt-skills --skill phone-number-formatter

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
757 B
---
name: phone-number-formatter
description: Standardize and format phone numbers with international support, validation, and multiple output formats.
---

# 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

## CLI Usage

```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

Overview

This skill standardizes and formats phone numbers with international support, validation, and multiple output formats. It provides batch processing, automatic country detection, carrier/type extraction, and CSV-friendly workflows to prepare phone data for integrations or analytics.

How this skill works

The skill parses input numbers using a robust phone parsing library, validates numbers, and normalizes them into formats such as E.164, national, or international. It can auto-detect country codes when missing, extract carrier or line-type information, and process columns of phone numbers from CSV files for bulk formatting. Errors and invalid entries are flagged for review.

When to use it

  • Preparing phone lists for SMS or voice API providers that require E.164 format
  • Cleaning and normalizing customer phone columns in CSVs or databases
  • Validating user-entered phone numbers during import or batch processing
  • Enriching records with carrier or line-type metadata for routing or reporting
  • Converting mixed local and international numbers into a consistent format

Best practices

  • Prefer E.164 output for downstream telecom integrations to avoid ambiguity
  • Supply a default country when parsing national-format numbers to improve detection
  • Validate and log invalid entries separately instead of dropping them silently
  • Use batch processing with incremental commits for large CSVs to reduce memory use
  • Keep the phone parsing dependency up to date to benefit from metadata improvements

Example use cases

  • Convert a marketing CSV of mixed-format phone numbers into E.164 for an SMS campaign
  • Validate and tag imports from a legacy CRM: mark invalid numbers and add carrier info
  • Standardize customer contact fields before syncing to a third-party contact platform
  • Run nightly jobs that normalize new signup phone numbers and flag suspicious patterns
  • Create international-friendly phone displays by storing E.164 and rendering national formats on the front end

FAQ

What formats can the skill output?

It supports E.164, national, and international formatting for each parsed number.

Can it process large CSV files?

Yes. Use the batch/CSV mode and process rows incrementally to manage memory and performance.

How does country detection work?

Country detection uses parsing heuristics and metadata; supplying a default country improves results for local-format inputs.