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)
: IfFalse
, removes spaces between words. Default isTrue
.
-
number_to_text_length(n, spaces=False)
:n (int)
: The number to the length of the textual representation.spaces (bool)
: IfFalse
, removes spaces between words. Default isTrue
.
Testing
Tests are provided in the tests
directory. To run the tests:
- Navigate to the project root directory.
- 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
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
Built Distribution
File details
Details for the file numtofi-0.7.tar.gz
.
File metadata
- Download URL: numtofi-0.7.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | acea4658a1eb0e2bb78d5d2112ce2b35ac57a90bf7afa6c7b202789321edf9f6 |
|
MD5 | 029e5d93101b5f8c7fc5215f3c89b2f2 |
|
BLAKE2b-256 | 40502bf8de5372757f1984db09eedef49b88ecfd02b992403c0090385c943788 |
File details
Details for the file numtofi-0.7-py3-none-any.whl
.
File metadata
- Download URL: numtofi-0.7-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa375de46199cf7c61ba9e6bf8fc83d60a414186d81e72ff1604535ec3e680d9 |
|
MD5 | eb3decfebbaed97ed7a1e668bede6214 |
|
BLAKE2b-256 | e9920f95f872d9018b54b5e393f802b3013152d988c541d78258374e1032f477 |