【文件属性】:
文件名称:python-phonenumbers:Google的libphonenumber的Python端口
文件大小:5.17MB
文件格式:ZIP
更新时间:2021-05-12 21:30:50
Python
电话号码Python库
这是的Python端口。它支持Python 2.5-2.7和Python 3.x(在同一代码库中,无需转换)。
原始Java代码是版权所有(C)2009-2015 The Libphonenumber Authors。
发行,源自。
安装
使用进行安装:
pip install phonenumbers
用法示例
库处理的主要对象是PhoneNumber对象。 您可以使用parse功能从代表电话号码的字符串中创建此号码,但是您还需要指定从中拨打电话号码的国家/地区(除非该号码采用E.164格式,这在全球范围内是唯一的)。
>>> import phonenumbers
>>> x = phonenumbers.parse( " +442083661177 " , None )
>>> print (x)
Country Code: 44 National N