文档:https://github.com/scrapinghub/number-parser
安装
pip install number-parser
requires Python 3.6+.
# -*- coding: utf-8 -*- from number_parser import parse, parse_number, parse_ordinal print(parse('two 3 三')) # 2 3 三 print(parse_number('two')) # 2 print(parse_ordinal('two')) # 2