Skip to main content

A package to convert numbers to Finnish textual representation

Project description

numtofi - Convert numbers to Finnish textual representation

numtofi is a Python module that offers functionality to convert integers into their Finnish textual representation. This module also comes with a command-line interface (CLI) tool to quickly get the Finnish representation for any number from the command line.

Installation

pip install numtofi

Usage

As a Python Module

from numtofi import number_to_text

print(number_to_text(45))  # Outputs "neljäkymmentäviisi"

Command-Line Interface (CLI)

After installation, you can use the numtofi command directly from your terminal:

$ numtofi 45
neljäkymmentäviisi

$ numtofi 5000000
viisi miljoonaa

$ numtofi 5000000 --nospaces
viisimiljoonaa

$ numtofi 5000000 --length
15

Parameters

  • number_to_text(n, spaces=False):

    • n (int): The number to convert.
    • spaces (bool): If False, removes spaces between words. Default is True.
  • number_to_text_length(n, spaces=False):

    • n (int): The number to the length of the textual representation.
    • spaces (bool): If False, removes spaces between words. Default is True.

Testing

Tests are provided in the tests directory. To run the tests:

  1. Navigate to the project root directory.
  2. Run:
python -m unittest discover tests

Update PYPI package

python setup.py sdist bdist_wheel
python -m twine upload dist/*

Contributing

Contributions are welcome! Please make sure to update tests as appropriate when proposing changes.

License

MIT

Project details


Download files

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

Source Distribution

numtofi-0.8.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

numtofi-0.8-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file numtofi-0.8.tar.gz.

File metadata

  • Download URL: numtofi-0.8.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for numtofi-0.8.tar.gz
Algorithm Hash digest
SHA256 f3ee6ca35ddf8e54bccd285e5fcc5bb9d1bef43d7e1513c03458f0d4f0cf2e49
MD5 1017edf0ee7567ead41c1bfc9e68a81c
BLAKE2b-256 402aa4d4608d51a018e24e9ae67fe0214ffd5f928fe5e0a8d8600975d9d2bb08

See more details on using hashes here.

File details

Details for the file numtofi-0.8-py3-none-any.whl.

File metadata

  • Download URL: numtofi-0.8-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for numtofi-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e6594d49ff87e1e16bf6d2b49d6f639086482147dbb274c6f4c647d506e6ed91
MD5 268b40f6c7c821a171abab6de6e544f2
BLAKE2b-256 1b5eb04df279fdd212b47c935b8bb2583d7cdf27b645bb9a82b0ea3e44d68949

See more details on using hashes here.

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