phonenumbers Python电话号码解析和格式化库
phonenumbers电话号码解析和格式化库
phonenumbers,Python第三方库,可以用于解析和格式化电话号码的python库,是libphonenumber库的Python端口,支持Python 2.5-2.7和Python 3.x。
phonenumbers应用实例
>>> import phonenumbers
>>> x = phonenumbers.parse("+120012301", None)
>>> print(x)
Country Code: 1 National Number: 20012301 Leading Zero: False
>>> z = phonenumbers.parse("00 1 650 253 2222", "GB") # as dialled from GB, not a GB number
>>> print(z)
Country Code: 1 National Number: 6502532222 Leading Zero(s): False
Github开源协议和stars
Apache-2.0 license
Github 3.3k stars
phonenumbers安装命令
pip install phonenumbers
Python版本要求
It supports Python 2.5-2.7 and Python 3.x
phonenumbers文档
Github:phonenumbers
Documentation:phonenumbers
免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。