Thai localization package
Project description
num-thai-cnv
num-thai-cnv is python library, primarily focused on converting number into Thai text and vice versa.
Installation
pip install num-thai-cnv
Features
Convert number to Thai text and vice versa, convert Arabic to Thai number.
Initialize the object
from num_thai_cnv import ThaiNumberConverter
thainum = ThaiNumberConverter()
ThaiNumberConverter Methods
Method name | Description | Command | Result |
---|---|---|---|
ToText | Convert Arabic number to Thai text | thainum.ToText(123) or thainum.ToText('123') | 'หนึ่งร้อยยี่สิบสาม' |
ToNum | Convert Thai text to Arabic number | thainum.ToNum('หนึ่งร้อยยี่สิบสาม') | '123' |
ToThaiNumber | Convert Arabic number to Thai number | thainum(123) or thainum('123') | '๑๒๓' |
ThaiNumberConverter Notes
-
ToText and ToThaiNumber method can support unlimited digit.
-
ToNum method does whitelist the following words, violation will lead to error 'Check if text contains excluded word'.
Words Words Words เอ็ด หก ร้อย หนึ่ง เจ็ด พัน สอง แปด หมื่น สาม เก้า แสน สี่ สิบ ล้าน ห้า ยี่
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
num_thai_cnv-1.0.1.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file num_thai_cnv-1.0.1.tar.gz
.
File metadata
- Download URL: num_thai_cnv-1.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90f52ad786b2cf5f8598c1af2704ec50920687379a156d5f1e954a74c284603b |
|
MD5 | f7605759633168a1ec956a5077e0028a |
|
BLAKE2b-256 | 886a3884316af86e2e06c75c575dd45e223383c7c7425fe7a35f73046bf7ff19 |
File details
Details for the file num_thai_cnv-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: num_thai_cnv-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfc3f669ec3b2bc931836ed6a41bf89ae3930c567c1e09ba6ef98b98ce2c3dbf |
|
MD5 | dcfe144abe19ec37137e0bb82b60e710 |
|
BLAKE2b-256 | b8ecc8b86c940c7956c77cb0ff5247ad532a509f1bb0d6ce8a45c51f3c700f5a |