fanumbers
A Library to work with Farsi(Persian) numbers
Usages
to_fa_number
Use this method to convert an integer into a Persian number. You can select encoding, Persian, Arabic or All possibilities (all combinations of Arabic and Persian digits).
from fanumbers import to_fa_number
print(to_fa_number(85)) # returns a str, in Persian digits
print(to_fa_number(75, 'arabic')) # returns a str, in Arabic digits
print(to_fa_number(2018, 'all')) # returns a list of strings, all possibilities
from_fa_number
Use this method to convert a number in Persian and Arabic digits to an integer.
from fanumbers import from_fa_number
print(from_fa_number("۸۵۸۵")) # returns an int, 8585
number_to_words
Use this method to convert int or Arabic/Persian numbers into Persian words.
This method two optional arguments, ordinal which is set to False by default and if set to True will return ordinal numbers instead of cardinal. And
all_possibilities which is set to False by default and if set to True, will return a list of all possible writings of the number instead of a single string.
from fanumbers import number_to_words
print(number_to_words(85)) # هشتاد و پنج
print(number_to_words(7, ordinal=True)) # هفتم
for res in number_to_words(111111111, all_possibilities=True): # wil return multiple strings
print(res)
Metadata
Release files for fanumbers 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fanumbers-1.0.1.tar.gz | 3.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fanumbers-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / fanumbers-1.0.1.tar.gz
| Download URL | fanumbers-1.0.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f56a61fd0f863ba91f6edff3f7629da3489e70c670408b97124ca35598080378
|
|
BLAKE2b-256 checksum How to use checksums |
7d3b3a41ad9427ad540f8e877af1fdc624c8316d368f920b453dfc0337c60490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
|
Release files / fanumbers-1.0.1-py3-none-any.whl
| Download URL | fanumbers-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fbad4c2cc8228f8d0cb11208c2c2d9de154730d21db47af623a181d2340745a
|
|
BLAKE2b-256 checksum How to use checksums |
f7f3ae384ce29e605ab217524add04c00dd7e601846e28cfb4fe7ade1875e47b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
|
Security for fanumbers 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.