https://github.com/jojoee/pybaht
Baht library for Python
https://github.com/jojoee/pybaht
baht baht-text bahttext thai
Last synced: 6 months ago
JSON representation
Baht library for Python
- Host: GitHub
- URL: https://github.com/jojoee/pybaht
- Owner: jojoee
- License: mit
- Created: 2022-06-01T06:19:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-22T10:10:05.000Z (over 2 years ago)
- Last Synced: 2025-04-10T18:08:15.150Z (6 months ago)
- Topics: baht, baht-text, bahttext, thai
- Language: Python
- Homepage: https://pypi.org/project/pybaht/
- Size: 23.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pybaht
[](https://github.com/jojoee/pybaht/actions/workflows/continuous-integration.yml)
[](https://github.com/jojoee/pybaht/actions/workflows/release.yml)
[](https://pypi.python.org/pypi/pybaht/)
[](https://opensource.org/licenses/MIT)
[](https://codecov.io/gh/jojoee/pybaht)Baht library for Python
## Installation
```
pip install pybaht
```## Usage
```python
from pybaht import bahttextbahttext(37) == "สามสิบเจ็ดบาทถ้วน"
bahttext(63147.89) == "หกหมื่นสามพันหนึ่งร้อยสี่สิบเจ็ดบาทแปดสิบเก้าสตางค์"
bahttext(-0.36) == "ลบสามสิบหกสตางค์"
```## Development
```bash
# Conda env
conda create --name pybaht python=3.10.4
conda activate pybaht
# test case file
curl -L -o ./tests/testcases.csv https://docs.google.com/spreadsheets/d/e/2PACX-1vTb8PIKzgo07rn9UpcjqE0YrdMAmf4fyDbL2plUieLCyrn_5O3vDvece7UfkaArWQLUSsaw92jVpY_z/pub?gid=0&single=true&output=csv
csvtojson ./tests/testcases.csv | jq > ./tests/testcases.json
```## Other languages
- JavaScript: [jojoee/bahttext](https://github.com/jojoee/bahttext)## Reference
- [Google Sheets BAHTTEXT function](https://support.google.com/docs/answer/9982303?hl=en)