Analyse telephone numbers from the commandline using daviddrysdale's Python port of Google's libphonenumber
python-phonenumbers
:pip install phonenumbers
Specify one or multiple phone numbers as commandline arguments, or input them on stdin.
Phone numbers have to be internationally unique, i.e. "+447444123456" instead of "07444123456".
$ ./telnum +447444123456 08002462468 +351217988000 +17034800500
[{'phonetype': 'mobile', 'country': 'United Kingdom', 'city': 'United Kingdom', 'carrier': 'Vodafone', 'number': '+44 7444 123456'},
{'number': '08002462468', 'error': '(0) Missing or invalid default region.'},
{'phonetype': 'fixed-line', 'country': 'Portugal', 'city': 'Lisbon', 'number': '+351 21 798 8000'},
{'phonetype': 'fixed-line or mobile', 'country': 'United States', 'city': 'Virginia', 'number': '+1 703-480-0500'}]