Skip to main content

This library converts German numbers written as text to integer and float values.

Project description

text2numde

This python package converts numbers written as text into float or integer values.

It can furthermore:

  • Validate a text to see if it represents a numbers
  • Replace numbers in sentences without modifying the sentence around the numbers.

Example usage

>>> from text2numde import text2num, is_number, sentence2num
>>> text2numde('Eins')
1

>>> text2num('Einhundertunddrei')
103

>>> text2numd'Vierzehnkommaachtneundrei')
14.893

>>> is_number('Einhundertunddrei')
True

>>> is_number('Zehnzehnhundert')
False

>>> sentence2num('Ich habe zwei Hunde und vierzig Vögel.')
Ich habe 2 Hunde und 40 gel.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

text2numde-1.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

text2numde-1.0-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page