Converts numbers to italian words.
Project description
N2W-IT
This library convert numbers to italian words.
For example: 73 -> settantatré.
It currently only supports converting numbers to singular male words.
Installation
- The easy way is to install from PyPI:
pip install n2w-it. - Otherwise, you can download source package e manually install with:
pip install .(desirable way),
or with:python setup.py install.
Test
- You can run:
python setup.py test. - Otherwise you can directly test with:
unittest.
Usage
-
Command line
The easy way to use, is to launch directly from terminal:
$ n2w-it 73 settantatré -
Import
You can import the libray in your code:
from n2w_it import N2W_IT instance = N2W_IT() try: result = instance.number_to_words("73") print(result) #settantatré except Exception as exception: print(exception)
APIs
-
The library supports number conversion in italian from:
- Integer to cardinal:
int_to_cardinal(73)->settantatré. - Float to cardinal:
float_to_cardinal(73.37)->settantatré virgola trentasette. - Integer to ordinal:
int_to_ordinal(73)->settantatreesimo. - Roman to ordinal:
roman_to_ordinal("LXXIII")->settantatreesimo.
- Integer to cardinal:
-
And a heuristic version:
(If theargumentpassed isNone or Empty, or the number format
is not found or valid, anExceptionis raised.)number_to_words("73")->settantatré.number_to_words("73.37")->settantatré virgola trentasette.number_to_words("73°")->settantatreesimo.number_to_words("LXXIII")->settantatreesimo.number_to_words("LXXIII°")->settantatreesimo.
History
1.0.1 (2021-03-30)
- Updated documentation.
1.0.0 (2021-03-30)
- First release on PyPI.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file n2w-it-1.0.1.tar.gz.
File metadata
- Download URL: n2w-it-1.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b5120a1ebed36dfebc1e181e6ab141c972b7a36e06cdc26e78d5b43879ed787
|
|
| MD5 |
000108eba9813a21f00f0be4a1583ba1
|
|
| BLAKE2b-256 |
fd5c80a7a8e651d16aba7768836257e3a66073ed2fa27d8c226d10dce11c375f
|
File details
Details for the file n2w_it-1.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: n2w_it-1.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a92d5ee6a4040a9f468464224cdbfa74fd69f24dde35878038a92b93abf3482f
|
|
| MD5 |
5d9207ef1b69ee2d18d0ec18c36a0259
|
|
| BLAKE2b-256 |
ac6fc6ae75b602ad76e6f6961b549417b71fbea47c38e1f22e41554c8ef6abf7
|