Skip to content

A package to convert numbers to Finnish textual representation

License

Notifications You must be signed in to change notification settings

markomanninen/numtofi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A package to convert numbers to Finnish textual representation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published