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_word

print(number_to_word(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 --space
viisi miljoonaa

Parameters

  • number_to_word(n, space=False):
    • n (int): The number to convert.
    • space (bool): If True, add a space between words. Default is False.

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

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.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

numtofi-0.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for numtofi-0.2.tar.gz
Algorithm Hash digest
SHA256 f35097ebdb60ca0820eaed6125aff256f6d59185d1e0cff8b27b799d7c7394e6
MD5 c43a9a33849e1a68c22b412439eadd13
BLAKE2b-256 e5263b82674126bb428d37c77b5b297a046243b3699b842d133629cf969d4f0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: numtofi-0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3b00326c63f57c535ae4e3195af06a7aa65daa3cfd89cbd0d4375335ff6572b
MD5 8ebef08edc4fa2588fbc5607d28fea22
BLAKE2b-256 c1990847bd5513fe6e939a893fc07aef4dd7e5de5cec9cddd573824fb3389e84

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