TGViewer
Python/ django Python/ django @pythonl · 58.6K subscribers
Post #4255 9.23K
👩‍💻 Преобразование текста в числовые значения является сложной задачей из-за различий в языковых представлениях.

Numerizer упрощает этот процесс, преобразуя различные текстовые форматы и варианты написания в числа. 💡

Установка:
$ pip install numerizer


>>> from numerizer import numerize
>>> numerize('forty two')
'42'
>>> numerize('forty-two')
'42'
>>> numerize('four hundred and sixty two')
'462'
>>> numerize('one fifty')
'150'
>>> numerize('twelve hundred')
'1200'
>>> numerize('twenty one thousand four hundred and seventy three')
'21473'
>>> numerize('one million two hundred and fifty thousand and seven')
'1250007'
>>> numerize('one billion and one')
'1000000001'
>>> numerize('nine and three quarters')
'9.75'
>>> numerize('platform nine and three quarters')
'platform 9.75'


@pythonl
  • 👍 37
  • 🔥 8
  • ❤ 6
  • 😱 4
  • 😁 2
More from @pythonl
  1. Oct 10, 2026🐍 Ротация прокси в Python может обходиться без списка IP и `random.choice()` Если провайд…
  2. Oct 9, 2026Вышел Python 3.15: ленивые импорты, frozendict, UTF-8 по умолчанию и JIT, который наконец…
  3. Oct 8, 2026🦙 Ollaya: запуск моделей принятия решений в стиле Ollama. Скачиваете модель, поднимаете л…
  4. Oct 7, 2026Python 3.15 почти готов: вышел RC3, финальный релиз 9 октября Python 3.15.0rc3 вышел 2 окт…
  5. Oct 6, 2026🐍 Python Workers в Cloudflare вышли в GA Cloudflare официально сделала Python полноценным…
  6. Oct 6, 2026🎇Главная идея DevSecOps: безопасность перестаёт тормозить разработку. Вместо проверок «по…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →