Skip to content

CPDI-CPDI/teleformat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phone Format E.164

A Python utility for managing international phone number formats according to the E.164 standard, using the naming convention for countries approved by the Government of Canada

Features

  • Dynamically fetches up-to-date phone number formats from Google's libphonenumber library
  • Includes Government of Canada country codes (ISO, GC_ID, English and French names)
  • Provides maximum digit length for each country
  • Generates regex patterns for validation
  • Outputs data in UTF-8 encoded JSON format with proper accent support (UTF-08)

Usage

Run the script to generate an updated phone_formats_e164.json file:

python phone_format.py

The generated JSON file contains:

  • Country code information
  • Maximum phone number length by country
  • Example formats
  • Total maximum digits
  • Regex patterns for validation
  • Government of Canada specific country codes

Dependencies

  • Python 3.x
  • requests
  • phonenumbers (Python port of Google's libphonenumber)

Installation

pip install requests phonenumbers

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages